From: Daan De Meyer Date: Thu, 30 May 2024 20:16:13 +0000 (+0200) Subject: mkosi: Skip debuginfo workaround on newer rpm X-Git-Tag: v256-rc4~73^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3b046883addad621550aa74e873256e6fa18373c;p=thirdparty%2Fsystemd.git 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. --- 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 a8e4e7e90fb..6d9380c87bd 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 8b6fc7ab13c..e7f586cf8b8 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")"