From owner-freebsd-hackers Fri Oct 17 21:59:46 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id VAA27689 for hackers-outgoing; Fri, 17 Oct 1997 21:59:46 -0700 (PDT) (envelope-from owner-freebsd-hackers) Received: from mail.NetBSD.ORG (homeworld.cygnus.com [205.180.83.70]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id VAA27681 for ; Fri, 17 Oct 1997 21:59:40 -0700 (PDT) (envelope-from hubertf@NetBSD.ORG) From: hubertf@NetBSD.ORG Received: (qmail 17703 invoked by uid 1127); 17 Oct 1997 23:01:31 -0000 Date: 17 Oct 1997 23:01:31 -0000 Message-ID: <19971017230131.17696.qmail@mail.NetBSD.ORG> To: freebsd-hackers@freebsd.org Subject: pkg_add glitch Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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; }