From ceb6a3b2e19efade6b61aa800342ffa669dba6a3 Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Wed, 15 May 2024 15:35:54 +0200 Subject: [PATCH 1/4] If dnf5 and dnf-3 are installed, use dnf5 Previously, dnf-3 was used. I don't see a reason, so let's try-n-error. https://github.com/fedora-ci/mini-tps/issues/54 --- mtps-setup | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/mtps-setup b/mtps-setup index 602bb14..93ee9e5 100755 --- a/mtps-setup +++ b/mtps-setup @@ -23,11 +23,11 @@ # 2. If /usr/bin/yum is symlink: # # * read this symlink -# * <=f38, c8s, c9s, rhel8, rhel9: +# * <=f40, <= c10s, <= rhel10: # # lrwxrwxrwx. 1 root root 5 May 29 00:00 /usr/bin/yum -> dnf-3 # -# * >=F39: +# * >=F41: # # lrwxrwxrwx. 1 root root 4 Jul 19 00:00 /usr/bin/yum -> dnf5 # @@ -41,15 +41,7 @@ if [ -z "$YUMDNFCMD" ]; then if [ -f "/usr/bin/yum" ]; then YUMDNFCMD="yum" if [ -L "/usr/bin/yum" ]; then - YUMLINK="$(readlink "/usr/bin/yum")" - if [[ "$YUMLINK" == *dnf5* && -x "/usr/bin/dnf-3" ]]; then - YUMDNFCMD="/usr/bin/dnf-3" - if [ "$EUID" -eq 0 ]; then - if ! rpm -q python3-dnf >/dev/null; then - dnf -y install python3-dnf - fi - fi - fi + YUMDNFCMD="$(readlink "/usr/bin/yum")" fi else YUMDNFCMD="dnf" From 79ddf494bb11642c0e43b93e7fcb79db0af751df Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Wed, 15 May 2024 16:09:38 +0200 Subject: [PATCH 2/4] dnf5 has no repo-pkgs command anyway, we don't need this as we expect it to show nothing (we got here because there are no packages in the repo) --- mtps-run-tests | 2 -- 1 file changed, 2 deletions(-) diff --git a/mtps-run-tests b/mtps-run-tests index cef8761..00a3b61 100755 --- a/mtps-run-tests +++ b/mtps-run-tests @@ -172,8 +172,6 @@ TESTRUN_ID="$(date +%H%M%S)" if [ -z "${nevras_in_repo// /}" ]; then logfname="${LOGS_DIR%%/}/FAIL-${TESTRUN_ID}-${TEST}-mtps-run-tests.log" echo "Test '$TEST' failed due no packages for testing in repo '$REPONAME:'." | tee -a "$logfname" - echo "Output for: ${YUMDNFCMD} repo-pkgs $REPONAME list --showduplicates" | tee -a "$logfname" - "$YUMDNFCMD" repo-pkgs "$REPONAME" list --showduplicates 2>&1 | tee -a "$logfname" exit 1 fi From 1478b419a97c1af8d1e044a8c5f10732fe65195d Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Mon, 17 Jun 2024 13:14:49 +0200 Subject: [PATCH 3/4] Enable repos the dnf5 way also, we don't have to disable the mini-tps copr repo here if we do that where we enabled it (the prepare.sh in installability pipeline) --- profiles/fedora/prepare-system | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/profiles/fedora/prepare-system b/profiles/fedora/prepare-system index 58c3115..7434c4c 100755 --- a/profiles/fedora/prepare-system +++ b/profiles/fedora/prepare-system @@ -46,15 +46,15 @@ skip_if_unavailable=True EOF fi -# Ugly hack for -# https://github.com/fedora-ci/mini-tps/issues/57#issuecomment-2134998129 -# Remove it with a proper fix for mini-tps/issues/57 ! -"$YUMDNFCMD" -y install dnf-plugins-core - # Make sure fedora and fedora-updates repos are enabled -"$YUMDNFCMD" config-manager --set-enabled 'fedora' 'updates' -# Disable all COPR repositories (mini-tps, ...) -"$YUMDNFCMD" config-manager --set-disabled 'copr:*' +if [[ "$YUMDNFCMD" == "dnf5" ]]; then + dnf5 -y install dnf5-plugins # config-manager + dnf5 config-manager setopt fedora.enabled=1 updates.enabled=1 + dnf5 repo list +else + "$YUMDNFCMD" -y install dnf-plugins-core # config-manager + "$YUMDNFCMD" config-manager --set-enabled fedora updates +fi echo "Recreating the DNF cache..." "$YUMDNFCMD" clean all From 5f5dc0d3f8b4427ac8caa417bcf4ed5b39d80293 Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Mon, 17 Jun 2024 15:19:44 +0200 Subject: [PATCH 4/4] Don't use --allowerasing with dnf remove dnf adds allow-erasing flag to transaction by default (and dnf5 remove has no --allowerasing option) https://github.com/rpm-software-management/dnf5/issues/729#issuecomment-1639939563 --- mtps-pkg-test | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mtps-pkg-test b/mtps-pkg-test index 6a14c87..0fca1b0 100755 --- a/mtps-pkg-test +++ b/mtps-pkg-test @@ -202,14 +202,14 @@ pkg_remove_any() { debug "${FUNCNAME[0]}: $name is not installed. Not removing." return 0 fi - # yum remove --allowerasing kernel-rt-kvm + # yum remove kernel-rt-kvm #============================================================================= # Package Arch Version Repository Size #============================================================================= #Removing: # kernel-rt-kvm x86_64 4.18.0-39.rt9.82.el8 @rhel-8-buildroot 361 k # kernel-rt-kvm x86_64 4.18.0-37.rt9.80.el8 @rhel-8-buildroot-old 361 k - "$YUMDNFCMD" -y remove ${ALLOWERASING} "$name" || : + "$YUMDNFCMD" -y remove "$name" || : # yum returns 1 for removing non-existing package for yum4/dnf local ret=0 pkg_is_present "$name" && ret=1 @@ -393,7 +393,7 @@ pkg_remove_any_newer() { continue fi echo "Removing package: $to_remove" - "$YUMDNFCMD" -y remove "$ALLOWERASING" "$to_remove" || : + "$YUMDNFCMD" -y remove "$to_remove" || : done } @@ -409,7 +409,7 @@ pkg_remove_any_older() { fi if nevra_older_then "$to_remove" "$nevra"; then echo "Removing older package: $to_remove" - "$YUMDNFCMD" -y remove "$ALLOWERASING" "$to_remove" || : + "$YUMDNFCMD" -y remove "$to_remove" || : else debug "Not removing newer package: $to_remove" continue