fedora/REQUIRED_PACKAGES: use dnf, not yum

Dnf is available since many years ago, let's always use it. Moreover, we
are using now --skip-unavailable option, which yum doesn't have, so it
fails.

In the CI we were still using yum because we were passing NM_INSTALL=yum
from fedora-install.sh, causing the CI to fail. Change it.

Fixes: 5409d4f5cd ('fedora/REQUIRED_PACKAGES: speed up optional packages installation')
This commit is contained in:
Íñigo Huguet 2025-02-28 13:36:15 +01:00
parent 472a7b48e8
commit c6093e1dab
2 changed files with 5 additions and 8 deletions

View file

@ -39,12 +39,12 @@ fi
fi
NM_NO_EXTRA=1 NM_INSTALL="yum install -y" ./contrib/fedora/REQUIRED_PACKAGES
yum install -y glibc-langpack-pl ccache clang
NM_NO_EXTRA=1 ./contrib/fedora/REQUIRED_PACKAGES
dnf install -y glibc-langpack-pl ccache clang
# containers have "tsflags=nodocs" in /etc/dnf/dnf.conf. We need /usr/shared/gtk-doc/html
# to generate proper documentation.
yum reinstall -y --setopt='tsflags=' glib2-doc
dnf reinstall -y --setopt='tsflags=' glib2-doc
if [ $IS_FEDORA = 1 ]; then
FEDORA_VERSION=$(cat /etc/os-release | grep '^VERSION_ID=' | sed s\/"VERSION_ID="\/\/)

View file

@ -4,16 +4,13 @@
# NetworkManager on Fedora and RHEL.
#
# Not all of these packages are available, depending
# on your distribution/release. But yum will happily
# skip them.
# on your distribution/release. But the script will skip them.
#
# Not all of these packages are strictly speaking necessary.
# This is a generous list of related packages.
set -xe
DNF="$(command -v dnf &>/dev/null && echo dnf || echo yum)"
SUDO=
[ "$EUID" -eq 0 ] || SUDO=sudo
@ -21,7 +18,7 @@ install() {
if [ "$NM_INSTALL" != "" ]; then
$NM_INSTALL "$@"
else
$SUDO "$DNF" install -y "$@"
$SUDO dnf install -y "$@"
fi
}