[pacman-dev] [PATCH] libmakepkg: Add lzip ext support
lzip is a lossless data compressor designed to replace gzip and bzip2 as the standard general-purpose compressed format. - add .lz (lzip) support to libmakepkg/util/compress.sh:compress_as - add COMPRESSLZ to makepkg.conf.in - document COMPRESSLZ Signed-off-by: Chloe Kudryavtsev <toast@toastin.space> --- doc/makepkg.conf.5.asciidoc | 1 + etc/makepkg.conf.in | 1 + scripts/libmakepkg/util/compress.sh.in | 1 + 3 files changed, 3 insertions(+) diff --git a/doc/makepkg.conf.5.asciidoc b/doc/makepkg.conf.5.asciidoc index 7d7796b7..cbda9c53 100644 --- a/doc/makepkg.conf.5.asciidoc +++ b/doc/makepkg.conf.5.asciidoc @@ -254,6 +254,7 @@ Options **COMPRESSLRZ=**"(lrzip -q)":: **COMPRESSLZ4=**"(lz4 -q)":: **COMPRESSZ=**"(compress -c -f)":: +**COMPRESSLZ=**"(lzip -c -f)":: Sets the command and options used when compressing compiled or source packages in the named format. diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in index a4321541..4d5cf4ea 100644 --- a/etc/makepkg.conf.in +++ b/etc/makepkg.conf.in @@ -135,6 +135,7 @@ COMPRESSLRZ=(lrzip -q) COMPRESSLZO=(lzop -q) COMPRESSZ=(compress -c -f) COMPRESSLZ4=(lz4 -q) +COMPRESSLZ=(lzip -c -f) ######################################################################### # EXTENSION DEFAULTS diff --git a/scripts/libmakepkg/util/compress.sh.in b/scripts/libmakepkg/util/compress.sh.in index 3a43e8b5..3d4d88fd 100644 --- a/scripts/libmakepkg/util/compress.sh.in +++ b/scripts/libmakepkg/util/compress.sh.in @@ -42,6 +42,7 @@ compress_as() { *tar.lzo) ${COMPRESSLZO[@]:-lzop -q} ;; *tar.Z) ${COMPRESSZ[@]:-compress -c -f} ;; *tar.lz4) ${COMPRESSLZ4[@]:-lz4 -q} ;; + *tar.lz) ${COMPRESSLZ[@]:-lzip -c -f} ;; *tar) cat ;; *) warning "$(gettext "'%s' is not a valid archive extension.")" \ "$ext"; cat ;; -- 2.20.1
On 1/26/19 7:46 PM, Chloe Kudryavtsev wrote:
lzip is a lossless data compressor designed to replace gzip and bzip2 as the standard general-purpose compressed format. - add .lz (lzip) support to libmakepkg/util/compress.sh:compress_as - add COMPRESSLZ to makepkg.conf.in - document COMPRESSLZ Signed-off-by: Chloe Kudryavtsev <toast@toastin.space> Looks like libarchive does support lzip even though it isn't one of the compression options bsdtar can use on the command line. I suppose this makes sense as it is just another lzma implementation.
Any particular benefit of this method over the other ones we support, by the way? -- Eli Schwartz Bug Wrangler and Trusted User
On 1/26/19 8:25 PM, Eli Schwartz wrote:
Any particular benefit of this method over the other ones we support, by the way? lzip has two components, both of which are used: the file format, and the implementation.
Advantages offered by the file format: - integrity checking - easy automated recovery of bit flip errors (most common data corruption type) - data recovery capabilities - very simple (just using the lzip manual, it should be possible to extract data from it by hand, even once LZMA is obsolete) - the format itself is copylefted Advantages offered by the implementation: - versatile (-0 is similar in speed to gzip, -9 compresses more than bzip2 on average) - standardized options and return values (like bzip2, unlike gzip) - dynamic dictionary size The goal of the project was to make a new standard general-use archiver to replace gzip and bzip2 (the author has severe issues with xz[1]). As far as I'm aware, the format and the specification are technically excellent, and I agree that it should likely become the default. Thus, my personal reason for putting it in is as a first step - it can't ever become the default if no one uses it, and nothing supports it (or support is purely silent). [1]: https://www.nongnu.org/lzip/xz_inadequate.html
On 27/1/19 10:46 am, Chloe Kudryavtsev wrote:
lzip is a lossless data compressor designed to replace gzip and bzip2 as the standard general-purpose compressed format. - add .lz (lzip) support to libmakepkg/util/compress.sh:compress_as - add COMPRESSLZ to makepkg.conf.in - document COMPRESSLZ Signed-off-by: Chloe Kudryavtsev <toast@toastin.space> --- doc/makepkg.conf.5.asciidoc | 1 + etc/makepkg.conf.in | 1 + scripts/libmakepkg/util/compress.sh.in | 1 + 3 files changed, 3 insertions(+)
Thanks, You are missing the documentation for PKGEXT to add the ".tar.lz". Otherwise the patch is fine. Submit a revision and I will apply it. As an aside, I see no advantage of this format over xz for packaging. Corruption detection is done with signatures/checksums, with essentially zero need to recover from it. Also, for all packages I tested, lz was slower on both compression and extraction of packages, and resulted in larger packages (it compresses text well, but not binaries). Allan
lzip is a lossless data compressor designed to replace gzip and bzip2 as the standard general-purpose compressed format. - add .lz (lzip) support to libmakepkg/util/compress.sh:compress_as - add COMPRESSLZ to makepkg.conf.in - document COMPRESSLZ - document PKGEXT with `.tar.lz` Signed-off-by: Chloe Kudryavtsev <toast@toastin.space> --- doc/makepkg.conf.5.asciidoc | 3 ++- etc/makepkg.conf.in | 1 + scripts/libmakepkg/util/compress.sh.in | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/makepkg.conf.5.asciidoc b/doc/makepkg.conf.5.asciidoc index 7d7796b7..6334db05 100644 --- a/doc/makepkg.conf.5.asciidoc +++ b/doc/makepkg.conf.5.asciidoc @@ -254,13 +254,14 @@ Options **COMPRESSLRZ=**"(lrzip -q)":: **COMPRESSLZ4=**"(lz4 -q)":: **COMPRESSZ=**"(compress -c -f)":: +**COMPRESSLZ=**"(lzip -c -f)":: Sets the command and options used when compressing compiled or source packages in the named format. **PKGEXT=**".pkg.tar.gz", **SRCEXT=**".src.tar.gz":: Sets the compression used when making compiled or source packages. Valid suffixes are `.tar`, `.tar.gz`, `.tar.bz2`, `.tar.xz`, `.tar.zst`, - `.tar.lzo`, `.tar.lrz`, `.tar.lz4`, and `.tar.Z`. + `.tar.lzo`, `.tar.lrz`, `.tar.lz4`, `.tar.lz` and `.tar.Z`. Do not touch these unless you know what you are doing. diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in index a4321541..4d5cf4ea 100644 --- a/etc/makepkg.conf.in +++ b/etc/makepkg.conf.in @@ -135,6 +135,7 @@ COMPRESSLRZ=(lrzip -q) COMPRESSLZO=(lzop -q) COMPRESSZ=(compress -c -f) COMPRESSLZ4=(lz4 -q) +COMPRESSLZ=(lzip -c -f) ######################################################################### # EXTENSION DEFAULTS diff --git a/scripts/libmakepkg/util/compress.sh.in b/scripts/libmakepkg/util/compress.sh.in index 3a43e8b5..3d4d88fd 100644 --- a/scripts/libmakepkg/util/compress.sh.in +++ b/scripts/libmakepkg/util/compress.sh.in @@ -42,6 +42,7 @@ compress_as() { *tar.lzo) ${COMPRESSLZO[@]:-lzop -q} ;; *tar.Z) ${COMPRESSZ[@]:-compress -c -f} ;; *tar.lz4) ${COMPRESSLZ4[@]:-lz4 -q} ;; + *tar.lz) ${COMPRESSLZ[@]:-lzip -c -f} ;; *tar) cat ;; *) warning "$(gettext "'%s' is not a valid archive extension.")" \ "$ext"; cat ;; -- 2.20.1
participants (3)
-
Allan McRae
-
Chloe Kudryavtsev
-
Eli Schwartz