diff options
author | asami <asami@FreeBSD.org> | 1998-12-05 06:29:03 +0000 |
---|---|---|
committer | asami <asami@FreeBSD.org> | 1998-12-05 06:29:03 +0000 |
commit | 125d5b9a24a70f0e9b3befa7fb24b7e2f496d234 (patch) | |
tree | 88d9b82bc23600328f7fc7efdd85ed21cc3ada3e /usr.sbin/pkg_install/create/perform.c | |
parent | f6e1dfa6868a552b068c5454f8059fcd3f7d1b2f (diff) | |
download | FreeBSD-src-125d5b9a24a70f0e9b3befa7fb24b7e2f496d234.zip FreeBSD-src-125d5b9a24a70f0e9b3befa7fb24b7e2f496d234.tar.gz |
Fix support for uncompressed (".tar") package types. It's not completely
fixed (chained dependency checking for pkg_add is broken, for one thing)
but at least you can now create one package and use it.
Diffstat (limited to 'usr.sbin/pkg_install/create/perform.c')
-rw-r--r-- | usr.sbin/pkg_install/create/perform.c | 26 |
1 files changed, 21 insertions, 5 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); |