From 3b046883addad621550aa74e873256e6fa18373c Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Thu, 30 May 2024 22:16:13 +0200 Subject: [PATCH] mkosi: Skip debuginfo workaround on newer rpm The corresponding bug was fixed in rpm 4.20 (of which the alpha is in rawhide as rpm 4.19.91) so skip the workaround when we detect a newer rpm version. --- .../mkosi.conf.d/10-centos-fedora/mkosi.build.chroot | 8 +++++--- .../system/mkosi.conf.d/10-opensuse/mkosi.build.chroot | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/mkosi.images/system/mkosi.conf.d/10-centos-fedora/mkosi.build.chroot b/mkosi.images/system/mkosi.conf.d/10-centos-fedora/mkosi.build.chroot index a8e4e7e90f..6d9380c87b 100755 --- a/mkosi.images/system/mkosi.conf.d/10-centos-fedora/mkosi.build.chroot +++ b/mkosi.images/system/mkosi.conf.d/10-centos-fedora/mkosi.build.chroot @@ -20,13 +20,15 @@ else TS="${SOURCE_DATE_EPOCH:-$(date +%s)}" fi -# Fix the %install override so debuginfo packages are generated even when --build-in-place is used. -# See https://github.com/rpm-software-management/rpm/issues/3042. -tee --append /usr/lib/rpm/redhat/macros <<'EOF' +if systemd-analyze compare-versions "$(rpm --version | cut -d ' ' -f3)" lt "4.19.91"; then + # Fix the %install override so debuginfo packages are generated even when --build-in-place is used. + # See https://github.com/rpm-software-management/rpm/issues/3042. + tee --append /usr/lib/rpm/redhat/macros <<'EOF' %install %{?_enable_debug_packages:%{debug_package}}\ %%install\ %{nil} EOF +fi VERSION="$(cat meson.version)" RELEASE="$(date "+%Y%m%d%H%M%S" --date "@$TS")" diff --git a/mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.build.chroot b/mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.build.chroot index 8b6fc7ab13..e7f586cf8b 100755 --- a/mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.build.chroot +++ b/mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.build.chroot @@ -26,12 +26,14 @@ fi # extension. find "pkg/$ID" -name "files.*" -exec sed --in-place 's/\.gz$//' {} \; -# Fix the %install override so debuginfo packages are generated. -tee --append /usr/lib/rpm/suse/macros <<'EOF' +if systemd-analyze compare-versions "$(rpm --version | cut -d ' ' -f3)" lt "4.20"; then + # Fix the %install override so debuginfo packages are generated. + tee --append /usr/lib/rpm/suse/macros <<'EOF' %install %{debug_package}\ %%install\ %{nil} EOF +fi VERSION="$(cat meson.version)" RELEASE="$(date "+%Y%m%d%H%M%S" --date "@$TS")" -- 2.25.1