From 682e0abe1a58edcdde40a92df1f060dc8fa758c8 Mon Sep 17 00:00:00 2001 From: David Rabel Date: Fri, 17 Mar 2017 19:19:00 +0100 Subject: [PATCH] Do not use libvirt-bin package anymore The package libvirt-bin is a transitional package in Debian and should not be used anymore. Ubuntu Xenial is an exception here. Because of that this change also adds the possibility to use "not:" to exclude distros in files/debs/* just as "dist:" limits distros. Depends-On: Icc59ea79f54d4ff8751f2e353ee3530fff3d961e Closes-Bug: #1673840 Change-Id: I3998a7178d14ec40eae5cb199d66da9546cd6ccf --- files/debs/nova | 4 +++- functions-common | 15 +++++++++++++++ lib/nova_plugins/functions-libvirt | 6 +++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/files/debs/nova b/files/debs/nova index 58dad411a8..5e14aec836 100644 --- a/files/debs/nova +++ b/files/debs/nova @@ -10,7 +10,9 @@ iputils-arping kpartx libjs-jquery-tablesorter # Needed for coverage html reports libmysqlclient-dev -libvirt-bin # NOPRIME +libvirt-bin # dist:xenial NOPRIME +libvirt-clients # not:xenial NOPRIME +libvirt-daemon-system # not:xenial NOPRIME libvirt-dev # NOPRIME mysql-server # NOPRIME parted diff --git a/functions-common b/functions-common index a86cfd8a63..82881e6dc0 100644 --- a/functions-common +++ b/functions-common @@ -1148,6 +1148,19 @@ function _parse_package_files { fi fi + # Look for # not:xxx in comment + if [[ $line =~ (.*)#.*not:([^ ]*) ]]; then + # We are using BASH regexp matching feature. + package=${BASH_REMATCH[1]} + distros=${BASH_REMATCH[2]} + # In bash ${VAR,,} will lowercase VAR + # Look for a match in the distro list + if [[ ${distros,,} =~ ${DISTRO,,} ]]; then + # If match then skip this package + inst_pkg=0 + fi + fi + if [[ $inst_pkg = 1 ]]; then echo $package fi @@ -1166,6 +1179,8 @@ function _parse_package_files { # - ``# NOPRIME`` defers installation to be performed later in `stack.sh` # - ``# dist:DISTRO`` or ``dist:DISTRO1,DISTRO2`` limits the selection # of the package to the distros listed. The distro names are case insensitive. +# - ``# not:DISTRO`` or ``not:DISTRO1,DISTRO2`` limits the selection +# of the package to the distros not listed. The distro names are case insensitive. function get_packages { local xtrace xtrace=$(set +o | grep xtrace) diff --git a/lib/nova_plugins/functions-libvirt b/lib/nova_plugins/functions-libvirt index 56bb6bda1c..7af23cfd2a 100644 --- a/lib/nova_plugins/functions-libvirt +++ b/lib/nova_plugins/functions-libvirt @@ -24,7 +24,11 @@ DEBUG_LIBVIRT=$(trueorfalse True DEBUG_LIBVIRT) function install_libvirt { if is_ubuntu; then install_package qemu-system - install_package libvirt-bin libvirt-dev + if [[ ${DISTRO} == "xenial" ]]; then + install_package libvirt-bin libvirt-dev + else + install_package libvirt-clients libvirt-daemon-system libvirt-dev + fi pip_install_gr libvirt-python if [[ ${DISTRO} == "trusty" && ${EBTABLES_RACE_FIX} == "True" ]]; then # Work around for bug #1501558. We can remove this once we