summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarco S Hyman <marc@cvs.openbsd.org>1998-04-07 05:56:14 +0000
committerMarco S Hyman <marc@cvs.openbsd.org>1998-04-07 05:56:14 +0000
commit05bd8d847ee82145ad59949be5006703ea73308f (patch)
tree56734d18563ea428842ac9d339548a6ebaa9cf06 /usr.sbin
parent5dc8e02860c14beead527810de11b0821a2c2e80 (diff)
fix package input from standard input -- the program tried to process
stdin twice. Note: it assumes stdin is a compressed tar file.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_install/add/perform.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/usr.sbin/pkg_install/add/perform.c b/usr.sbin/pkg_install/add/perform.c
index d17c605cc77..166749a82d8 100644
--- a/usr.sbin/pkg_install/add/perform.c
+++ b/usr.sbin/pkg_install/add/perform.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: perform.c,v 1.3 1996/06/25 04:51:53 dm Exp $ */
+/* $OpenBSD: perform.c,v 1.4 1998/04/07 05:56:13 marc Exp $ */
#ifndef lint
-static const char *rcsid = "$OpenBSD: perform.c,v 1.3 1996/06/25 04:51:53 dm Exp $";
+static const char *rcsid = "$OpenBSD: perform.c,v 1.4 1998/04/07 05:56:13 marc Exp $";
#endif
/*
@@ -168,14 +168,18 @@ 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 75%, so multiply by 4 for good measure.
+ * compress an average of 75%, so multiply by 4 for good
+ * measure. Ignore if extract is null as we've already
+ * extracted the full file, anyway.
*/
- if (!inPlace && min_free(playpen) < sb.st_size * 4) {
+ if (!extract && !inPlace && min_free(playpen) < sb.st_size * 4) {
whinge("Projected size of %d exceeds available free space.\n"
- "Please set your PKG_TMPDIR variable to point to a location with more\n"
+ "Please set your PKG_TMPDIR variable to point to a"
+ "location with more\n"
"free space and try again.", sb.st_size * 4);
- whinge("Not extracting %s\ninto %s, sorry!", pkg_fullname, where_to);
+ whinge("Not extracting %s\ninto %s, sorry!", pkg_fullname,
+ where_to);
goto bomb;
}
@@ -183,8 +187,9 @@ pkg_do(char *pkg)
if (inPlace && Fake)
goto success;
- /* Finally unpack the whole mess */
- if (unpack(pkg_fullname, NULL)) {
+ /* Finally unpack the whole mess. If extract is null we already
+ did so so don't bother doing it again. */
+ if (extract && unpack(pkg_fullname, NULL)) {
whinge("Unable to extract `%s'!", pkg_fullname);
goto bomb;
}