diff --git a/usr.sbin/pkg_install/create/perform.c b/usr.sbin/pkg_install/create/perform.c index 27d437da91b8..a0e14064b7ea 100644 --- a/usr.sbin/pkg_install/create/perform.c +++ b/usr.sbin/pkg_install/create/perform.c @@ -1,5 +1,5 @@ #ifndef lint -static const char *rcsid = "$Id: perform.c,v 1.10 1994/08/29 16:31:37 adam Exp $"; +static const char *rcsid = "$Id: perform.c,v 1.11 1994/10/04 15:54:39 jkh Exp $"; #endif /* @@ -78,7 +78,7 @@ pkg_perform(char **pkgs) add_plist_top(&plist, PLIST_NAME, pkg); /* Make a directory to stomp around in */ - home = make_playpen(PlayPen, 1); + home = make_playpen(PlayPen, 0); signal(SIGINT, cleanup); signal(SIGHUP, cleanup); diff --git a/usr.sbin/pkg_install/info/perform.c b/usr.sbin/pkg_install/info/perform.c index 9fac45d0f591..498088d6ced9 100644 --- a/usr.sbin/pkg_install/info/perform.c +++ b/usr.sbin/pkg_install/info/perform.c @@ -1,5 +1,5 @@ #ifndef lint -static const char *rcsid = "$Id: perform.c,v 1.6 1993/09/08 01:46:57 jkh Exp $"; +static const char *rcsid = "$Id: perform.c,v 1.7 1994/10/04 16:07:46 jkh Exp $"; #endif /* @@ -72,7 +72,7 @@ pkg_do(char *pkg) { Boolean installed = FALSE; char log_dir[FILENAME_MAX]; - char *home; + char home[FILENAME_MAX]; Package plist; FILE *fp; @@ -80,6 +80,9 @@ pkg_do(char *pkg) char fname[FILENAME_MAX]; struct stat sb; + if (!getcwd(home, FILENAME_MAX)) + upchuck("getcwd"); + if (pkg[0] == '/') strcpy(fname, pkg); else @@ -87,14 +90,14 @@ pkg_do(char *pkg) /* * Apply a crude heuristic to see how much space the package will * take up once it's unpacked. I've noticed that most packages - * compress an average of 65%. + * compress an average of 75%, but we're only unpacking the + files so + * be very optimistic. */ if (stat(fname, &sb) == FAIL) { whinge("Can't stat package file '%s'.", fname); return 1; } - sb.st_size *= 1.65; - home = make_playpen(PlayPen, sb.st_size); + home = make_playpen(PlayPen, sb.st_size / 2); if (unpack(fname, "+*")) { whinge("Error during unpacking, no info for '%s' available.", pkg); return 1;