summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1997-10-18 05:54:17 +0000
committerjkh <jkh@FreeBSD.org>1997-10-18 05:54:17 +0000
commitfbcce1e3041d8c5bd2f429d8911bc2df3927ef05 (patch)
tree46790b53c6eca9fa154ec729175491341824eb49
parent835fbd1d3aba06858f975edde71c178ae29b1f4d (diff)
downloadFreeBSD-src-fbcce1e3041d8c5bd2f429d8911bc2df3927ef05.zip
FreeBSD-src-fbcce1e3041d8c5bd2f429d8911bc2df3927ef05.tar.gz
- 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) - document $PKG_PATH - use -v on pkg_add for dependent packages Submitted by: hubertf@NetBSD.ORG Obtained from: NetBSD
-rw-r--r--usr.sbin/pkg_install/add/perform.c4
-rw-r--r--usr.sbin/pkg_install/add/pkg_add.114
-rw-r--r--usr.sbin/pkg_install/lib/file.c7
3 files changed, 19 insertions, 6 deletions
diff --git a/usr.sbin/pkg_install/add/perform.c b/usr.sbin/pkg_install/add/perform.c
index c921b90..28cd30f 100644
--- a/usr.sbin/pkg_install/add/perform.c
+++ b/usr.sbin/pkg_install/add/perform.c
@@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
- "$Id: perform.c,v 1.43 1997/10/08 07:45:48 charnier Exp $";
+ "$Id: perform.c,v 1.44 1997/10/13 15:03:46 jkh Exp $";
#endif
/*
@@ -246,7 +246,7 @@ pkg_do(char *pkg)
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 --git a/usr.sbin/pkg_install/add/pkg_add.1 b/usr.sbin/pkg_install/add/pkg_add.1
index cba9744..32431ef 100644
--- a/usr.sbin/pkg_install/add/pkg_add.1
+++ b/usr.sbin/pkg_install/add/pkg_add.1
@@ -69,7 +69,11 @@ The following command line arguments are supported:
.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
@@ -322,6 +326,14 @@ is installed, even if the user might change it with the
.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 --git a/usr.sbin/pkg_install/lib/file.c b/usr.sbin/pkg_install/lib/file.c
index 8bf27b6..ef52dca 100644
--- a/usr.sbin/pkg_install/lib/file.c
+++ b/usr.sbin/pkg_install/lib/file.c
@@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
- "$Id: file.c,v 1.28 1997/07/01 06:13:50 jkh Exp $";
+ "$Id: file.c,v 1.29 1997/10/08 07:47:54 charnier Exp $";
#endif
/*
@@ -294,15 +294,16 @@ fileFindByPath(char *base, char *fname)
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;
}
OpenPOWER on IntegriCloud