Commit 56fc3949 authored by Andrew Murray's avatar Andrew Murray
Browse files

Ensure xz is installed when needed in fetch_unpack

parent 468e6bf8
...@@ -203,6 +203,9 @@ function untar { ...@@ -203,6 +203,9 @@ function untar {
xz) if [ -n "$IS_MACOS" ]; then xz) if [ -n "$IS_MACOS" ]; then
tar -xf $in_fname tar -xf $in_fname
else else
if [[ ! $(type -P "unxz") ]]; then
echo xz must be installed to uncompress file; exit 1
fi
unxz -c $in_fname | tar -xf - unxz -c $in_fname | tar -xf -
fi ;; fi ;;
*) echo Did not recognize extension $extension; exit 1 ;; *) echo Did not recognize extension $extension; exit 1 ;;
...@@ -237,6 +240,12 @@ function fetch_unpack { ...@@ -237,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}"
......
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