make misuses of %global with %buildroot work again

OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=684
This commit is contained in:
Michael Schröder 2025-01-07 09:59:56 +00:00 committed by Git OBS Bridge
parent 0bccf0ecf6
commit 1eda1f7aa8
4 changed files with 25 additions and 3 deletions

View File

@ -1,7 +1,7 @@
#
# spec file for package python-rpm
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC
# Copyright (c) 2017 Neal Gompa <ngompa13@gmail.com>.
#
# All modifications and additions to the file contributed by third parties

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Jan 7 10:58:17 CET 2025 - mls@suse.de
- make misuses of %global with %buildroot work again
* new patch: undefbuildroot.diff
-------------------------------------------------------------------
Thu Dec 19 14:29:49 CET 2024 - mls@suse.de

View File

@ -1,7 +1,7 @@
#
# spec file for package rpm
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -123,6 +123,7 @@ Patch150: unshare.diff
Patch151: buildroot-symlink.diff
Patch152: debugpackage.diff
Patch153: nextfiles.diff
Patch154: undefbuildroot.diff
Patch6464: auto-config-update-aarch64-ppc64le.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
#
@ -237,7 +238,7 @@ rm -rf sqlite
%patch -P 140
%endif
%patch -P 141 -P 142
%patch -P 150 -P 151 -P 152 -P 153
%patch -P 150 -P 151 -P 152 -P 153 -P 154
%ifarch aarch64 ppc64le riscv64
%patch -P 6464

15
undefbuildroot.diff Normal file
View File

@ -0,0 +1,15 @@
--- build/parseSpec.c.orig 2025-01-07 09:55:58.006136886 +0000
+++ build/parseSpec.c 2025-01-07 09:56:23.618086661 +0000
@@ -1321,9 +1321,11 @@ static rpmSpec parseSpec(const char *spe
rpmPushMacroFlags(spec->macros, "_top_builddir", NULL,
top_builddir, RMIL_GLOBAL, RPMMACRO_LITERAL);
- /* Undefine (!!) %_builddir so %global misuses fall through */
+ /* Undefine (!!) %_builddir and %buildroot so %global misuses fall through */
while (rpmMacroIsDefined(spec->macros, "_builddir"))
rpmPopMacro(spec->macros, "_builddir");
+ while (rpmMacroIsDefined(spec->macros, "buildroot"))
+ rpmPopMacro(spec->macros, "buildroot");
free(top_builddir);
}