aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_install/add/perform.c
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1998-08-27 14:59:55 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1998-08-27 14:59:55 +0000
commit47d8228368f46893e6fd4a5c4a772277969498dc (patch)
tree261af22feae81f321d25209cfd1f5fee39de2c9d /usr.sbin/pkg_install/add/perform.c
parentb131044669f8db678d14d3698f84c51244589250 (diff)
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.
Notes
Notes: svn path=/head/; revision=38583
Diffstat (limited to 'usr.sbin/pkg_install/add/perform.c')
-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 dc7c430982c6..2d80f85c4e8c 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