we install different versions of precompiled ceph-libboost packages
for different branches when building and testing them on ubuntu test
nodes. for instance,
- nautilus, octopus: v1.72
- 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
}
function install_boost_on_ubuntu {
- local codename=$1
- if dpkg -s ceph-libboost1.67-dev &> /dev/null; then
- $SUDO env DEBIAN_FRONTEND=noninteractive apt-get -y remove 'ceph-libboost.*1.67.*'
- $SUDO rm /etc/apt/sources.list.d/ceph-libboost1.67.list
+ local ver=1.72
+ 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.72
local sha1=1d7c7a00cc3f37e340bae0360191a757b44ec80c
install_pkg_on_ubuntu \
$project \