From d53793ad97053956118248b78d7331e3c04275ae Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 13 Mar 2007 01:07:47 +0000 Subject: [PATCH] Support building binary packages with the member data.tar.lzma compressed with lzma. --- ChangeLog | 7 +++++++ TODO | 4 ++-- debian/changelog | 2 ++ dpkg-deb/build.c | 3 +++ dpkg-deb/main.c | 4 +++- lib/compression.c | 4 ++++ man/ChangeLog | 5 +++++ man/dpkg-deb.1 | 17 ++++++++++------- 8 files changed, 36 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0dba6caf..2e1696c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-03-13 Guillem Jover + + * lib/compression.c (compress_cat): Support compress_type_lzma. + * dpkg-deb/build.c (do_build): Likewise. + * dpkg-deb/main.c (usage): Document that '-Z' now accepts lzma as well. + (setcompresstype): Parse 'lzma' as compress_type_lzma. + 2007-03-12 Guillem Jover * scripts/changelog/debian.pl: Fix call to outputclose by not passing diff --git a/TODO b/TODO index b6eaadc9..1179286a 100644 --- a/TODO +++ b/TODO @@ -26,13 +26,13 @@ lenny allowed or added. The main problem I'm facing with this one is and nice a clean implementation, the PoC and the idea how to fix it is present already. - * Support lzma compression. - 1.14.x ------ * Add Wig&Pen source package support. + * Support lzma and bzip2 source package compression. + * Get rid of install-info. * Add multiarch support. diff --git a/debian/changelog b/debian/changelog index 7227ccda..0c156f97 100644 --- a/debian/changelog +++ b/debian/changelog @@ -50,6 +50,8 @@ dpkg (1.14.0) UNRELEASED; urgency=low dpkg-buildpackage(1), dpkg-distaddfile(1), dpkg-genchanges(1), dpkg-gencontrol(1), dpkg-parsechangelog(1), dpkg-shlibdeps(1), deb-shlibs(5) and deb-substvars(5). + * Support building binary packages with the member data.tar.lzma compressed + with lzma. [ Updated dpkg translations ] * Romanian (Eddy Petrișor). diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c index 9f9af39a..31e66045 100644 --- a/dpkg-deb/build.c +++ b/dpkg-deb/build.c @@ -452,6 +452,9 @@ void do_build(const char *const *argv) { case compress_type_bzip2: datamember = DATAMEMBER_BZ2; break; + case compress_type_lzma: + datamember = DATAMEMBER_LZMA; + break; case compress_type_cat: datamember = DATAMEMBER_CAT; break; diff --git a/dpkg-deb/main.c b/dpkg-deb/main.c index 13ae7478..a8c7fea0 100644 --- a/dpkg-deb/main.c +++ b/dpkg-deb/main.c @@ -90,7 +90,7 @@ static void usage(void) { " packages).\n" " -z# Set the compression level when building.\n" " -Z Set the compression type used when building.\n" -" Allowed values: gzip, bzip2, none.\n" +" Allowed values: gzip, bzip2, lzma, none.\n" "\n")) < 0) werr("stdout"); if (printf(_( @@ -186,6 +186,8 @@ static void setcompresstype(const struct cmdinfo *cip, const char *value) { compress_type = compress_type_gzip; else if (!strcmp(value, "bzip2")) compress_type = compress_type_bzip2; + else if (!strcmp(value, "lzma")) + compress_type = compress_type_lzma; else if (!strcmp(value, "none")) compress_type = compress_type_cat; else diff --git a/lib/compression.c b/lib/compression.c index f761ca6a..07ab5dc3 100644 --- a/lib/compression.c +++ b/lib/compression.c @@ -187,6 +187,10 @@ void compress_cat(enum compress_type type, int fd_in, int fd_out, const char *co combuf[1]= *compression; fd_fd_filter(fd_in, fd_out, BZIP2, "bzip2", combuf, v.buf); #endif + case compress_type_lzma: + strncpy(combuf, "-9c", sizeof(combuf)); + combuf[1] = *compression; + fd_fd_filter(fd_in, fd_out, LZMA, "lzma", combuf, v.buf); case compress_type_cat: fd_fd_copy(fd_in, fd_out, -1, _("%s: compression"), v.buf); exit(0); diff --git a/man/ChangeLog b/man/ChangeLog index f1a6bf3b..95e0f05c 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,8 @@ +2007-03-13 Guillem Jover + + * dpkg-deb.1: Move '-z' to it's own OPTIONS entry. Document '-Z', + and the new 'lzma' value. + 2007-03-13 Guillem Jover * po/add_de/dpkg-scanpackages.1.de.add: Copy to ... diff --git a/man/dpkg-deb.1 b/man/dpkg-deb.1 index cc84444b..9fe68db3 100644 --- a/man/dpkg-deb.1 +++ b/man/dpkg-deb.1 @@ -1,4 +1,4 @@ -.TH dpkg\-deb 1 "2003-03-06" "Debian Project" "dpkg suite" +.TH dpkg\-deb 1 "2007-03-13" "Debian Project" "dpkg suite" .SH NAME dpkg\-deb - Debian package archive (.deb) manipulation tool . @@ -39,12 +39,6 @@ appear in the binary package's filesystem archive, but instead the files in it will be put in the binary package's control information area. -You can specify the compression level used by adding a -.B \-z# -option. -.B dpkg\-deb -will pass that option on to gzip. - Unless you specify .BR \-\-nocheck ", " dpkg\-deb " will read @@ -193,6 +187,15 @@ explanation of the \fB\-\-showformat\fP option in The default for this field is "${Package}\\t${Version}\\n". .TP +.BI \-z compress_level +Specify which compression level to pass to the compressor backend program, +when building a package. +.TP +.BI \-Z compress_type +Specify which compression type to use when building a package. Allowed +values are \fIgzip\fP, \fIbzip2\fP, \fIlzma\fP, and \fInone\fP (default +is \fIgzip\fP). +.TP .BR \-\-new Ensures that .B dpkg\-deb -- 2.39.5