aboutsummaryrefslogtreecommitdiff
path: root/contrib/kiss-export
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2020-04-15 10:16:46 +0000
committermerakor <cem@ckyln.com>2020-04-15 10:16:46 +0000
commit77348a295e0dada910c0d701d8f6a1c68e9bb5e4 (patch)
treeba090c2c76a3f2598abdfe917d91a422436f63ee /contrib/kiss-export
parent73845f2b0c40b86f570c2bea2186d9bfdd3daab0 (diff)
downloadcpt-77348a295e0dada910c0d701d8f6a1c68e9bb5e4.tar.gz
kiss-export: fallback to gz if KISS_COMPRESS is not known
FossilOrigin-Name: 011c1ce0019df908cf2680fdf913d57189cbcfead11addabc47e7368ce455b3e
Diffstat (limited to 'contrib/kiss-export')
-rwxr-xr-xcontrib/kiss-export3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/kiss-export b/contrib/kiss-export
index 8260158..0645228 100755
--- a/contrib/kiss-export
+++ b/contrib/kiss-export
@@ -18,12 +18,13 @@ while read -r file; do
done < "$KISS_ROOT/var/db/kiss/installed/$pkg/manifest"
# Turn the list of files back into a package.
-KISS_COMPRESS="${KISS_COMPRESS:-gz}"
+: "${KISS_COMPRESS:=gz}"
tar cf - -C / -- "$@" | case "$KISS_COMPRESS" in
bz2) bzip2 -z ;;
gz) gzip -6 ;;
xz) xz -zT 0 ;;
zst) zstd -3 ;;
+ *) gzip -6 ;; # Fallback to gzip
esac > "$pkg#$ver-$rel.tar.$KISS_COMPRESS"
printf 'tarball created in %s\n' "$PWD/$pkg#$ver-$rel.tar.$KISS_COMPRESS"