diff options
-rw-r--r-- | usr.sbin/pkg_install/Makefile.inc | 2 | ||||
-rw-r--r-- | usr.sbin/pkg_install/add/main.c | 6 | ||||
-rw-r--r-- | usr.sbin/pkg_install/create/create.h | 2 | ||||
-rw-r--r-- | usr.sbin/pkg_install/create/main.c | 6 | ||||
-rw-r--r-- | usr.sbin/pkg_install/create/perform.c | 10 | ||||
-rw-r--r-- | usr.sbin/pkg_install/create/pkg_create.1 | 18 |
6 files changed, 36 insertions, 8 deletions
diff --git a/usr.sbin/pkg_install/Makefile.inc b/usr.sbin/pkg_install/Makefile.inc index 5c9e2661a586..d929f2457009 100644 --- a/usr.sbin/pkg_install/Makefile.inc +++ b/usr.sbin/pkg_install/Makefile.inc @@ -2,7 +2,7 @@ .include <bsd.own.mk> -CFLAGS+= -DPKG_INSTALL_VERSION=20100423 +CFLAGS+= -DPKG_INSTALL_VERSION=20101012 CFLAGS+= -DYES_I_KNOW_THE_API_IS_RUBBISH_AND_IS_DOOMED_TO_CHANGE DPADD+= ${LIBPKG} diff --git a/usr.sbin/pkg_install/add/main.c b/usr.sbin/pkg_install/add/main.c index c8339db0b144..759a479621c5 100644 --- a/usr.sbin/pkg_install/add/main.c +++ b/usr.sbin/pkg_install/add/main.c @@ -227,9 +227,9 @@ main(int argc, char **argv) >= sizeof(temppackageroot)) errx(1, "package name too long"); remotepkg = temppackageroot; - if (!((ptr = strrchr(remotepkg, '.')) && ptr[1] == 't' && - (ptr[2] == 'b' || ptr[2] == 'g') && ptr[3] == 'z' && - !ptr[4])) + if (!((ptr = strrchr(remotepkg, '.')) && ptr[1] == 't' && + (ptr[2] == 'b' || ptr[2] == 'g' || ptr[2] == 'x') && + ptr[3] == 'z' && !ptr[4])) if (strlcat(remotepkg, ".tbz", sizeof(temppackageroot)) >= sizeof(temppackageroot)) errx(1, "package name too long"); diff --git a/usr.sbin/pkg_install/create/create.h b/usr.sbin/pkg_install/create/create.h index 310aba0114c5..cbade822c989 100644 --- a/usr.sbin/pkg_install/create/create.h +++ b/usr.sbin/pkg_install/create/create.h @@ -48,7 +48,7 @@ extern int PlistOnly; extern int Recursive; extern int Regenerate; -enum zipper {NONE, GZIP, BZIP, BZIP2 }; +enum zipper {NONE, GZIP, BZIP, BZIP2, XZ }; extern enum zipper Zipper; void add_cksum(Package *, PackingList, const char *); diff --git a/usr.sbin/pkg_install/create/main.c b/usr.sbin/pkg_install/create/main.c index e463d1f295bb..5e999dae3350 100644 --- a/usr.sbin/pkg_install/create/main.c +++ b/usr.sbin/pkg_install/create/main.c @@ -48,7 +48,7 @@ enum zipper Zipper = BZIP2; static void usage(void); -static char opts[] = "EGYNnORhjvxyzf:p:P:C:c:d:i:I:k:K:r:t:X:D:m:s:S:o:b:"; +static char opts[] = "EGYNnORhjJvxyzf:p:P:C:c:d:i:I:k:K:r:t:X:D:m:s:S:o:b:"; static struct option longopts[] = { { "backup", required_argument, NULL, 'b' }, { "extended", no_argument, NULL, 'E' }, @@ -190,6 +190,10 @@ main(int argc, char **argv) Zipper = GZIP; break; + case 'J': + Zipper = XZ; + break; + case 'b': InstalledPkg = optarg; while ((tmp = strrchr(optarg, (int)'/')) != NULL) { diff --git a/usr.sbin/pkg_install/create/perform.c b/usr.sbin/pkg_install/create/perform.c index 0e14095c815e..149bcbd08513 100644 --- a/usr.sbin/pkg_install/create/perform.c +++ b/usr.sbin/pkg_install/create/perform.c @@ -67,6 +67,10 @@ pkg_perform(char **pkgs) Zipper = GZIP; pkg[len - 4] = '\0'; } + else if (!strcmp(&pkg[len - 4], ".txz")) { + Zipper = XZ; + pkg[len - 4] = '\0'; + } else if (!strcmp(&pkg[len - 4], ".tar")) { Zipper = NONE; pkg[len - 4] = '\0'; @@ -78,6 +82,8 @@ pkg_perform(char **pkgs) } else if (Zipper == GZIP) { suf = "tgz"; setenv("GZIP", "-9", 0); + } else if (Zipper == XZ) { + suf = "txz"; } else suf = "tar"; @@ -375,6 +381,10 @@ make_dist(const char *homedir, const char *pkg, const char *suff, Package *plist args[nargs++] = "-j"; cname = "bzip'd "; } + else if (Zipper == XZ) { + args[nargs++] = "-J"; + cname = "xz'd "; + } else { args[nargs++] = "-z"; cname = "gzip'd "; diff --git a/usr.sbin/pkg_install/create/pkg_create.1 b/usr.sbin/pkg_install/create/pkg_create.1 index a567fc45d06b..5b463743560a 100644 --- a/usr.sbin/pkg_install/create/pkg_create.1 +++ b/usr.sbin/pkg_install/create/pkg_create.1 @@ -23,7 +23,7 @@ .\" [jkh] Took John's changes back and made some additional extensions for .\" better integration with FreeBSD's new ports collection. .\" -.Dd May 30, 2008 +.Dd Oct 12, 2010 .Dt PKG_CREATE 1 .Os .Sh NAME @@ -315,7 +315,7 @@ archive is explicitly specified by the recognizable suffix of Currently .Nm recognizes the following suffixes: -.Pa .tbz , .tgz +.Pa .tbz , .tgz, .txz and .Pa .tar . .It Fl y @@ -325,6 +325,20 @@ Compatibility synonym for Use .Xr gzip 1 utility to compress package tarball. +.It Fl J +Use +.Xr xz 1 +utility to compress package tarball instead of +.Xr gzip 1 . +Please note that this option is a NO-OP if the format of the resulting +archive is explicitly specified by the recognizable suffix of +.Ar pkg-filename . +Currently +.Nm +recognizes the following suffixes: +.Pa .tbz , .tgz, .txz +and +.Pa .tar . .It Fl b , -backup Ar pkg-name Create package file from a locally installed package named .Ar pkg-name . |