summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1998-08-27 14:59:55 +0000
committerjkh <jkh@FreeBSD.org>1998-08-27 14:59:55 +0000
commitb68b3fb56c7fdde8b76c41f62aecd4ce78ef8db2 (patch)
tree1104f64d608e6d57a0e7b8d3a0186eee76260cb3 /usr.sbin
parentab70f0b2185357e03979fcddc4286e99bae8a2f4 (diff)
downloadFreeBSD-src-b68b3fb56c7fdde8b76c41f62aecd4ce78ef8db2.zip
FreeBSD-src-b68b3fb56c7fdde8b76c41f62aecd4ce78ef8db2.tar.gz
Fix recursive package add problem (for on-disk package files) I introduced
with the change in semantics to make_playpen(). Now package dependencies more than 2 levels deep should work again. Pass the hat.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_install/add/perform.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/pkg_install/add/perform.c b/usr.sbin/pkg_install/add/perform.c
index dc7c430..2d80f85 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.49 1998/02/16 17:16:14 jkh Exp $";
+ "$Id: perform.c,v 1.50 1998/07/17 14:56:31 eivind Exp $";
#endif
/*
@@ -126,8 +126,11 @@ pkg_do(char *pkg)
}
Home = make_playpen(playpen, sb.st_size * 4);
if (!Home)
- warnx("unable to make playpen for %d bytes", sb.st_size * 4);
+ errx(1, "unable to make playpen for %d bytes", sb.st_size * 4);
where_to = Home;
+ /* Since we can call ourselves recursively, keep notes on where we came from */
+ if (!getenv("_TOP"))
+ setenv("_TOP", Home, 1);
if (unpack(pkg_fullname, extract)) {
warnx(
"unable to extract table of contents file from `%s' - not a package?",
@@ -240,7 +243,7 @@ pkg_do(char *pkg)
if (!Fake) {
if (!isURL(pkg) && !getenv("PKG_ADD_BASE")) {
- snprintf(path, FILENAME_MAX, "%s/%s.tgz", Home, p->name);
+ snprintf(path, FILENAME_MAX, "%s/%s.tgz", getenv("_TOP"), p->name);
if (fexists(path))
cp = path;
else
OpenPOWER on IntegriCloud