fix code that guesses if dnf is present in container
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Sun, 10 Jul 2016 15:11:48 +0000 (17:11 +0200)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Sun, 10 Jul 2016 15:11:48 +0000 (17:11 +0200)
lbuild-initvm.sh

index b3c8f27..addf7eb 100755 (executable)
@@ -655,11 +655,15 @@ function devel_or_test_tools () {
     case "$pkg_method" in
        yum)
            # --allowerasing required starting with fedora24
-           dnf=$(chroot ${lxc_root} $personality type -p dnf)
-           if [ -n "$dnf" ]; then
+           #
+           has_dnf=""
+           chroot ${lxc_root} $personality dnf --version && has_dnf=true
+           if [ -n "$has_dnf" ]; then
+               echo "container has dnf - invoking with --allowerasing"
                pkg_installer="dnf -y install --allowerasing"
                grp_installer="dnf -y groupinstall --allowerasing"
            else
+               echo "container has only yum"
                pkg_installer="yum -y install"
                grp_installer="yum -y groupinstall"
            fi