]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkosi: Skip debuginfo workaround on newer rpm
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 30 May 2024 20:16:13 +0000 (22:16 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 30 May 2024 20:16:13 +0000 (22:16 +0200)
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.images/system/mkosi.conf.d/10-centos-fedora/mkosi.build.chroot
mkosi.images/system/mkosi.conf.d/10-opensuse/mkosi.build.chroot

index a8e4e7e90fb5659909e9cbf89449286ea2d2d266..6d9380c87bde228ba1ca518239c0a2f465cf1091 100755 (executable)
@@ -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")"
index 8b6fc7ab13ced21025eedd95b874b0e803a37e70..e7f586cf8b8c05d34d59e8b8a93932b17a8d9349 100755 (executable)
@@ -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")"