From dac085d035d6dfa0659cfee47664e2fbd9181a43 Mon Sep 17 00:00:00 2001 From: Major Hayden Date: Wed, 8 Jul 2020 11:02:38 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=83=20Ensure=20the=20correct=20package?= =?UTF-8?q?s=20are=20installed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some dnf bugs existed in early releases of Fedora 31 + 32 around repository priorities being ignored (like BZ 1733582. Ensure that we are running the latest version of dnf before we try to install from the mock build repo (which has a much higher priority than Fedora's default repos). Also, check to see if EPEL is installed already before installing it again. Fixes #824. 🥰 Signed-off-by: Major Hayden --- schutzbot/deploy.sh | 9 +++++++++ schutzbot/mockbuild.sh | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/schutzbot/deploy.sh b/schutzbot/deploy.sh index 50a0809af..9e57e1741 100755 --- a/schutzbot/deploy.sh +++ b/schutzbot/deploy.sh @@ -31,6 +31,15 @@ sudo rm -f /etc/yum.repos.d/fedora*modular* # dnf operations. echo -e "fastestmirror=1\ninstall_weak_deps=0" | sudo tee -a /etc/dnf/dnf.conf +# Ensure we are using the latest dnf since early revisions of Fedora 31 had +# some dnf repo priority bugs like BZ 1733582. +# NOTE(mhayden): We can exclude kernel updates here to save time with dracut +# and module updates. The system will not be rebooted in CI anyway, so a +# kernel update is not needed. +if [[ $ID == fedora ]]; then + sudo dnf -y upgrade --exclude kernel --exclude kernel-core +fi + # Add osbuild team ssh keys. cat schutzbot/team_ssh_keys.txt | tee -a ~/.ssh/authorized_keys > /dev/null diff --git a/schutzbot/mockbuild.sh b/schutzbot/mockbuild.sh index 1979825e0..883a9df64 100755 --- a/schutzbot/mockbuild.sh +++ b/schutzbot/mockbuild.sh @@ -10,7 +10,7 @@ function greenprint { source /etc/os-release # Mock is only available in EPEL for RHEL. -if [[ $ID == rhel ]]; then +if [[ $ID == rhel ]] && ! rpm -q epel-release; then greenprint "📦 Setting up EPEL repository" curl -Ls --retry 5 --output /tmp/epel.rpm \ https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm