]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
install-deps.sh: remove existing ceph-libboost of different version 40269/head 40285/head
authorKefu Chai <kchai@redhat.com>
Sat, 20 Mar 2021 05:00:01 +0000 (13:00 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 21 Mar 2021 05:47:30 +0000 (13:47 +0800)
we install different versions of precompiled ceph-libboost packages
for different branches when building and testing them on ubuntu test
nodes. for instance,

- nautilus: v1.72
- octopus, pacific: v1.73

they share the same set of test nodes. and these ceph-libboost packages
conflict with each other, because they install files to the same places.

in order to avoid the confliction, we should uninstall existing packages
before installing a different version of ceph-libboost packages.

ceph-libboost${version}-dev is a package providing the shared headers of
boost library, so, in this change we check if it is installed before
returning or removing the existing packages.

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 939b147a55192c21e98d21cb380d0ec0b2ca84d5)

Conflicts:
install-deps.sh: trivial resolution

install-deps.sh

index 77ca16a84d76ad4e478dd0ad60cb39a48f3eed78..14d64724d966640441d0b7c22beac45f1a8e372e 100755 (executable)
@@ -174,13 +174,21 @@ function install_pkg_on_ubuntu {
 }
 
 function install_boost_on_ubuntu {
-    local codename=$1
-    if apt -qq list ceph-libboost1.72-dev 2>/dev/null | grep -q installed; then
-       $SUDO env DEBIAN_FRONTEND=noninteractive apt-get -y remove 'ceph-libboost.*1.72.*'
-       $SUDO rm /etc/apt/sources.list.d/ceph-libboost1.72.list
+    local ver=1.73
+    local installed_ver=$(apt -qq list --installed ceph-libboost*-dev 2>/dev/null |
+                              grep -e 'libboost[0-9].[0-9]\+-dev' |
+                              cut -d' ' -f2 |
+                              cut -d'.' -f1,2)
+    if test -n "$installed_ver"; then
+        if echo "$installed_ver" | grep -q "^$ver"; then
+            return
+        else
+            $SUDO env DEBIAN_FRONTEND=noninteractive apt-get -y remove "ceph-libboost.*${installed_ver}.*"
+            $SUDO rm -f /etc/apt/sources.list.d/ceph-libboost${installed_ver}.list
+        fi
     fi
+    local codename=$1
     local project=libboost
-    local ver=1.73
     local sha1=7aba8a1882670522ee1d1ee1bba0ea170b292dec
     install_pkg_on_ubuntu \
        $project \