Unverified Commit a980404f authored by Matthew Brett's avatar Matthew Brett Committed by GitHub
Browse files

Merge pull request #406 from radarhere/untar

MRG: Fixed untar for .xz

Make sure that we can unpack xz code archives, but installing xz as necessary.
parents 7ecf236b d451c58f
...@@ -200,7 +200,14 @@ function untar { ...@@ -200,7 +200,14 @@ function untar {
gz|tgz) tar -zxf $in_fname ;; gz|tgz) tar -zxf $in_fname ;;
bz2) tar -jxf $in_fname ;; bz2) tar -jxf $in_fname ;;
zip) unzip -qq $in_fname ;; zip) unzip -qq $in_fname ;;
xz) unxz -c $in_fname | tar -xf ;; xz) if [ -n "$IS_MACOS" ]; then
tar -xf $in_fname
else
if [[ ! $(type -P "unxz") ]]; then
echo xz must be installed to uncompress file; exit 1
fi
unxz -c $in_fname | tar -xf -
fi ;;
*) echo Did not recognize extension $extension; exit 1 ;; *) echo Did not recognize extension $extension; exit 1 ;;
esac esac
} }
...@@ -233,6 +240,12 @@ function fetch_unpack { ...@@ -233,6 +240,12 @@ function fetch_unpack {
if [ -z "$url" ];then echo "url not defined"; exit 1; fi if [ -z "$url" ];then echo "url not defined"; exit 1; fi
local archive_fname=${2:-$(basename $url)} local archive_fname=${2:-$(basename $url)}
local arch_sdir="${ARCHIVE_SDIR:-archives}" local arch_sdir="${ARCHIVE_SDIR:-archives}"
if [ -z "$IS_MACOS" ]; then
local extension=${archive_fname##*.}
if [ "$extension" == "xz" ]; then
ensure_xz
fi
fi
# Make the archive directory in case it doesn't exist # Make the archive directory in case it doesn't exist
mkdir -p $arch_sdir mkdir -p $arch_sdir
local out_archive="${arch_sdir}/${archive_fname}" local out_archive="${arch_sdir}/${archive_fname}"
......
...@@ -237,7 +237,11 @@ function build_xz { ...@@ -237,7 +237,11 @@ function build_xz {
function ensure_xz { function ensure_xz {
if [[ ! $(type -P "xz") ]]; then if [[ ! $(type -P "xz") ]]; then
build_xz if [ -n "$IS_MACOS" ]; then
brew install xz
else
build_xz
fi
fi fi
} }
......
...@@ -21,6 +21,9 @@ source tests/utils.sh ...@@ -21,6 +21,9 @@ source tests/utils.sh
start_spinner start_spinner
fetch_unpack https://github.com/harfbuzz/harfbuzz/releases/download/2.7.4/harfbuzz-2.7.4.tar.xz
[ -d harfbuzz-2.7.4 ] || ingest ".tar.xz should have been unpacked"
suppress build_bzip2 suppress build_bzip2
suppress build_openssl suppress build_openssl
suppress build_libpng suppress build_libpng
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment