From: Thierry Parmentelat Date: Sun, 10 Jul 2016 15:11:48 +0000 (+0200) Subject: fix code that guesses if dnf is present in container X-Git-Tag: 5.3.13~1 X-Git-Url: http://git.onelab.eu/?p=build.git;a=commitdiff_plain;h=80c260a4858f4d59bbd39d59b37cf042af73fb4f fix code that guesses if dnf is present in container --- diff --git a/lbuild-initvm.sh b/lbuild-initvm.sh index b3c8f271..addf7eb5 100755 --- a/lbuild-initvm.sh +++ b/lbuild-initvm.sh @@ -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