diff options
author | jkh <jkh@FreeBSD.org> | 1995-08-06 03:21:04 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1995-08-06 03:21:04 +0000 |
commit | 0fd326e2ae1552f56440a844cabe8978c3951b07 (patch) | |
tree | 2ec83b7c55b0012c9afbffdf0569ee8d19c1f28d /usr.sbin/pkg_install | |
parent | 2d0706815533250a730da43ea681a21e1599400b (diff) | |
download | FreeBSD-src-0fd326e2ae1552f56440a844cabe8978c3951b07.zip FreeBSD-src-0fd326e2ae1552f56440a844cabe8978c3951b07.tar.gz |
Make "out of space in ${PKG_TMPDIR}" handling a bit more robust.
Print the right thing, do the right thing. Back to you, Satoshi!
Diffstat (limited to 'usr.sbin/pkg_install')
-rw-r--r-- | usr.sbin/pkg_install/add/perform.c | 10 | ||||
-rw-r--r-- | usr.sbin/pkg_install/lib/pen.c | 5 |
2 files changed, 8 insertions, 7 deletions
diff --git a/usr.sbin/pkg_install/add/perform.c b/usr.sbin/pkg_install/add/perform.c index 16ea5a5..b3c31cc 100644 --- a/usr.sbin/pkg_install/add/perform.c +++ b/usr.sbin/pkg_install/add/perform.c @@ -1,5 +1,5 @@ #ifndef lint -static const char *rcsid = "$Id: perform.c,v 1.26 1995/06/11 19:32:48 rgrimes Exp $"; +static const char *rcsid = "$Id: perform.c,v 1.27 1995/07/30 09:11:20 jkh Exp $"; #endif /* @@ -118,6 +118,7 @@ pkg_do(char *pkg) } } Home = make_playpen(PlayPen, 0); + where_to = PlayPen; sprintf(extract_contents, "--fast-read %s", CONTENTS_FNAME); if (unpack(pkg_fullname, extract_contents)) { whinge("Unable to extract table of contents file from `%s' - not a package?.", pkg_fullname); @@ -165,8 +166,6 @@ pkg_do(char *pkg) } } - if (!where_to) - where_to = PlayPen; /* * Apply a crude heuristic to see how much space the package will * take up once it's unpacked. I've noticed that most packages @@ -178,9 +177,8 @@ pkg_do(char *pkg) } if (min_free(where_to) < sb.st_size * 4) { - whinge("Projected size of %d exceeds free space in %s.", - sb.st_size * 4, where_to); - whinge("Not extracting %s, sorry!", pkg_fullname); + whinge("Projected size of %d exceeds available free space.\nPlease set your PKG_TMPDIR variable to point to a location with more\nfree space and try again.", sb.st_size * 4); + whinge("Not extracting %s\ninto %s, sorry!", pkg_fullname, where_to); goto bomb; } diff --git a/usr.sbin/pkg_install/lib/pen.c b/usr.sbin/pkg_install/lib/pen.c index 37f36ce..2786721 100644 --- a/usr.sbin/pkg_install/lib/pen.c +++ b/usr.sbin/pkg_install/lib/pen.c @@ -1,5 +1,5 @@ #ifndef lint -static const char *rcsid = "$Id: pen.c,v 1.12 1995/04/22 13:58:44 jkh Exp $"; +static const char *rcsid = "$Id: pen.c,v 1.13 1995/04/26 07:43:35 jkh Exp $"; #endif /* @@ -30,6 +30,7 @@ static const char *rcsid = "$Id: pen.c,v 1.12 1995/04/22 13:58:44 jkh Exp $"; /* For keeping track of where we are */ static char Cwd[FILENAME_MAX]; static char Pen[FILENAME_MAX]; +extern char *PlayPen; /* * Make a temporary directory to play in and chdir() to it, returning @@ -45,6 +46,7 @@ make_playpen(char *pen, size_t sz) sprintf(Pen, "%s/instmp.XXXXXX", cp); else strcpy(Pen, "/var/tmp/instmp.XXXXXX"); + PlayPen = Pen; } else strcpy(Pen, pen); @@ -63,6 +65,7 @@ make_playpen(char *pen, size_t sz) if (min_free(Pen) < sz) { rmdir(Pen); barf("Not enough free space to create `%s'.\nPlease set your PKG_TMPDIR environment variable to a location with more space and\ntry the command again.", Pen); + PlayPen = NULL; } if (chdir(Pen) == FAIL) barf("Can't chdir to '%s'.", Pen); |