summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/pkg_install/create/perform.c26
-rw-r--r--usr.sbin/pkg_install/lib/file.c6
2 files changed, 24 insertions, 8 deletions
diff --git a/usr.sbin/pkg_install/create/perform.c b/usr.sbin/pkg_install/create/perform.c
index 6d13be5..d68cc00 100644
--- a/usr.sbin/pkg_install/create/perform.c
+++ b/usr.sbin/pkg_install/create/perform.c
@@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
- "$Id: perform.c,v 1.44 1998/09/08 10:42:24 jkh Exp $";
+ "$Id: perform.c,v 1.45 1998/09/11 07:26:57 jkh Exp $";
#endif
/*
@@ -45,6 +45,8 @@ pkg_perform(char **pkgs)
FILE *pkg_in, *fp;
Package plist;
int len;
+ char *suf;
+ int compress;
/* Preliminary setup */
sanity_check();
@@ -63,10 +65,24 @@ pkg_perform(char **pkgs)
}
plist.head = plist.tail = NULL;
- /* chop suffix off if already specified */
+ /* chop suffix off if already specified, remembering if we want to compress */
len = strlen(pkg);
- if (len > 4 && !strcmp(&pkg[len - 4], ".tgz"))
- pkg[len - 4] = '\0';
+ if (len > 4)
+ if (!strcmp(&pkg[len - 4], ".tgz")) {
+ compress = TRUE;
+ pkg[len - 4] = '\0';
+ }
+ else if (!strcmp(&pkg[len - 4], ".tar")) {
+ compress = FALSE;
+ pkg[len - 4] = '\0';
+ }
+ else
+ /* default is to compress packages */
+ compress = TRUE;
+ if (compress)
+ suf = "tgz";
+ else
+ suf = "tar";
/* Stick the dependencies, if any, at the top */
if (Pkgdeps) {
@@ -176,7 +192,7 @@ pkg_perform(char **pkgs)
}
/* And stick it into a tar ball */
- make_dist(home, pkg, "tgz", &plist);
+ make_dist(home, pkg, suf, &plist);
/* Cleanup */
free(Comment);
diff --git a/usr.sbin/pkg_install/lib/file.c b/usr.sbin/pkg_install/lib/file.c
index c12b35c..9aed73c 100644
--- a/usr.sbin/pkg_install/lib/file.c
+++ b/usr.sbin/pkg_install/lib/file.c
@@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
- "$Id: file.c,v 1.33 1998/10/09 00:01:16 jkh Exp $";
+ "$Id: file.c,v 1.34 1998/10/14 18:52:04 jkh Exp $";
#endif
/*
@@ -487,8 +487,8 @@ unpack(char *pkg, char *flist)
}
}
else
- strcpy(args, "z");
- strcat(args, "xpf");
+ strcpy(args, "-z");
+ strcat(args, " -xpf");
if (vsystem("tar %s %s %s", args, pkg, flist ? flist : "")) {
warnx("tar extract of %s failed!", pkg);
return 1;
OpenPOWER on IntegriCloud