Skip to content

Commit 7bebcfe

Browse files
jchecahiJesus Checa Hidalgo
andauthored
Fix copr packages not installed in Fedora 41 and newer (#680)
This change fixes package installation issues in tmt runs due to dnf5 incompatibilities. Changes introduced: * Added a check to ensure that `llvm-libs` is a snapshots package coming from copr (`~pre` version) * Rewrite fix for dnf5 not resolving the copr runtime dependency repo. Implementation in #670 was forcing to use dnf4, while this one is dnf version agnostic. * Improve how `testing-farm-tag-repository` priority is handled. Before trying to modify the repo we check that it exists, hence we no longer need to mask the result of commands. This now works with both dnf4 and dnf5 Fixes #671 --------- Co-authored-by: Jesus Checa Hidalgo <[email protected]>
1 parent 97fa0ce commit 7bebcfe

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

tests/snapshot-gating.fmf

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,31 @@
1010

1111
summary: LLVM Tests for snapshot gating
1212
prepare:
13-
# dnf5's copr plugin has trouble resolving the runtime dependency repos, so
14-
# we need to use dnf4. Check https://github.com/fedora-copr/copr/issues/3387
1513
- name: Enable copr repo
1614
how: shell
17-
script: |
18-
dnf install -y dnf-plugins-core
19-
dnf-3 -y copr enable @fedora-llvm-team/$COPR_PROJECT $COPR_CHROOT
15+
script:
16+
- dnf install -y 'dnf5-command(copr)' || dnf install -y 'dnf-command(copr)'
17+
- dnf -y copr enable @fedora-llvm-team/$COPR_PROJECT $COPR_CHROOT
18+
# dnf5's copr plugin has trouble resolving the runtime dependency repos,
19+
# and is not replacing the $distname special var. Hence we need to do that
20+
# parsing ourselves.
21+
# Check https://github.com/fedora-copr/copr/issues/3387
22+
- sed -i "s/\$distname/$(echo "$COPR_CHROOT" | cut -d '-' -f 1)/" /etc/yum.repos.d/*$COPR_PROJECT*
23+
2024
# Lower the priority of the testing-farm-tag-repository so that our copr repo is picked up.
2125
# See: https://docs.testing-farm.io/Testing%20Farm/0.1/test-environment.html#_tag_repository
2226
- how: shell
2327
script: |
24-
dnf install -y dnf-plugins-core
25-
dnf config-manager --save --setopt="testing-farm-tag-repository.priority=999" || true
28+
if dnf repolist | grep -q testing-farm-tag-repository; then
29+
dnf install -y 'dnf5-command(config-manager)' || dnf install -y 'dnf-command(config-manager)'
30+
dnf config-manager --save --setopt="testing-farm-tag-repository.priority=999" || \
31+
dnf config-manager setopt "testing-farm-tag-repository.priority=999"
32+
fi
33+
34+
- name: "Check that snapshot (~pre) version of LLVM is installed"
35+
how: shell
36+
order: 99
37+
script: rpm -q --qf "%{version}" llvm-libs | grep '~pre'
2638
adjust:
2739
- discover+:
2840
- name: redhat-rpm-config-tests

0 commit comments

Comments
 (0)