Bsdtar has no explicit flag for xz decompression

At least as of Mac OS 10.13.6 the included bsdtar has no flag for xz
decompression while `z` means gzip decompression which is obviously
problematic for xz compressed archives.

I believe that any tar version on Mac OS that can decompress xz archives
also automatically detects compression formats. So `tar xf` should be
fine.

Fixes #119
This commit is contained in:
toonn 2019-09-29 14:43:05 +02:00
parent c3c11ef5a8
commit 9f083c53e9
1 changed files with 2 additions and 2 deletions

4
ghcup
View File

@ -1038,8 +1038,8 @@ unpack() {
case "${file_ext}" in
xz)
if test "${mydistro}" = "darwin"; then
debug_message "tar -xzf \"${filename}\""
( tar -xzf "${filename}" ) || die "unpacking failed!"
debug_message "tar xf \"${filename}\""
( tar xf "${filename}" ) || die "unpacking failed!"
else
debug_message "xz -cd \"${filename}\" | tar -xf -"
( xz -cd "${filename}" | tar -xf - ; ) || die "unpacking failed!"