Skip to contentSkip to conversation

ci: improve package manager support in fedora.sh

PATCH New Li Wang via ltp 1 participant 2 messages Apr 16, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ci: improve package manager support in fedora.sh

Enhance Fedora CI script to support multiple versions of DNF. Prefer dnf5 if available, which supports the --skip-unavailable option.

Fallback to dnf or yum based on availability.

This improves compatibility with newer Fedora versions (e.g. Fedora 42+) and prevents failures when unsupported options are passed to older DNF/YUM versions.

---
 ci/fedora.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
ci/fedora.sh +7 -1
index bef5bcd2b..2b0701d08 100755
@@ -2,7 +2,13 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
 # Copyright (c) 2018-2021 Petr Vorel <[email protected]>
 
-yum="yum -y install --skip-broken"
+if command -v dnf5 >/dev/null 2>&1; then
+	yum="dnf5 -y install --skip-broken --skip-unavailable"
+elif command -v dnf >/dev/null 2>&1; then
+	yum="dnf -y install --skip-broken"
+else
+	yum="yum -y install --skip-broken"
+fi
 
 $yum \
 	autoconf \
Signature · 5 lines
2.49.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw

PATCH 2/2 ci: add gawk package

To get rid of the error from Fedora42 configuration.

CI: https://github.com/wangli5665/ltp/actions/runs/14484013675

---
 ci/fedora.sh | 1 +
 1 file changed, 1 insertion(+)
ci/fedora.sh +1 -0
index 2b0701d08..eeacf476c 100755
@@ -15,6 +15,7 @@ $yum \
 	automake \
 	make \
 	clang \
+	gawk \
 	gcc \
 	git \
 	findutils \
Signature · 5 lines
2.49.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp