diff mbox

[pacman-dev] makepkg: add lz4 compression support

Message ID 20170912090926.8492-1-alexheretic@gmail.com
State Changes Requested, archived
Headers show

Commit Message

Alex Butler Sept. 12, 2017, 9:09 a.m. UTC
Adds opt-in lz4 compression of *pkg.tar files with makepkg.
This is nice to have as an option for very fast compression.

Signed-off-by: Alex Butler <alexheretic@gmail.com>
---
 etc/makepkg.conf.in   | 1 +
 scripts/makepkg.sh.in | 1 +
 2 files changed, 2 insertions(+)

Comments

Allan McRae Sept. 14, 2017, 2:53 a.m. UTC | #1
On 12/09/17 19:09, Alex Butler wrote:
> Adds opt-in lz4 compression of *pkg.tar files with makepkg.
> This is nice to have as an option for very fast compression.
> 
> Signed-off-by: Alex Butler <alexheretic@gmail.com>
> ---

I think there are already options for very fast compression...  but fine.

This would need additions to the makepkg.conf man page, and the example
makepkg.conf.

It would also need to be added to source package compressing, but hold
off on resubmitting the patch until after I deal with the patches
unifying the compression.

Allan

>  etc/makepkg.conf.in   | 1 +
>  scripts/makepkg.sh.in | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in
> index 71293970..827aa4fc 100644
> --- a/etc/makepkg.conf.in
> +++ b/etc/makepkg.conf.in
> @@ -129,6 +129,7 @@ COMPRESSXZ=(xz -c -z -)
>  COMPRESSLRZ=(lrzip -q)
>  COMPRESSLZO=(lzop -q)
>  COMPRESSZ=(compress -c -f)
> +COMPRESSLZ4=(lz4 -q)
>  
>  #########################################################################
>  # EXTENSION DEFAULTS
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index 20e9dd7e..feefe027 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -759,6 +759,7 @@ create_package() {
>  		*tar.lrz) ${COMPRESSLRZ[@]:-lrzip -q} ;;
>  		*tar.lzo) ${COMPRESSLZO[@]:-lzop -q} ;;
>  		*tar.Z)   ${COMPRESSZ[@]:-compress -c -f} ;;
> +		*tar.lz4) ${COMPRESSLZ4[@]:-lz4 -q} ;;
>  		*tar)     cat ;;
>  		*) warning "$(gettext "'%s' is not a valid archive extension.")" \
>  			"$PKGEXT"; cat ;;
>
diff mbox

Patch

diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in
index 71293970..827aa4fc 100644
--- a/etc/makepkg.conf.in
+++ b/etc/makepkg.conf.in
@@ -129,6 +129,7 @@  COMPRESSXZ=(xz -c -z -)
 COMPRESSLRZ=(lrzip -q)
 COMPRESSLZO=(lzop -q)
 COMPRESSZ=(compress -c -f)
+COMPRESSLZ4=(lz4 -q)
 
 #########################################################################
 # EXTENSION DEFAULTS
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 20e9dd7e..feefe027 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -759,6 +759,7 @@  create_package() {
 		*tar.lrz) ${COMPRESSLRZ[@]:-lrzip -q} ;;
 		*tar.lzo) ${COMPRESSLZO[@]:-lzop -q} ;;
 		*tar.Z)   ${COMPRESSZ[@]:-compress -c -f} ;;
+		*tar.lz4) ${COMPRESSLZ4[@]:-lz4 -q} ;;
 		*tar)     cat ;;
 		*) warning "$(gettext "'%s' is not a valid archive extension.")" \
 			"$PKGEXT"; cat ;;