tag 600094 patch thanks the first patch is for the code against 1.15.8.5. i've successfully tested it (will upload builds for i386 and amd64 to people.d.o/~daniel/ soon). please let me know if you like me to change anything (e.g. there are some inconsistency, sometimes stuff is alphabetically sorted, sometimes it's not - i did always append at the end).
the second patch is for the documentation, however, i could not figure out how you update the po files and stuff (unrelated to lzip support, would you accept patches to use po4a for that?). please let me know how i can do that, so i can send an updated patch for the docs. also, let me know if you'd like me to rebase from a branch of your repository instead. Regards, Daniel -- Address: Daniel Baumann, Burgunderstrasse 3, CH-4562 Biberist Email: [email protected] Internet: http://people.panthera-systems.net/~daniel-baumann/
commit de89fb126d6df2d79e0d0a15b4d94e5534231ae6 Author: Daniel Baumann <[email protected]> Date: Wed Oct 13 19:05:22 2010 +0200 Adding support for lzip compression (Closes: #600094). diff --git a/Makefile.in b/Makefile.in index 89dd623..f624b5c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -658,6 +658,10 @@ dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -9 -c >$(distdir).tar.lz + $(am__remove_distdir) + dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) @@ -688,6 +692,8 @@ distcheck: dist lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ @@ -859,7 +865,7 @@ uninstall-am: uninstall-dist_pkgdataDATA .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-local ctags ctags-recursive dist dist-all dist-bzip2 \ - dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-xz \ + dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-xz dist-lzip \ dist-zip distcheck distclean distclean-generic distclean-hdr \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ diff --git a/dpkg-deb/main.c b/dpkg-deb/main.c index 319e715..652a0ae 100644 --- a/dpkg-deb/main.c +++ b/dpkg-deb/main.c @@ -103,7 +103,7 @@ usage(const struct cmdinfo *cip, const char *value) " packages).\n" " -z# Set the compression level when building.\n" " -Z<type> Set the compression type used when building.\n" -" Allowed types: gzip, xz, bzip2, lzma, none.\n" +" Allowed types: gzip, xz, bzip2, lzma, lzip, none.\n" "\n")); printf(_( diff --git a/lib/dpkg/compress.c b/lib/dpkg/compress.c index 343559f..ac17e53 100644 --- a/lib/dpkg/compress.c +++ b/lib/dpkg/compress.c @@ -376,6 +376,33 @@ struct compressor compressor_lzma = { }; /* + * Lzip compressor. + */ + +static void DPKG_ATTR_NORET +decompress_lzip(int fd_in, int fd_out, const char *desc) +{ + fd_fd_filter(fd_in, fd_out, desc, LZIP, "-dc", NULL); +} + +static void DPKG_ATTR_NORET +compress_lzip(int fd_in, int fd_out, int compress_level, const char *desc) +{ + char combuf[6]; + + snprintf(combuf, sizeof(combuf), "-c%d", compress_level); + fd_fd_filter(fd_in, fd_out, desc, LZIP, combuf, NULL); +} + +struct compressor compressor_lzip = { + .name = "lzip", + .extension = ".lz", + .default_level = 6, + .compress = compress_lzip, + .decompress = decompress_lzip, +}; + +/* * Generic compressor filter. */ @@ -385,6 +412,7 @@ static struct compressor *compressor_array[] = { &compressor_xz, &compressor_bzip2, &compressor_lzma, + &compressor_lzip, }; struct compressor * diff --git a/lib/dpkg/compress.h b/lib/dpkg/compress.h index e1a266f..f6ba8fa 100644 --- a/lib/dpkg/compress.h +++ b/lib/dpkg/compress.h @@ -29,6 +29,7 @@ DPKG_BEGIN_DECLS #define GZIP "gzip" #define XZ "xz" #define BZIP2 "bzip2" +#define LZIP "lzip" struct compressor { const char *name; @@ -45,6 +46,7 @@ struct compressor compressor_gzip; struct compressor compressor_xz; struct compressor compressor_bzip2; struct compressor compressor_lzma; +struct compressor compressor_lzip; struct compressor *compressor_find_by_name(const char *name); struct compressor *compressor_find_by_extension(const char *name); diff --git a/lib/dpkg/libdpkg.Versions b/lib/dpkg/libdpkg.Versions index fc34370..7be2936 100644 --- a/lib/dpkg/libdpkg.Versions +++ b/lib/dpkg/libdpkg.Versions @@ -104,6 +104,7 @@ LIBDPKG_PRIVATE { compressor_xz; # XXX variable, do not export compressor_bzip2; # XXX variable, do not export compressor_lzma; # XXX variable, do not export + compressor_lzip; # XXX variable, do not export compressor_find_by_name; compressor_find_by_extension; compress_filter; diff --git a/scripts/Dpkg/Compression.pm b/scripts/Dpkg/Compression.pm index 8b2c5c8..fa8e047 100644 --- a/scripts/Dpkg/Compression.pm +++ b/scripts/Dpkg/Compression.pm @@ -70,6 +70,11 @@ my $COMP = { "comp_prog" => [ "xz" ], "decomp_prog" => [ "unxz" ], }, + "lzip" => { + "file_ext" => "lz", + "comp_prog" => [ "lzip" ], + "decomp_prog" => [ "lzip", "--decompress" ], + }, }; our $default_compression = "gzip";
commit 39cb8cdbf9f8ca46f6facc33b14a341dcf62d453 Author: Daniel Baumann <[email protected]> Date: Wed Oct 13 20:27:50 2010 +0200 Adding lzip in documentation as supported compression. diff --git a/man/deb.5 b/man/deb.5 index a6f79aa..b4038b4 100644 --- a/man/deb.5 +++ b/man/deb.5 @@ -57,8 +57,9 @@ It contains the filesystem as a tar archive, either not compressed (supported since dpkg 1.10.24), or compressed with gzip (with \fB.gz\fP extension), xz (with \fB.xz\fP extension, supported since dpkg 1.15.6), -bzip2 (with \fB.bz2\fP extension, supported since dpkg 1.10.24) or -lzma (with \fB.lzma\fP extension, supported since dpkg 1.13.25). +bzip2 (with \fB.bz2\fP extension, supported since dpkg 1.10.24), +lzma (with \fB.lzma\fP extension, supported since dpkg 1.13.25) or +lzip (with \fB.lz\fP extension, support since dpkg 1.15.8.FIXME). .PP These members must occur in this exact order. Current implementations should ignore any additional members after diff --git a/man/dpkg-deb.1 b/man/dpkg-deb.1 index ec451ef..098821f 100644 --- a/man/dpkg-deb.1 +++ b/man/dpkg-deb.1 @@ -191,8 +191,8 @@ when building a package. .TP .BI \-Z compress_type Specify which compression type to use when building a package. Allowed -values are \fIgzip\fP, \fIxz\fP, \fIbzip2\fP, \fIlzma\fP, and \fInone\fP -(default is \fIgzip\fP). +values are \fIgzip\fP, \fIxz\fP, \fIbzip2\fP, \fIlzma\fP, \fIlzip\fP and +\fInone\fP (default is \fIgzip\fP). .TP .BR \-\-new Ensures that diff --git a/man/dpkg-source.1 b/man/dpkg-source.1 index 69b84fe..aacaaeb 100644 --- a/man/dpkg-source.1 +++ b/man/dpkg-source.1 @@ -139,7 +139,7 @@ Remove an output control file field. Specify the compression to use for created files (tarballs and diffs). Note that this option will not cause existing tarballs to be recompressed, it only affects new files. Supported values are: -.IR gzip ", " bzip2 ", " lzma " and " xz . +.IR gzip ", " bzip2 ", " lzma ", " xz " and " lzip . \fIgzip\fP is the default. \fIxz\fP is only supported since dpkg-dev 1.15.5. .TP @@ -396,7 +396,7 @@ as well as many temporary files (see default value associated to .SS Format: 3.0 (quilt) A source package in this format contains at least an original tarball (\fB.orig.tar.\fP\fIext\fP where \fIext\fP can be -\fBgz\fP, \fBbz2\fP, \fBlzma\fP and \fBxz\fP) and a debian tarball +\fBgz\fP, \fBbz2\fP, \fBlzma\fP, \fBxz\fP and \fBlzip\fP) and a debian tarball (\fB.debian.tar.\fP\fIext\fP). It can also contain additional original tarballs (\fB.orig-\fP\fIcomponent\fP\fB.tar.\fP\fIext\fP). \fIcomponent\fP can only contain alphanumeric characters and dashes ("-"). diff --git a/po/dpkg.pot b/po/dpkg.pot index 88ecac5..61ef6b0 100644 --- a/po/dpkg.pot +++ b/po/dpkg.pot @@ -4275,7 +4275,7 @@ msgid "" " -Z<type> Set the compression type used when " "building.\n" " Allowed types: gzip, xz, bzip2, lzma, " -"none.\n" +"lzip, none.\n" "\n" msgstr ""

