libmakepkg: compress: fix tar extension

With commit 74aacf4495 creating uncompressed .tar
packages fails.

  -> Compressing package...
/usr/share/makepkg/util/compress.sh: line 70: COMPRESS.TAR[@]: invalid variable name
bsdtar: Write error

Empty the '$ext' variable for the '.tar' extension in get_compress_command() to
fix this. We would fallback to cat for 'tar' anyways.

Signed-off-by: Michael Straube <michael.straubej@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Michael Straube 2020-10-21 10:05:43 +02:00 committed by Allan McRae
parent 4d8f58d3b9
commit 94ac3330dd

View file

@ -65,6 +65,9 @@ get_compression_command() {
esac esac
ext=${ext#*.tar.} ext=${ext#*.tar.}
# empty the variable for plain tar archives so we fallback to cat
ext=${ext#*.tar}
if [[ -n $ext ]]; then if [[ -n $ext ]]; then
extarray="COMPRESS${ext^^}[@]" extarray="COMPRESS${ext^^}[@]"
resolvecmd=("${!extarray}") resolvecmd=("${!extarray}")