Skip to content

Commit

Permalink
correctly detect liblzma/xz support on OSX
Browse files Browse the repository at this point in the history
- newer versions of libarchive have builtin support for xz
  • Loading branch information
MartinNowak committed May 15, 2016
1 parent 4e5c322 commit 9df4ebd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions script/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ esac

check_tools() {
while [[ $# > 0 ]]; do
if ! command -v $1 &>/dev/null; then
if ! command -v $1 &>/dev/null &&
# detect OSX' liblzma support in libarchive
! { [ $os-$1 == osx-xz ] && otool -L /usr/lib/libarchive.*.dylib | grep -qF liblzma; }; then
fatal "Required tool $1 not found, please install it."
fi
shift
Expand Down Expand Up @@ -429,8 +431,7 @@ download_and_unpack() {

check_tools curl
if [[ $name =~ \.tar\.xz$ ]]; then
# TODO: need to figure out how to detect xz support on osx
[ $os = osx ] && check_tools tar || check_tools tar xz
check_tools tar xz
else
check_tools unzip
fi
Expand Down

0 comments on commit 9df4ebd

Please sign in to comment.