- 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
This commit is contained in:
Jordan K. Hubbard 1997-10-18 05:54:17 +00:00
parent 47af563ed0
commit 940d89a9d5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=30533
3 changed files with 19 additions and 6 deletions

View file

@ -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)

View file

@ -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 ,

View file

@ -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;
}