Skip to content

Commit

Permalink
build,ci: os-x: install packages if they don't exist
Browse files Browse the repository at this point in the history
Previously, they were being installed. And if they were already installed
we would have upgraded them, which takes quite some time.

On older OS X versions, this can take too much.
So, just install packages only if they aren't already.

Signed-off-by: Alexandru Ardelean <[email protected]>
  • Loading branch information
commodo committed Nov 12, 2019
1 parent c9a854f commit 4540f7e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CI/travis/before_install_darwin
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

. CI/travis/lib.sh

brew_install_or_upgrade cmake doxygen libusb libxml2
brew_install_if_not_exists cmake doxygen libusb libxml2
12 changes: 12 additions & 0 deletions CI/travis/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,18 @@ brew_install_or_upgrade() {
done
}

__brew_install_if_not_exists() {
brew ls --version $1 || \
brew install $1
}

brew_install_if_not_exists() {
while [ -n "$1" ] ; do
__brew_install_if_not_exists "$1" || return 1
shift
done
}

sftp_cmd_pipe() {
sftp ${EXTRA_SSH} ${SSHUSER}@${SSHHOST}
}
Expand Down

0 comments on commit 4540f7e

Please sign in to comment.