Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/usr.sbin/pkg_install/lib Pull up revision 1.45 (request...



details:   https://anonhg.NetBSD.org/src/rev/5097a60d5236
branches:  netbsd-1-5
changeset: 490372:5097a60d5236
user:      he <he%NetBSD.org@localhost>
date:      Fri Dec 15 04:11:25 2000 +0000

description:
Pull up revision 1.45 (requested by hubertf):
  Accept ``.tbz'' as an alternative suffix; compress with bzip2 if
  a .tbz suffix is given.  Fix pkg_info to work via ftp, either
  via URL on command line or from PKG_PATH environment variable.

diffstat:

 usr.sbin/pkg_install/lib/file.c |  18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diffs (59 lines):

diff -r 435b89149167 -r 5097a60d5236 usr.sbin/pkg_install/lib/file.c
--- a/usr.sbin/pkg_install/lib/file.c   Fri Dec 15 04:08:26 2000 +0000
+++ b/usr.sbin/pkg_install/lib/file.c   Fri Dec 15 04:11:25 2000 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: file.c,v 1.37.4.6 2000/12/15 04:07:35 he Exp $ */
+/*     $NetBSD: file.c,v 1.37.4.7 2000/12/15 04:11:25 he Exp $ */
 
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static const char *rcsid = "from FreeBSD Id: file.c,v 1.29 1997/10/08 07:47:54 charnier Exp";
 #else
-__RCSID("$NetBSD: file.c,v 1.37.4.6 2000/12/15 04:07:35 he Exp $");
+__RCSID("$NetBSD: file.c,v 1.37.4.7 2000/12/15 04:11:25 he Exp $");
 #endif
 #endif
 
@@ -310,7 +310,7 @@
 
 /*
  * Try and fetch a file by URL, returning the directory name for where
- * it's unpacked, if successful.
+ * it's unpacked, if successful. To be handed to leave_playpen() later.
  */
 char   *
 fileGetURL(char *base, char *spec)
@@ -329,6 +329,7 @@
  *   - current dir, and if not found there, look
  *   - $base/../All
  *   - all dirs in $PKG_PATH
+ * Returns a full path/URL where the pkg can be found
  */
 char   *
 fileFindByPath(char *base, char *fname)
@@ -457,7 +458,7 @@
                         */
                        {
                                char *s;
-
+                               
                                if ((s = strstr(tmp, ".tgz")) ||
                                    (s = strstr(tmp, ".tgz")) ||
                                    (s = strstr(tmp, ".t[bg]z"))) {
@@ -498,9 +499,12 @@
                                        char *s;
                                        char buf2[FILENAME_MAX];
                                        
-                                       s = strstr(tmp, ".tgz");
-                                       *s = '\0';
-                                       snprintf(buf2, FILENAME_MAX, "%s-[0-9]*.tgz", tmp);
+                                       if ((s = strstr(tmp, ".tgz")) ||
+                                           (s = strstr(tmp, ".tgz")) ||
+                                           (s = strstr(tmp, ".t[bg]z"))) {
+                                               *s = '\0';
+                                       }
+                                       snprintf(buf2, FILENAME_MAX, "%s-[0-9]*.t[bg]z", tmp);
                                        s = findbestmatchingname(dirname_of(buf2), basename_of(buf2));
                                        if (s) {
                                                char *t;



Home | Main Index | Thread Index | Old Index