Browse code

Switch to dnf when it exists

This has all been around for a *long* time, like when dnf was a weird
new thing. Now it's the opposite and yum is a weird old thing :)
Choose it by default for platforms with it (Fedora, for now).

Change-Id: Id2bd7d145354b996de31944929fd0267ec24a08e

Ian Wienand authored on 2018/06/14 20:11:10
Showing 1 changed files
... ...
@@ -819,11 +819,14 @@ SERVICE_GRACEFUL_SHUTDOWN_TIMEOUT=${SERVICE_GRACEFUL_SHUTDOWN_TIMEOUT:-5}
819 819
 # Service graceful shutdown timeout
820 820
 WORKER_TIMEOUT=${WORKER_TIMEOUT:-90}
821 821
 
822
-# Support alternative yum -- in future Fedora 'dnf' will become the
823
-# only supported installer, but for now 'yum' and 'dnf' are both
824
-# available in parallel with compatible CLIs.  Allow manual switching
825
-# till we get to the point we need to handle this automatically
826
-YUM=${YUM:-yum}
822
+# Choose DNF on RedHat/Fedora platforms with it, or otherwise default
823
+# to YUM.  Can remove this when only dnf is supported (i.e. centos7
824
+# disappears)
825
+if [[ -e /usr/bin/dnf ]]; then
826
+    YUM=${YUM:-dnf}
827
+else
828
+    YUM=${YUM:-yum}
829
+fi
827 830
 
828 831
 # Common Configuration
829 832
 # --------------------