diff options
author | Robert Adam <dev@robert-adam.de> | 2020-04-04 19:04:31 +0300 |
---|---|---|
committer | Robert Adam <dev@robert-adam.de> | 2020-04-04 19:04:31 +0300 |
commit | 3e0c5065d21dfbd1e56b91f81c28fccdbadad794 (patch) | |
tree | 5f709a7e918b36ce8878c74e6339785f62935fa8 /scripts | |
parent | 2d93dbec287b622683e160cdaad14484d6897bcb (diff) |
scripts/travis-ci/before_install.bash: Check if package is installed before attempting to install using brew
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/travis-ci/before_install.bash | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/travis-ci/before_install.bash b/scripts/travis-ci/before_install.bash index a46eb5ded..c5d9f496c 100755 --- a/scripts/travis-ci/before_install.bash +++ b/scripts/travis-ci/before_install.bash @@ -76,7 +76,18 @@ elif [ "${TRAVIS_OS_NAME}" == "osx" ]; then # We don’t use the symlinked "python" installed # by default in the image, so we unlink it to allow # the "python@2" package to be installed without conflict. - brew update && brew unlink python && brew install qt5 libogg libvorbis flac libsndfile protobuf openssl ice + brew update && brew unlink python + + # As brew will set a non-zero exit status if one of the packages it is asked to install + # is installed already. Thus we have to iterate through every single one and check if it + # is installed first. + for pkg in qt5 libogg libvorbis flac libsndfile protobuf openssl ice; do + if brew ls --versions "$pkg" > /dev/null; then + echo "Skipping installation of $pkg as it is already installed" + else + brew install "$pkg" + fi + done else exit 1 fi |