mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
- Add support for xz compression to pkg_create, bzip2 remains the default
compression algorithm. - Bump PKG_INSTALL_VERSION to 20101012. Submitted by: mm MFC after: 1 month
This commit is contained in:
parent
19f5434963
commit
1784fdea2e
6 changed files with 36 additions and 8 deletions
|
|
@ -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}
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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 *);
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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 ";
|
||||
|
|
|
|||
|
|
@ -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 .
|
||||
|
|
|
|||
Loading…
Reference in a new issue