Browse code

Merge "Do not use libvirt-bin package anymore"

Jenkins authored on 2017/04/07 09:37:36
Showing 3 changed files
... ...
@@ -10,7 +10,9 @@ iputils-arping
10 10
 kpartx
11 11
 libjs-jquery-tablesorter # Needed for coverage html reports
12 12
 libmysqlclient-dev
13
-libvirt-bin # NOPRIME
13
+libvirt-bin # dist:xenial NOPRIME
14
+libvirt-clients # not:xenial NOPRIME
15
+libvirt-daemon-system # not:xenial NOPRIME
14 16
 libvirt-dev # NOPRIME
15 17
 mysql-server # NOPRIME
16 18
 parted
... ...
@@ -1148,6 +1148,19 @@ function _parse_package_files {
1148 1148
                 fi
1149 1149
             fi
1150 1150
 
1151
+            # Look for # not:xxx in comment
1152
+            if [[ $line =~ (.*)#.*not:([^ ]*) ]]; then
1153
+                # We are using BASH regexp matching feature.
1154
+                package=${BASH_REMATCH[1]}
1155
+                distros=${BASH_REMATCH[2]}
1156
+                # In bash ${VAR,,} will lowercase VAR
1157
+                # Look for a match in the distro list
1158
+                if [[ ${distros,,} =~ ${DISTRO,,} ]]; then
1159
+                    # If match then skip this package
1160
+                    inst_pkg=0
1161
+                fi
1162
+            fi
1163
+
1151 1164
             if [[ $inst_pkg = 1 ]]; then
1152 1165
                 echo $package
1153 1166
             fi
... ...
@@ -1166,6 +1179,8 @@ function _parse_package_files {
1166 1166
 # - ``# NOPRIME`` defers installation to be performed later in `stack.sh`
1167 1167
 # - ``# dist:DISTRO`` or ``dist:DISTRO1,DISTRO2`` limits the selection
1168 1168
 #   of the package to the distros listed.  The distro names are case insensitive.
1169
+# - ``# not:DISTRO`` or ``not:DISTRO1,DISTRO2`` limits the selection
1170
+#   of the package to the distros not listed. The distro names are case insensitive.
1169 1171
 function get_packages {
1170 1172
     local xtrace
1171 1173
     xtrace=$(set +o | grep xtrace)
... ...
@@ -62,7 +62,11 @@ function install_libvirt {
62 62
 
63 63
     if is_ubuntu; then
64 64
         install_package qemu-system
65
-        install_package libvirt-bin libvirt-dev
65
+        if [[ ${DISTRO} == "xenial" ]]; then
66
+            install_package libvirt-bin libvirt-dev
67
+        else
68
+            install_package libvirt-clients libvirt-daemon-system libvirt-dev
69
+        fi
66 70
         pip_install_gr libvirt-python
67 71
         #pip_install_gr <there-si-no-guestfs-in-pypi>
68 72
     elif is_fedora || is_suse; then