index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Eli Schwartz <eschwartz@archlinux.org> | 2019-03-12 13:28:27 -0400 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2019-03-19 14:12:44 +1000 |
commit | ee5f24e50ca5792d37cfbdcbb134fb58777d3eb8 (patch) | |
tree | a36bb2e95acd988446a8a66f586257482c3d63f3 /scripts/libmakepkg/util | |
parent | 35a0d5e744d1c3f93d4f4f79b2ca2e3e411fdd5a (diff) |
-rw-r--r-- | scripts/libmakepkg/util/compress.sh.in | 26 |
diff --git a/scripts/libmakepkg/util/compress.sh.in b/scripts/libmakepkg/util/compress.sh.in index 3d4d88fd..9e3150f7 100644 --- a/scripts/libmakepkg/util/compress.sh.in +++ b/scripts/libmakepkg/util/compress.sh.in @@ -29,21 +29,21 @@ source "$LIBRARY/util/message.sh" # Wrapper around many stream compression formats, for use in the middle of a # pipeline. A tar archive is passed on stdin and compressed to stdout. compress_as() { - # $1: final archive filename extension for compression type detection + # $1: final archive filename extension for compression type detection - local filename="$1" + local ext=".tar${1##*.tar}" - case "$filename" in - *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} ;; - *tar.lz4) ${COMPRESSLZ4[@]:-lz4 -q} ;; - *tar.lz) ${COMPRESSLZ[@]:-lzip -c -f} ;; - *tar) cat ;; + case "$ext" in + *.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} ;; + *.tar.lz4) ${COMPRESSLZ4[@]:-lz4 -q} ;; + *.tar.lz) ${COMPRESSLZ[@]:-lzip -c -f} ;; + *.tar) cat ;; *) warning "$(gettext "'%s' is not a valid archive extension.")" \ "$ext"; cat ;; esac |