backport platform install fix from master
authorJeremy Mordkoff <Jeremy.Mordkoff@riftio.com>
Mon, 13 Mar 2017 18:50:42 +0000 (14:50 -0400)
committerJeremy Mordkoff <Jeremy.Mordkoff@riftio.com>
Mon, 13 Mar 2017 18:50:42 +0000 (14:50 -0400)
BUILD.sh

index 788f9d1..b472156 100755 (executable)
--- a/BUILD.sh
+++ b/BUILD.sh
@@ -180,14 +180,22 @@ fi
 
 if [[ $PLATFORM == ub16 ]]; then
     # install the RIFT platform code:
-    sudo apt-get install -y --allow-downgrades rw.toolchain-rwbase=${PLATFORM_VERSION} \
-        rw.toolchain-rwtoolchain=${PLATFORM_VERSION} \
-        rw.core.mgmt-mgmt=${PLATFORM_VERSION} \
-        rw.core.util-util=${PLATFORM_VERSION} \
-        rw.core.rwvx-rwvx=${PLATFORM_VERSION} \
-        rw.core.rwvx-rwdts=${PLATFORM_VERSION} \
-        rw.automation.core-RWAUTO=${PLATFORM_VERSION} \
-         rw.core.rwvx-rwha-1.0=${PLATFORM_VERSION}
+    # remove these packages since some files moved from one to the other, and one was obsoleted
+    # ignore failures
+
+    PACKAGES="rw.toolchain-rwbase rw.toolchain-rwtoolchain rw.core.mgmt-mgmt rw.core.util-util \
+                   rw.core.rwvx-rwvx rw.core.rwvx-rwdts rw.automation.core-RWAUTO rw.core.rwvx-rwha-1.0"
+    # this package is obsolete.
+    OLD_PACKAGES=""
+    for package in $PACKAGES $OLD_PACKAGES; do
+        sudo apt remove -y $package || true
+    done
+
+    packages=""
+    for package in $PACKAGES; do
+        packages="$packages $package=${PLATFORM_VERSION}"
+    done
+    sudo apt-get install -y --allow-downgrades $packages
 
     sudo apt-get install python-cinderclient