uninstall RIFT packages before installing new ones so that if the list of packages... 37/1237/1
authorPhilip Joseph <philip.joseph@riftio.com>
Fri, 3 Mar 2017 16:37:51 +0000 (11:37 -0500)
committerPhilip Joseph <philip.joseph@riftio.com>
Wed, 8 Mar 2017 14:04:47 +0000 (19:34 +0530)
Original-fix-by: Jeremy Mordkoff <Jeremy.Mordkoff@riftio.com>
Signed-off-by: Philip Joseph <philip.joseph@riftio.com>
BUILD.sh

index eb0c299..a2321e8 100755 (executable)
--- a/BUILD.sh
+++ b/BUILD.sh
@@ -149,8 +149,9 @@ if [[ $PLATFORM == ub16 ]]; then
     curl http://repos.riftio.com/public/xenial-riftware-public-key | sudo apt-key add -
     # the old mkcontainer always enabled release which can be bad
     # so remove it
-    sudo rm -f /etc/apt/sources.list.d/release
-    sudo curl -o /etc/apt/sources.list.d/${PLATFORM_REPOSITORY}.list http://buildtracker.riftio.com/repo_file/ub16/${PLATFORM_REPOSITORY}/ 
+    sudo rm -f /etc/apt/sources.list.d/release.list /etc/apt/sources.list.d/rbac.list /etc/apt/sources.list.d/OSM.list
+    # always use the same file name so that updates will overwrite rather than enable a second repo
+    sudo curl -o /etc/apt/sources.list.d/RIFT.list http://buildtracker.riftio.com/repo_file/ub16/${PLATFORM_REPOSITORY}/ 
     sudo apt-get update
         
     # and install the tools
@@ -180,14 +181,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
+
+    DEL_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"
+    for package in $DEL_PACKAGES; do
+        apt remove -y $package || true
+    done
+
+    INST_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"
+    packages=""
+    for package in $INST_PACKAGES; do
+        packages="$packages $package=${PLATFORM_VERSION}"
+    done
+    sudo apt-get install -y --allow-downgrades $packages
 
     sudo apt-get install python-cinderclient