diff --git a/usr.sbin/pkg_install/add/perform.c b/usr.sbin/pkg_install/add/perform.c index c921b900db40..28cd30f45aec 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 cba9744d5217..32431effa4bd 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 8bf27b655348..ef52dcaa6133 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; }