gitlab: fix helper scripts to support DNF5

As Fedora 41 (currently Rawhide) is migrating to DNF5 [1], the
debuginfo-install command is not available anymore according to the
documentation. Instead, the user need to add the package suffix
"-debuginfo" when using the install command.

The implementation of the debuginfo-install plugin is under development
and tracked upstream. [2]

[1] https://fedoraproject.org/wiki/Changes/SwitchToDnf5
[2] https://github.com/rpm-software-management/dnf5/issues/389
This commit is contained in:
Fernando Fernandez Mancera 2024-05-27 10:41:00 +02:00
parent 033cb389ff
commit 4e50d7d53f
3 changed files with 18 additions and 4 deletions

View file

@ -60,9 +60,9 @@ variables:
# This is done by running `ci-fairy generate-template` and possibly bumping
# ".default_tag".
ALPINE_TAG: 'tag-75ecbb5bcef4'
CENTOS_TAG: 'tag-ea45f0a3f632'
CENTOS_TAG: 'tag-0de3c2e2d9ed'
DEBIAN_TAG: 'tag-1ccef04c657b'
FEDORA_TAG: 'tag-ea45f0a3f632'
FEDORA_TAG: 'tag-0de3c2e2d9ed'
UBUNTU_TAG: 'tag-1ccef04c657b'
ALPINE_EXEC: 'bash .gitlab-ci/alpine-install.sh'

View file

@ -5,6 +5,7 @@ set -ex
IS_FEDORA=0
IS_CENTOS=0
CENTOS_VERSION=0
FEDORA_VERSION=0
grep -q '^NAME=.*\(CentOS\)' /etc/os-release && IS_CENTOS=1
grep -q '^NAME=.*\(Fedora\)' /etc/os-release && IS_FEDORA=1
if [ $IS_CENTOS = 1 ]; then
@ -45,9 +46,22 @@ yum install -y glibc-langpack-pl ccache clang
# to generate proper documentation.
yum reinstall -y --setopt='tsflags=' glib2-doc
if [ $IS_FEDORA = 1 ]; then
FEDORA_VERSION=$(cat /etc/os-release | grep '^VERSION_ID=' | sed s\/"VERSION_ID="\/\/)
fi
if command -v dnf &>/dev/null; then
dnf install -y python3-dnf-plugins-core
dnf debuginfo-install -y glib2
# Fedora 41 migrated to DNF5 and the debuginfo-install plugin is not implemented yet
# therefore we need to enable the repo and install the debuginfo subpackage manually
if [ $FEDORA_VERSION -lt "41" ]; then
dnf debuginfo-install -y glib2
else
dnf install -y dnf5-plugins
dnf config-manager setopt fedora-debuginfo.enabled=1
dnf config-manager setopt rawhide-debuginfo.enabled=1 || true
dnf install -y glib2-debuginfo
fi
else
debuginfo-install -y glib2
fi

View file

@ -40,7 +40,7 @@ uname -a
meson --version
! command -v dpkg &>/dev/null || dpkg -l
! command -v yum &>/dev/null || yum list installed
! command -v dnf &>/dev/null || dnf list --installed
! command -v apk &>/dev/null || apk -v info
# We have a unit test that check that `ci-fairy generate-template`