[pacman-dev,2/3] makepkg: add support for the zst format

Message ID 20170829050117.10097-2-eschwartz@archlinux.org
State Superseded, archived
Headers show
Series [pacman-dev,1/3] makepkg: refactor archive compression for reusability | expand

Commit Message

Eli Schwartz Aug. 29, 2017, 5:01 a.m. UTC
Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
---

This shouldn't be added until we are sure pacman actually knows how to
read .zst files, which requires libarchive support that is currently
only in git master.

I have no idea when either libarchive or pacman plan to make a new
release. Though at least this isn't the default, and would require
explicit opt-in...

 doc/makepkg.conf.5.txt | 3 ++-
 etc/makepkg.conf.in    | 1 +
 scripts/makepkg.sh.in  | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

--
2.14.1

Comments

Allan McRae Sept. 14, 2017, 6:13 a.m. UTC | #1
On 29/08/17 15:01, Eli Schwartz wrote:
> Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
> ---
> 
> This shouldn't be added until we are sure pacman actually knows how to
> read .zst files, which requires libarchive support that is currently
> only in git master.
> 
> I have no idea when either libarchive or pacman plan to make a new
> release. Though at least this isn't the default, and would require
> explicit opt-in...
> 

Hrm...  if this was C code, we could easily configure test this and
#ifdef it.  Not sure how we should handle this in bash code.
Suggestions welcome.

This may also apply to some other formats we support, although I think
we have a fairly stringent libarchive version requirement anyway.

A

Patch

diff --git a/doc/makepkg.conf.5.txt b/doc/makepkg.conf.5.txt
index 5bd3472f..d01c13b6 100644
--- a/doc/makepkg.conf.5.txt
+++ b/doc/makepkg.conf.5.txt
@@ -246,6 +246,7 @@  Options
 **COMPRESSGZ=**"(gzip -c -f -n)"::
 **COMPRESSBZ2=**"(bzip2 -c -f)"::
 **COMPRESSXZ=**"(xz -c -z -)"::
+**COMPRESSZST=**"(zstd -c -z -)"::
 **COMPRESSLZO**"(lzop -q)"::
 **COMPRESSLRZ=**"(lrzip -q)"::
 **COMPRESSZ=**"(compress -c -f)"::
@@ -254,7 +255,7 @@  Options

 **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`,
+	Valid suffixes are `.tar`, `.tar.gz`, `.tar.bz2`, `.tar.xz`, `.tar.zst`,
 	`.tar.lzo`, `.tar.lrz`, 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 71293970..4787855c 100644
--- a/etc/makepkg.conf.in
+++ b/etc/makepkg.conf.in
@@ -126,6 +126,7 @@  PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)
 COMPRESSGZ=(gzip -c -f -n)
 COMPRESSBZ2=(bzip2 -c -f)
 COMPRESSXZ=(xz -c -z -)
+COMPRESSXZ=(zstd -c -z -q -)
 COMPRESSLRZ=(lrzip -q)
 COMPRESSLZO=(lzop -q)
 COMPRESSZ=(compress -c -f)
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index a5c216dd..d9b5ea2d 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -709,6 +709,7 @@  compress_as() {
 		*tar.gz)  ${COMPRESSGZ[@]:-gzip -c -f -n} ;;
 		*tar.bz2) ${COMPRESSBZ2[@]:-bzip2 -c -f} ;;
 		*tar.xz)  ${COMPRESSXZ[@]:-xz -c -z -} ;;
+		*tar.zst) ${COMPRESSZST[@]:-zstd -c -z -q -} ;;
 		*tar.lrz) ${COMPRESSLRZ[@]:-lrzip -q} ;;
 		*tar.lzo) ${COMPRESSLZO[@]:-lzop -q} ;;
 		*tar.Z)   ${COMPRESSZ[@]:-compress -c -f} ;;