diff options
author | jkh <jkh@FreeBSD.org> | 1994-10-14 05:55:57 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1994-10-14 05:55:57 +0000 |
commit | 2cf39cacf3964567c31c669206b8564ea3fe7cfb (patch) | |
tree | 175a3b13e3dddcce078aea2e8e863ca4d9b32a68 /usr.sbin/pkg_install | |
parent | d5a24500875e9be50c5bbfd35c54f42463c81576 (diff) | |
download | FreeBSD-src-2cf39cacf3964567c31c669206b8564ea3fe7cfb.zip FreeBSD-src-2cf39cacf3964567c31c669206b8564ea3fe7cfb.tar.gz |
This should do it - I forgot about pkg_info.
Diffstat (limited to 'usr.sbin/pkg_install')
-rw-r--r-- | usr.sbin/pkg_install/create/perform.c | 4 | ||||
-rw-r--r-- | usr.sbin/pkg_install/info/perform.c | 13 |
2 files changed, 10 insertions, 7 deletions
diff --git a/usr.sbin/pkg_install/create/perform.c b/usr.sbin/pkg_install/create/perform.c index 27d437d..a0e1406 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 9fac45d..498088d 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; |