Skip site navigation (1)Skip section navigation (2)
Date:      17 Oct 1997 23:01:31 -0000
From:      hubertf@NetBSD.ORG
To:        freebsd-hackers@freebsd.org
Subject:   pkg_add glitch
Message-ID:  <19971017230131.17696.qmail@mail.NetBSD.ORG>

next in thread | raw e-mail | index | archive | help
Hello,

during importing the latest pkg_install tools from FreeBSD into
NetBSD, I have fixed a bug that affects installing local packages
(3rd point below):

 - most important: do string-magic on the right variable when trying
   to find dependent packages on the local disk (i.e. package given as
   filename, not URL)

Besides that, the patch below does:

 - document $PKG_PATH
 - use -v on pkg_add for dependent packages (forgot on last commit)

I hope that you can make use of this! :-)


 - Hubert, 19971015

diff -bur pkg_install.orig-971013.2/add/perform.c pkg_install/add/perform.c
--- pkg_install.orig-971013.2/add/perform.c	Tue Oct 14 22:29:49 1997
+++ pkg_install/add/perform.c	Wed Oct 15 04:14:28 1997
@@ -251,7 +251,7 @@
 		    if (cp) {
 			if (Verbose)
 			    printf("Loading it from %s.\n", cp);
-			if (vsystem("pkg_add %s", cp)) {
+			if (vsystem("pkg_add %s%s", Verbose ? "-v " : "", cp)) {
 			    warnx("autoload of dependency `%s' failed%s",
 				cp, Force ? " (proceeding anyway)" : "!");
 			    if (!Force)
diff -bur pkg_install.orig-971013.2/add/pkg_add.1 pkg_install/add/pkg_add.1
--- pkg_install.orig-971013.2/add/pkg_add.1	Tue Oct 14 16:54:47 1997
+++ pkg_install/add/pkg_add.1	Wed Oct 15 03:26:57 1997
@@ -70,7 +70,11 @@
 .It Ar pkg-name [... pkg-name]
 The named packages are installed.  A package name of - will cause
 .Nm
-to read from stdin.
+to read from stdin. If the packages are not found in the current
+working directory, 
+.Nm
+will search them in each directory named by
+.Ev PKG_PATH .
 .It Fl v
 Turn on verbose output.
 .It Fl I
@@ -323,6 +327,14 @@
 .Fl p
 flag to
 .Cm pkg_add .
+.Sh ENVIRONMENT
+The value of the
+.Ev PKG_PATH
+is used if a given package can't be found.  The environment variable
+should be a series of entries seperated by colons.  Each entry
+consists of a directory name. The current directory may be indicated
+implicitly by an empty directory name, or explicitly by a single
+period.
 .Sh SEE ALSO
 .Xr pkg_create 1 ,
 .Xr pkg_delete 1 ,
diff -bur pkg_install.orig-971013.2/lib/file.c pkg_install/lib/file.c
--- pkg_install.orig-971013.2/lib/file.c	Tue Oct 14 22:33:46 1997
+++ pkg_install/lib/file.c	Wed Oct 15 04:41:34 1997
@@ -299,15 +299,16 @@
     if (base) {
 	strcpy(tmp, base);
 
-	cp = strrchr(fname, '/');
+	cp = strrchr(tmp, '/');
 	if (cp) {
 	    *cp = '\0';	/* chop name */
-	    cp = strrchr(fname, '/');
+	    cp = strrchr(tmp, '/');
 	}
 	if (cp) {
 	    *(cp + 1) = '\0';
 	    strcat(cp, "All/");
 	    strcat(cp, fname);
+	    strcat(cp, ".tgz");
 	    if (fexists(tmp))
 		return tmp;
 	}




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19971017230131.17696.qmail>