libmakepkg: fix reporting of invalid archive extensions in compress.sh
In commit 1825bd6716
this was split out
from makepkg, but the warning was not properly migrated; $ext did not
ever exist.
As a result, no matter what you did, the only possible warning was:
==> WARNING: '' is not a valid archive extension.
Fix to filter based on the presence of .tar in the argument, and
building the $ext variable for all checking and messaging purposes
within the function.
Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
35a0d5e744
commit
ee5f24e50c
1 changed files with 13 additions and 13 deletions
|
@ -31,19 +31,19 @@ source "$LIBRARY/util/message.sh"
|
||||||
compress_as() {
|
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
|
case "$ext" in
|
||||||
*tar.gz) ${COMPRESSGZ[@]:-gzip -c -f -n} ;;
|
*.tar.gz) ${COMPRESSGZ[@]:-gzip -c -f -n} ;;
|
||||||
*tar.bz2) ${COMPRESSBZ2[@]:-bzip2 -c -f} ;;
|
*.tar.bz2) ${COMPRESSBZ2[@]:-bzip2 -c -f} ;;
|
||||||
*tar.xz) ${COMPRESSXZ[@]:-xz -c -z -} ;;
|
*.tar.xz) ${COMPRESSXZ[@]:-xz -c -z -} ;;
|
||||||
*tar.zst) ${COMPRESSZST[@]:-zstd -c -z -q -} ;;
|
*.tar.zst) ${COMPRESSZST[@]:-zstd -c -z -q -} ;;
|
||||||
*tar.lrz) ${COMPRESSLRZ[@]:-lrzip -q} ;;
|
*.tar.lrz) ${COMPRESSLRZ[@]:-lrzip -q} ;;
|
||||||
*tar.lzo) ${COMPRESSLZO[@]:-lzop -q} ;;
|
*.tar.lzo) ${COMPRESSLZO[@]:-lzop -q} ;;
|
||||||
*tar.Z) ${COMPRESSZ[@]:-compress -c -f} ;;
|
*.tar.Z) ${COMPRESSZ[@]:-compress -c -f} ;;
|
||||||
*tar.lz4) ${COMPRESSLZ4[@]:-lz4 -q} ;;
|
*.tar.lz4) ${COMPRESSLZ4[@]:-lz4 -q} ;;
|
||||||
*tar.lz) ${COMPRESSLZ[@]:-lzip -c -f} ;;
|
*.tar.lz) ${COMPRESSLZ[@]:-lzip -c -f} ;;
|
||||||
*tar) cat ;;
|
*.tar) cat ;;
|
||||||
*) warning "$(gettext "'%s' is not a valid archive extension.")" \
|
*) warning "$(gettext "'%s' is not a valid archive extension.")" \
|
||||||
"$ext"; cat ;;
|
"$ext"; cat ;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Add table
Reference in a new issue