]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
travis: macos: unlink all deps, then relink
authorJason Ish <ish@unx.ca>
Fri, 24 Mar 2017 19:59:39 +0000 (13:59 -0600)
committerVictor Julien <victor@inliniac.net>
Mon, 27 Mar 2017 14:08:49 +0000 (16:08 +0200)
Kind of ugly, but first unlink all dependencies then install.
The deps that don't get an upgrade will remain unlinked, so
relink all dependencies as relinking an already linked dep
does not error out.

.travis.yml

index 168454fc22ea9952fe1e929f7f953d32a541a90b..5af6abf23407194e307f9146de9a42729f81578b 100644 (file)
@@ -127,12 +127,29 @@ before_install:
     if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
         brew update
 
+        # Unlink and install each dependency to avoid errors where a
+        # formula might already be installed but is not the current
+        # version.
+        packages="pkg-config libmagic libyaml nss nspr jansson libnet lua pcre hiredis"
+        for package in $packages; do
+            if brew ls $package --versions > /dev/null; then
+                brew unlink $package
+            fi
+        done
+
+        # Now install.
+        brew install $packages
+
+        # Now relink, becuase if a newer version of a package wasn't
+        # installed above, it will remain unlinked.
+        brew link $packages
+
         # Unlink pcre in case its already installed.
-        brew unlink pcre || true
-        brew unlink pkg-config || true
+        brew unlink pcre || true
+        brew unlink pkg-config || true
 
-        brew install pkg-config libmagic libyaml nss nspr jansson libnet lua \
-            pcre hiredis
+        brew install pkg-config libmagic libyaml nss nspr jansson libnet lua \
+            pcre hiredis
     fi
   - ./qa/travis-libhtp.sh