From d103280e0fe468830144665d047829ef86d9ec5e Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Mon, 29 Feb 2016 10:41:50 +0100 Subject: [PATCH] CI: Use yum-deprecated instead of dnf /usr/bin/yum is provided by the dnf-yum package and call /usr/bin/dnf on new fedora distributions. We should directly use old style yum which was renamed to /usr/bin/yum-deprecated and is still part of the yum package. --- contrib/ci/README.md | 4 +++- contrib/ci/distro.sh | 9 ++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/contrib/ci/README.md b/contrib/ci/README.md index 50b73ec354f92e9909a57a82ec72ba1a8516aa1c..b2347c87b6ae8dc533f701b60e01a3d4d4215b15 100644 --- a/contrib/ci/README.md +++ b/contrib/ci/README.md @@ -34,12 +34,14 @@ distro version. On Red Hat distros it is contained in the `redhat-lsb-core` package and on Debian in `lsb-release`. The rest of the required packages CI will attempt to install itself, using -the distribution's package manager invoked through sudo. +the distribution's package manager invoked through sudo. We need to use +yum-deprecated instead of yum on Fedora >= 22 due to bug in dnf BZ1215208. A sudo rule can be employed to selectively avoid password prompts on Red Hat distros: ALL=(ALL:ALL) NOPASSWD: /usr/bin/yum --assumeyes install -- * + ALL=(ALL:ALL) NOPASSWD: /usr/bin/yum-deprecated --assumeyes install -- * and Debian-based distros: diff --git a/contrib/ci/distro.sh b/contrib/ci/distro.sh index da797d02f4b110f9e2c074fc2c97f092ae7200af..23d11de7ab0394a948fc5ed10899ae3a7565cf44 100644 --- a/contrib/ci/distro.sh +++ b/contrib/ci/distro.sh @@ -50,7 +50,14 @@ function distro_pkg_install() { declare prompt=$'Need root permissions to install packages.\n' prompt+="Enter sudo password for $USER: " - if [[ "$DISTRO_BRANCH" == -redhat-* ]]; then + if [[ "$DISTRO_BRANCH" =~ -redhat-fedora-2[2-9] ]]; then + [ $# != 0 ] && sudo -p "$prompt" \ + yum-deprecated --assumeyes install -- "$@" |& + awk 'BEGIN {s=0} + /^No package .* available.$/ {s=1} + {print} + END {exit s}' + elif [[ "$DISTRO_BRANCH" == -redhat-* ]]; then [ $# != 0 ] && sudo -p "$prompt" yum --assumeyes install -- "$@" |& # Pass input to output, fail if a missing package is reported # TODO Remove and switch to DNF once -- 2.7.2