misc: Prefer dnf over yum when present
Signed-off-by: Vinzenz Feenstra <vfeenstr@redhat.com>
This commit is contained in:
@@ -12,7 +12,14 @@ fi
|
|||||||
sudo_command=$(which sudo)
|
sudo_command=$(which sudo)
|
||||||
|
|
||||||
YUM=`which yum 2>/dev/null`
|
YUM=`which yum 2>/dev/null`
|
||||||
|
DNF=`which dnf 2>/dev/null`
|
||||||
APT=`which apt-get 2>/dev/null`
|
APT=`which apt-get 2>/dev/null`
|
||||||
|
|
||||||
|
# if DNF is available use it
|
||||||
|
if [ -x "$DNF" ]; then
|
||||||
|
YUM=$DNF
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$YUM" -a -z "$APT" ]; then
|
if [ -z "$YUM" -a -z "$APT" ]; then
|
||||||
echo "The package managers can't be found."
|
echo "The package managers can't be found."
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user