From b68b3fb56c7fdde8b76c41f62aecd4ce78ef8db2 Mon Sep 17 00:00:00 2001 From: jkh Date: Thu, 27 Aug 1998 14:59:55 +0000 Subject: 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. --- usr.sbin/pkg_install/add/perform.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'usr.sbin') 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 -- cgit v1.1