public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rpm] pmatilai-v6: Rebase to rpm 4.20 beta1
@ 2026-11-23  9:35 Panu Matilainen
  0 siblings, 0 replies; only message in thread
From: Panu Matilainen @ 2026-11-23  9:35 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/rpm
Branch : pmatilai-v6
Commit : c330f4c3c74f9d8b36edb6a33746ecb3e1aa3145
Author : Panu Matilainen <pmatilai@redhat.com>
Date   : 2024-06-24T11:50:44+03:00
Stats  : +7/-1457 in 19 file(s)
URL    : https://src.fedoraproject.org/rpms/rpm/c/c330f4c3c74f9d8b36edb6a33746ecb3e1aa3145?branch=pmatilai-v6

Log:
Rebase to rpm 4.20 beta1

---
diff --git a/.gitignore b/.gitignore
index e814453..26f1334 100644
--- a/.gitignore
+++ b/.gitignore
@@ -64,3 +64,4 @@
 /rpm-4.19.1.tar.bz2
 /rpm-4.19.1.1.tar.bz2
 /rpm-4.19.91.tar.bz2
+/rpm-4.19.92.tar.bz2

diff --git a/0001-Always-clear-the-RPMEXPAND_KEEP_QUOTED-flag-if-we-do.patch b/0001-Always-clear-the-RPMEXPAND_KEEP_QUOTED-flag-if-we-do.patch
deleted file mode 100644
index 99fe3e4..0000000
--- a/0001-Always-clear-the-RPMEXPAND_KEEP_QUOTED-flag-if-we-do.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From b871b6870659681448372270c061a99a8c73d9f9 Mon Sep 17 00:00:00 2001
-Message-ID: <b871b6870659681448372270c061a99a8c73d9f9.1717588019.git.pmatilai@redhat.com>
-From: Michael Schroeder <mls@suse.de>
-Date: Wed, 5 Jun 2024 11:35:33 +0200
-Subject: [PATCH] Always clear the RPMEXPAND_KEEP_QUOTED flag if we do not
- return the resulting flags
-
-If the resulting flags cannot be returned, the caller has no way to
-strip the quote characters. So we must assume that we are not to
-return quotes in this case.
-
-Fixes issue #3145
----
- rpmio/macro.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/rpmio/macro.c b/rpmio/macro.c
-index fb6d8aede..5b89bbfc0 100644
---- a/rpmio/macro.c
-+++ b/rpmio/macro.c
-@@ -416,6 +416,7 @@ expandThis(rpmMacroBuf mb, const char * src, size_t slen, char **target, int *fl
-     umb = *mb;
-     umb.buf = NULL;
-     umb.error = 0;
-+    umb.flags &= ~(RPMEXPAND_HAVE_QUOTED | RPMEXPAND_KEEP_QUOTED);
-     if (flagsp)
- 	umb.flags = *flagsp;
-     /* In case of error, flag it in the "parent"... */
--- 
-2.45.1
-

diff --git a/0001-Avoid-special-characters-from-VERSION-in-builddir.patch b/0001-Avoid-special-characters-from-VERSION-in-builddir.patch
deleted file mode 100644
index bf2def3..0000000
--- a/0001-Avoid-special-characters-from-VERSION-in-builddir.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-From ce349fa6f10b7ac52250a16a57cf31c868ac54bf Mon Sep 17 00:00:00 2001
-Message-ID: <ce349fa6f10b7ac52250a16a57cf31c868ac54bf.1718196773.git.pmatilai@redhat.com>
-From: Panu Matilainen <pmatilai@redhat.com>
-Date: Wed, 12 Jun 2024 10:17:05 +0300
-Subject: [PATCH] Avoid special characters from %{VERSION} in %builddir
-
-%setup always defaulted to %{name}-%{version} as the directory name,
-but most projects would only have regular characters in their tarball
-path components (and those that did, could be expected to deal with it).
-And when using tilde/caret in Version you'd use `%setup -n <path>` instead.
-This changed with the new %builddir in 4.20 where caret and tilde from
-version leak into build paths, and nowhere near all build systems,
-helper scripts and whatnot properly escape/quote all the paths they
-handle. Such as apparently ninja-build, reported in
-https://bugzilla.redhat.com/show_bug.cgi?id=2290987
-
-Convert ^ and ~ in builddir to underscores. Note we specifically only
-convert that for the per-package %builddir we create, if somebody sets
-the top build directory to a path that includes such oddities, that's
-explicitly *their* responsibility.
-
-Fixes: #3159
----
- build/parsePreamble.c            | 10 +++++++++-
- tests/data/SPECS/weirdnames.spec |  7 +++++++
- tests/rpmbuild.at                |  6 ++++--
- 3 files changed, 20 insertions(+), 3 deletions(-)
-
-diff --git a/build/parsePreamble.c b/build/parsePreamble.c
-index 20bb3e294..8b0c4c527 100644
---- a/build/parsePreamble.c
-+++ b/build/parsePreamble.c
-@@ -1287,7 +1287,15 @@ int parsePreamble(rpmSpec spec, int initialPackage, enum parseStages stage)
- 
- 	if (!spec->buildDir) {
- 	    /* Using release here causes a buildid no-recompute test to fail */
--	    spec->buildDir = rpmExpand("%{_top_builddir}/%{NAME}-%{VERSION}-build", NULL);
-+	    char *bn = rpmExpand("%{NAME}-%{VERSION}-build", NULL);
-+	    /* Tilde and caret in paths are evil, convert to underscores */
-+	    for (char *t = bn; *t; t++) {
-+		if (*t == '^' || *t == '~')
-+		    *t = '_';
-+	    }
-+	    spec->buildDir = rpmExpand("%{_top_builddir}/", bn, NULL);
-+	    free(bn);
-+
- 	    /* Override toplevel _builddir for backwards compatibility */
- 	    rpmPushMacroFlags(spec->macros, "_builddir", NULL, spec->buildDir,
- 				RMIL_SPEC, RPMMACRO_LITERAL);
-diff --git a/tests/data/SPECS/weirdnames.spec b/tests/data/SPECS/weirdnames.spec
-index e241e4c26..2d4354a43 100644
---- a/tests/data/SPECS/weirdnames.spec
-+++ b/tests/data/SPECS/weirdnames.spec
-@@ -1,7 +1,12 @@
- %bcond_with illegal
-+%bcond_with weirdver
- 
- Name:		weirdnames
-+%if %{with weirdver}
-+Version:	1.0~aa^bb
-+%else
- Version:	1.0
-+%endif
- Release:	1
- Summary:	Testing weird filename behavior
- License:	GPL
-@@ -10,6 +15,8 @@ BuildArch:	noarch
- %description
- %{summary}
- 
-+%build
-+
- %install
- mkdir -p %{buildroot}/opt
- cd %{buildroot}/opt
-diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at
-index a6f038aee..56e79c989 100644
---- a/tests/rpmbuild.at
-+++ b/tests/rpmbuild.at
-@@ -3336,10 +3336,12 @@ AT_KEYWORDS([build builddir])
- RPMDB_INIT
- # Trick for compatibly getting the builddir out of old and new rpm
- RPMTEST_CHECK([
--runroot rpmbuild -bc --short-circuit --define '__spec_build_pre echo builddir=%{_builddir}; exit 0' /data/SPECS/hello.spec | awk /^builddir/
-+runroot rpmbuild \
-+	--with weirdver \
-+	-bc --short-circuit --define '__spec_build_pre echo builddir=%{_builddir}; exit 0' /data/SPECS/weirdnames.spec 2>&1 | awk /^builddir/
- ],
- [0],
--[builddir=/build/BUILD/hello-1.0-build
-+[builddir=/build/BUILD/weirdnames-1.0_aa_bb-build
- ],
- [])
- 
--- 
-2.45.1
-

diff --git a/0001-Ensure-noarch-packages-don-t-get-debuginfo.patch b/0001-Ensure-noarch-packages-don-t-get-debuginfo.patch
deleted file mode 100644
index daedf4a..0000000
--- a/0001-Ensure-noarch-packages-don-t-get-debuginfo.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From 4bc89c300048b82362e31ed9cd4df39867b3b0e4 Mon Sep 17 00:00:00 2001
-From: Panu Matilainen <pmatilai@redhat.com>
-Date: Tue, 21 May 2024 12:24:09 +0300
-Subject: [PATCH] Ensure noarch packages don't get debuginfo
-
-Add back the %ifnarch noarch test overconfidently removed in
-commit 8535694599ee7f35747d44e2ea0a62dc5e8880e5, "it's more complicated
-than that". Add a test-case too.
-
-This is band-aid for #3115.
----
- macros.in         |  2 ++
- tests/rpmbuild.at | 12 ++++++++++++
- 2 files changed, 14 insertions(+)
-
-diff --git a/macros.in b/macros.in
-index f43912380..ba661d80a 100644
---- a/macros.in
-+++ b/macros.in
-@@ -195,9 +195,11 @@ package or when debugging this package.\
- %{nil}
- 
- %debug_package \
-+%ifnarch noarch\
- %global __debug_package 1\
- %_debuginfo_template\
- %{?_debugsource_packages:%_debugsource_template}\
-+%endif\
- %{nil}
- 
- %_langpack_template() \
-diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at
-index 0e1c628d6..8a06d8a84 100644
---- a/tests/rpmbuild.at
-+++ b/tests/rpmbuild.at
-@@ -2224,7 +2224,19 @@ No hello.debug
- [ignore])
- RPMTEST_CLEANUP
- 
-+AT_SETUP([explicit %_enable_debug_package on noarch])
-+AT_KEYWORDS([build debuginfo])
-+RPMTEST_CHECK([
-+RPMDB_INIT
- 
-+runroot rpmbuild --quiet -bb \
-+		--define "%_enable_debug_packages 1" \
-+		/data/SPECS/hlinktest.spec
-+],
-+[0],
-+[ignore],
-+[ignore])
-+RPMTEST_CLEANUP
- 
- # ------------------------------
- # Check dynamic build requires
--- 
-2.45.1
-

diff --git a/0001-Fix-a-buildroot-regression-on-an-early-__spec_instal.patch b/0001-Fix-a-buildroot-regression-on-an-early-__spec_instal.patch
deleted file mode 100644
index 18f30d0..0000000
--- a/0001-Fix-a-buildroot-regression-on-an-early-__spec_instal.patch
+++ /dev/null
@@ -1,104 +0,0 @@
-From b20c731a5e916649b0257875febe260b5dfe3d72 Mon Sep 17 00:00:00 2001
-Message-ID: <b20c731a5e916649b0257875febe260b5dfe3d72.1717146759.git.pmatilai@redhat.com>
-From: Panu Matilainen <pmatilai@redhat.com>
-Date: Fri, 31 May 2024 11:44:39 +0300
-Subject: [PATCH] Fix a %buildroot regression on an early %__spec_install_pre
- %global override
-
-The Fedora kernel.spec overrides %__spec_install_pre with this very
-early in the spec:
-
-	%global __spec_install_pre %{___build_pre}
-
-This happens long before Name and all that is defined, so half of
-the environment setup in %___build_pre just falls through with
-unexpanded macros as the values (eg RPM_PACKAGE_NAME=%{NAME}) at this
-stage, and get their real values on the re-expansion before the actual
-scriptlet execution. But, due to pre-historical reasons, RPM_BUILD_ROOT
-setting is conditional, depending on whether %buildroot is defined or
-not. It used to be defined in the main macros file, so RPM_BUILD_ROOT
-would also get that template-style value at this point in the spec,
-but since 9d35c8df497534e1fbd806a4dc78802bcf35d7cb it no longer is.
-And that causes RPM_BUILD_ROOT to be *dropped* from the pre-environment
-"template" at this early stage of spec parsing.
-
-Add a simple reproducer test, this level of meddling in packages is of
-playing with fire and we may not be able to guarantee it always stays
-this way, but at least we'll be aware of possible changes in behavior.
-
-Commit 0a4e182e4003be1497452658b7b3327975694641 from 1998 is the first
-macro version of this conditional that came back to bite us. It
-should've been removed in 9d35c8df497534e1fbd806a4dc78802bcf35d7cb.
-
-Reported in https://bugzilla.redhat.com/show_bug.cgi?id=2284036
----
- macros.in                          |  4 ++--
- tests/data/SPECS/install-hack.spec | 20 ++++++++++++++++++++
- tests/rpmbuild.at                  | 12 ++++++++++++
- 3 files changed, 34 insertions(+), 2 deletions(-)
- create mode 100644 tests/data/SPECS/install-hack.spec
-
-diff --git a/macros.in b/macros.in
-index ba661d80a..44af70288 100644
---- a/macros.in
-+++ b/macros.in
-@@ -770,8 +770,8 @@ Supplements:   (%{name} = %{version}-%{release} and langpacks-%{1})\
-   unset CDPATH DISPLAY ||:\
-   unset DEBUGINFOD_URLS ||:\
-   unset RPM_CONFIG_DIR ||:\
--  %{?buildroot:RPM_BUILD_ROOT=\"%{buildroot}\"\
--  export RPM_BUILD_ROOT}\
-+  RPM_BUILD_ROOT=\"%{buildroot}\"\
-+  export RPM_BUILD_ROOT\
-   %{?_javaclasspath:CLASSPATH=\"%{_javaclasspath}\"\
-   export CLASSPATH}\
-   PKG_CONFIG_PATH=\"${PKG_CONFIG_PATH}:%{_libdir}/pkgconfig:%{_datadir}/pkgconfig\"\
-diff --git a/tests/data/SPECS/install-hack.spec b/tests/data/SPECS/install-hack.spec
-new file mode 100644
-index 000000000..42ecbed18
---- /dev/null
-+++ b/tests/data/SPECS/install-hack.spec
-@@ -0,0 +1,20 @@
-+# Mimic what fedora kernel.spec does. Whether this is a legitimate
-+# thing for a package to or not is another question, but at least we'll
-+# be aware if the behavior changes.
-+%global __spec_install_pre %{___build_pre}
-+
-+Summary: install scriptlet section override hack
-+Name: install-hack
-+Version: 1.0
-+Release: 1
-+License: GPL
-+Buildarch: noarch
-+
-+%description
-+%{summary}
-+
-+%install
-+mkdir -p $RPM_BUILD_ROOT/usr/local/bin
-+
-+%files
-+/usr/local/bin/
-diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at
-index 38fe476a3..a77ceeca4 100644
---- a/tests/rpmbuild.at
-+++ b/tests/rpmbuild.at
-@@ -3277,3 +3277,15 @@ BUILD_POST noarch noarch noarch
- ],
- [])
- RPMTEST_CLEANUP
-+
-+AT_SETUP([rpmbuild install_pre override])
-+AT_KEYWORDS([build])
-+RPMDB_INIT
-+RPMTEST_CHECK([
-+runroot rpmbuild -bb /data/SPECS/install-hack.spec
-+],
-+[0],
-+[ignore],
-+[ignore])
-+RPMTEST_CLEANUP
-+
--- 
-2.45.1
-

diff --git a/0001-Fix-incomplete-header-on-plain-src.rpm-build-modes-r.patch b/0001-Fix-incomplete-header-on-plain-src.rpm-build-modes-r.patch
deleted file mode 100644
index 15afa14..0000000
--- a/0001-Fix-incomplete-header-on-plain-src.rpm-build-modes-r.patch
+++ /dev/null
@@ -1,171 +0,0 @@
-From e464af747b1ad97b9a088cc2045263864f283566 Mon Sep 17 00:00:00 2001
-From: Panu Matilainen <pmatilai@redhat.com>
-Date: Mon, 27 May 2024 13:53:32 +0300
-Subject: [PATCH] Fix incomplete header on plain src.rpm build modes regression
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Since 9165963de8bb5d5ad0a24ea4656d6d04d733f6bc, the main header wasn't
-getting properly filled on plain src.rpm build modes like -bs. So a lot
-of things was missing, but spotted in particular because %packager
-wasn't getting set as per macros in Koji. Fix by letting rpm finalize
-the spec after parse when no dynamic spec parts are to be executed.
-
-Add a bunch of tests around this - we can't possibly test every single
-build scenario but this should cover at least the most common ones
-pretty well.
-
-Reported-by: Miro Hrončok <miro@hroncok.cz>
----
- tests/rpmbuild.at | 54 ++++++++++++++++++++++++++++++++++++++++++++++-
- tools/rpmbuild.c  | 14 ++++++------
- 2 files changed, 61 insertions(+), 7 deletions(-)
-
-diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at
-index a665a6bce..2243afcf4 100644
---- a/tests/rpmbuild.at
-+++ b/tests/rpmbuild.at
-@@ -26,6 +26,7 @@ RPMDB_INIT
- RPMTEST_CHECK([
- 
- run rpmbuild \
-+  --define "packager Iam" \
-   -ba ${RPMDATA}/SPECS/hello.spec
- ],
- [0],
-@@ -42,6 +43,38 @@ runroot rpm -qp --qf "%{license}\n" /build/RPMS/*/hello-1.0-1.*.rpm
- GPL
- ],
- [])
-+
-+RPMTEST_CHECK([
-+runroot rpm -qp --qf "%{packager}\n" /build/SRPMS/hello-1.0-1.src.rpm
-+runroot rpm -qp --qf "%{packager}\n" /build/RPMS/*/hello-1.0-1.*.rpm
-+],
-+[0],
-+[Iam
-+Iam
-+],
-+[])
-+RPMTEST_CLEANUP
-+
-+AT_SETUP([rpmbuild -bs spec])
-+AT_KEYWORDS([build])
-+RPMDB_INIT
-+
-+RPMTEST_CHECK([
-+runroot rpmbuild -bs \
-+	--define "packager Iam" \
-+	${RPMDATA}/SPECS/hello.spec
-+],
-+[0],
-+[ignore],
-+[ignore])
-+
-+RPMTEST_CHECK([
-+runroot rpm -q --qf "%{packager}\n" /build/SRPMS/hello-1.0-1.src.rpm
-+],
-+[0],
-+[Iam
-+],
-+[])
- RPMTEST_CLEANUP
- 
- AT_SETUP([rpmbuild -b buildsystem])
-@@ -471,11 +504,20 @@ RPMDB_INIT
- RPMTEST_CHECK([
- 
- run rpmbuild \
-+  --define "packager Iam" \
-   --rebuild ${RPMDATA}/SRPMS/hello-1.0-1.src.rpm
- ],
- [0],
- [ignore],
- [ignore])
-+
-+RPMTEST_CHECK([
-+runroot rpm -qp --qf "%{packager}\n" /build/RPMS/*/hello-1.0-1.*.rpm
-+],
-+[0],
-+[Iam
-+],
-+[])
- RPMTEST_CLEANUP
- 
- AT_SETUP([rpmbuild --short-circuit -bl])
-@@ -512,7 +554,9 @@ AT_KEYWORDS([build])
- RPMDB_INIT
- RPMTEST_CHECK([
- 
--runroot rpmbuild --quiet -ts /data/SOURCES/hello-2.0.tar.gz
-+runroot rpmbuild --quiet \
-+	--define "packager Iam" \
-+	-ts /data/SOURCES/hello-2.0.tar.gz
- runroot rpm -qpl /build/SRPMS/hello-2.0-1.src.rpm
- ],
- [0],
-@@ -520,6 +564,14 @@ runroot rpm -qpl /build/SRPMS/hello-2.0-1.src.rpm
- hello.spec
- ],
- [])
-+
-+RPMTEST_CHECK([
-+runroot rpm -q --qf "%{packager}\n" /build/SRPMS/hello-2.0-1.src.rpm
-+],
-+[0],
-+[Iam
-+],
-+[])
- RPMTEST_CLEANUP
- 
- # weird filename survival test
-diff --git a/tools/rpmbuild.c b/tools/rpmbuild.c
-index dd36e24d8..6e6d2cfe4 100644
---- a/tools/rpmbuild.c
-+++ b/tools/rpmbuild.c
-@@ -79,6 +79,14 @@ static void buildArgCallback( poptContext con,
-     BTA_t rba = &rpmBTArgs;
- 
-     switch (opt->val) {
-+    case POPT_BS:
-+    case POPT_RS:
-+    case POPT_TS:
-+    case POPT_BR:
-+    case POPT_RR:
-+    case POPT_TR:
-+	/* If only building src.rpm, there are no dynamic parts to include */
-+	spec_flags &= ~RPMSPEC_NOFINALIZE;
-     case POPT_REBUILD:
-     case POPT_RECOMPILE:
-     case POPT_BA:
-@@ -89,8 +97,6 @@ static void buildArgCallback( poptContext con,
-     case POPT_BI:
-     case POPT_BL:
-     case POPT_BP:
--    case POPT_BS:
--    case POPT_BR:
-     case POPT_RA:
-     /* case POPT_RB: same value as POPT_REBUILD */
-     case POPT_RC:
-@@ -99,8 +105,6 @@ static void buildArgCallback( poptContext con,
-     case POPT_RI:
-     case POPT_RL:
-     case POPT_RP:
--    case POPT_RS:
--    case POPT_RR:
-     case POPT_TA:
-     case POPT_TB:
-     case POPT_TC:
-@@ -109,8 +113,6 @@ static void buildArgCallback( poptContext con,
-     case POPT_TI:
-     case POPT_TL:
-     case POPT_TP:
--    case POPT_TS:
--    case POPT_TR:
- 	if (opt->val == POPT_BS || opt->val == POPT_TS)
- 	    noDeps = 1;
- 	if (buildMode == '\0' && buildChar == '\0') {
--- 
-2.45.1
-

diff --git a/0001-Fix-noprep-regression-from-introducing-mkbuilddir.patch b/0001-Fix-noprep-regression-from-introducing-mkbuilddir.patch
deleted file mode 100644
index dcba1d2..0000000
--- a/0001-Fix-noprep-regression-from-introducing-mkbuilddir.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-From c74ab58f081937eefd0f79af8d0310495d321864 Mon Sep 17 00:00:00 2001
-From: Panu Matilainen <pmatilai@redhat.com>
-Date: Thu, 23 May 2024 07:36:05 +0300
-Subject: [PATCH 1/3] Fix --noprep regression from introducing %mkbuilddir
-
-Commit 9d35c8df497534e1fbd806a4dc78802bcf35d7cb added a new step
-into the build process but I literally wasn't even aware we have a
---noprep switch in rpmbuild, much less that it's used. Quite widely
-even, by mock.
-
-Luckily this seems simple to fix, just skip %mkbuilddir in --noprep.
-Extend the dynamic buildrequires test to mimick what mock does.
-
-Fixes: #3121
----
- tests/rpmbuild.at | 18 ++++++++++++++++++
- tools/rpmbuild.c  |  2 +-
- 2 files changed, 19 insertions(+), 1 deletion(-)
-
-diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at
-index 8a06d8a84..a060abe1f 100644
---- a/tests/rpmbuild.at
-+++ b/tests/rpmbuild.at
-@@ -2259,6 +2259,8 @@ RPMTEST_CLEANUP
- 
- # ------------------------------
- # Check dynamic build requires
-+# Mimick what mock does: repeat build with --noprep --noclean
-+# until -br succeeds, and finally build the package.
- AT_SETUP([rpmbuild -br])
- AT_KEYWORDS([build])
- RPMTEST_CHECK([
-@@ -2275,6 +2277,22 @@ runroot rpmbuild \
- 	foo-bar = 2.0 is needed by buildrequires-1.0-1.noarch
- ],
- )
-+
-+RPMTEST_CHECK([
-+runroot rpmbuild \
-+    --define "provs bar foo foo-bar" \
-+    --define "pkg foo" \
-+    -bb --quiet /data/SPECS/deptest.spec
-+
-+runroot rpm -U /build/RPMS/noarch/deptest-foo-1.0-1.noarch.rpm
-+
-+runroot rpmbuild \
-+    -br --noprep --noclean\
-+    --quiet /data/SPECS/buildrequires.spec
-+],
-+[0],
-+[],
-+[])
- RPMTEST_CLEANUP
- 
- # Test that -br creates an src.rpm on success
-diff --git a/tools/rpmbuild.c b/tools/rpmbuild.c
-index 492b0c290..459427fe3 100644
---- a/tools/rpmbuild.c
-+++ b/tools/rpmbuild.c
-@@ -261,7 +261,7 @@ static struct poptOption rpmBuildPoptTable[] = {
- 
-  { "noclean", '\0', POPT_BIT_SET, &nobuildAmount, RPMBUILD_CLEAN|RPMBUILD_RMBUILD,
- 	N_("do not execute %clean stage of the build"), NULL },
-- { "noprep", '\0', POPT_BIT_SET, &nobuildAmount, RPMBUILD_PREP,
-+ { "noprep", '\0', POPT_BIT_SET, &nobuildAmount, RPMBUILD_PREP|RPMBUILD_MKBUILDDIR,
- 	N_("do not execute %prep stage of the build"), NULL },
-  { "nocheck", '\0', POPT_BIT_SET, &nobuildAmount, RPMBUILD_CHECK,
- 	N_("do not execute %check stage of the build"), NULL },
--- 
-2.45.1
-

diff --git a/0001-Fix-regression-in-Lua-scriptlet-runaway-child-detect.patch b/0001-Fix-regression-in-Lua-scriptlet-runaway-child-detect.patch
deleted file mode 100644
index 40c0c5e..0000000
--- a/0001-Fix-regression-in-Lua-scriptlet-runaway-child-detect.patch
+++ /dev/null
@@ -1,79 +0,0 @@
-From bb4aaaa2e8e4bdfc02f9d98ab2982074051c4eb2 Mon Sep 17 00:00:00 2001
-Message-ID: <bb4aaaa2e8e4bdfc02f9d98ab2982074051c4eb2.1702642817.git.pmatilai@redhat.com>
-From: Panu Matilainen <pmatilai@redhat.com>
-Date: Fri, 15 Dec 2023 13:15:29 +0200
-Subject: [PATCH] Fix regression in Lua scriptlet runaway child detection
-
-Commit a8107659ef3dd4855729bf65aa4d70f784cb5a5f moved the detection
-to parent using waitpid(), but this causes it to complain on any
-process in the same process group. In the usual rpm context we don't
-have any, but we can't very well tell API users not to have any
-children. And then failed to detect a runaway Lua child in one of
-our own tests. Uff.
-
-rpmlog() in the child has the issues mentioned in the originating
-commit, but that's a problem that needs to be solved elsewhere.
-Revert back to issuing a warning when we actually *are* in the child
-process, so there are no false positive possible. Use EXIT_FAILURE
-like in the original version, dunno why I'd changed that.
-
-Update the rpmlua test to expect the deserved warning, and use
-stdio for printing its "normal" output, the catch there is that we
-need to flush the io in the child.
-
-Reported at https://bugzilla.redhat.com/show_bug.cgi?id=2254463
----
- rpmio/rpmlua.c    | 10 +++-------
- tests/rpmmacro.at |  9 ++++-----
- 2 files changed, 7 insertions(+), 12 deletions(-)
-
-diff --git a/rpmio/rpmlua.c b/rpmio/rpmlua.c
-index 8ef90e779..854fd469d 100644
---- a/rpmio/rpmlua.c
-+++ b/rpmio/rpmlua.c
-@@ -239,17 +239,13 @@ static int luaopt(int c, const char *oarg, int oint, void *data)
- static int rpm_pcall(lua_State *L, int nargs, int nresults, int errfunc)
- {
-     pid_t pid = getpid();
--    int status;
- 
-     int rc = lua_pcall(L, nargs, nresults, errfunc);
- 
-     /* Terminate unhandled fork from Lua script */
--    if (pid != getpid())
--	_exit(1);
--
--    if (waitpid(0, &status, WNOHANG) == 0) {
--	rpmlog(RPMLOG_WARNING,
--		_("runaway fork() in Lua script\n"));
-+    if (pid != getpid()) {
-+	rpmlog(RPMLOG_WARNING, _("runaway fork() in Lua script\n"));
-+	_exit(EXIT_FAILURE);
-     }
- 
-     return rc;
-diff --git a/tests/rpmmacro.at b/tests/rpmmacro.at
-index 0ebcc050c..47a13ef2b 100644
---- a/tests/rpmmacro.at
-+++ b/tests/rpmmacro.at
-@@ -1322,13 +1322,12 @@ nil	No such file or directory	2.0
- ],
- [])
- 
--# This uses io.stderr:write() because the grue from the previous test 
--# appears to have eaten stdout of the forked child, or something.
- RPMTEST_CHECK([
--runroot_other rpmlua -e 'pid = posix.fork(); if pid == 0 then a,b,c=rpm.redirect2null(-1); io.stderr:write(string.format("%s\t%s\t%s\n", a,b,c)) else posix.wait(pid) end'
-+runroot_other rpmlua -e 'pid = posix.fork(); if pid == 0 then a,b,c=rpm.redirect2null(-1); print(string.format("%s\t%s\t%s", a,b,c)); io.flush() else posix.wait(pid) end'
- ],
- [0],
--[],
- [nil	Bad file descriptor	9.0
--])
-+],
-+[warning: runaway fork() in Lua script]
-+)
- RPMTEST_CLEANUP
--- 
-2.43.0
-

diff --git a/0001-Fix-regression-on-subpackage-debuginfo-RPMTAG_SOURCE.patch b/0001-Fix-regression-on-subpackage-debuginfo-RPMTAG_SOURCE.patch
deleted file mode 100644
index 1769578..0000000
--- a/0001-Fix-regression-on-subpackage-debuginfo-RPMTAG_SOURCE.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From e0e43e93777701f5f2e6f7505b8e9b9e9681aee1 Mon Sep 17 00:00:00 2001
-From: Panu Matilainen <pmatilai@redhat.com>
-Date: Wed, 29 May 2024 12:57:34 +0300
-Subject: [PATCH] Fix regression on subpackage debuginfo RPMTAG_SOURCERPM
- missing
-
-Didn't bisect but this is probably due to mucking around with the
-src.rpm name generation in dc47a50c6345a25b861305d8aa8ae464098834ff,
-but it's also much saner this way: the info should be copied from the
-main debuginfo package along with all the other similar stuff.
----
- build/files.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/build/files.c b/build/files.c
-index f57d183d5..f85ad7ed0 100644
---- a/build/files.c
-+++ b/build/files.c
-@@ -2805,6 +2805,7 @@ static rpmTagVal copyTagsFromMainDebug[] = {
-     RPMTAG_OS,
-     RPMTAG_PLATFORM,
-     RPMTAG_OPTFLAGS,
-+    RPMTAG_SOURCERPM,
-     0
- };
- 
--- 
-2.45.1
-

diff --git a/0001-Fix-signfiles-regression-from-13a02b15d6552bc8e44023.patch b/0001-Fix-signfiles-regression-from-13a02b15d6552bc8e44023.patch
deleted file mode 100644
index 90bab7c..0000000
--- a/0001-Fix-signfiles-regression-from-13a02b15d6552bc8e44023.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From e69b79fa7d4757983873083a0f12164a1ad1a70b Mon Sep 17 00:00:00 2001
-Message-ID: <e69b79fa7d4757983873083a0f12164a1ad1a70b.1718086167.git.pmatilai@redhat.com>
-From: Panu Matilainen <pmatilai@redhat.com>
-Date: Tue, 11 Jun 2024 08:51:58 +0300
-Subject: [PATCH] Fix signfiles regression from
- 13a02b15d6552bc8e440235b846ea5257514d397
-
-The sneaky construct hid more than just values starting from 1: there's
-no value 4 in rpmHashAlgo enum, so skipping that causes all the later
-hash names to be off by one.
-
-Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2291183
----
- sign/rpmsignfiles.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/sign/rpmsignfiles.c b/sign/rpmsignfiles.c
-index ecd49aac5..9095d9a27 100644
---- a/sign/rpmsignfiles.c
-+++ b/sign/rpmsignfiles.c
-@@ -23,6 +23,7 @@ static const char *hash_algo_name[] = {
-     "md5", 	/* RPM_HASH_MD5 */
-     "sha1", 	/* RPM_HASH_SHA1 */
-     "rmd160",	/* RPM_HASH_RIPEMD160 */
-+    "reserved1",/* reserved */
-     "md2",	/* RPM_HASH_MD2 */
-     "tgr192", 	/* RPM_HASH_TIGER192 */
-     "haval5160",/* RPM_HASH_HAVAL_5_160 */
--- 
-2.45.1
-

diff --git a/0001-Hammer-in-no-debuginfo-for-noarch-packages-damn-it-r.patch b/0001-Hammer-in-no-debuginfo-for-noarch-packages-damn-it-r.patch
deleted file mode 100644
index 7ec9b99..0000000
--- a/0001-Hammer-in-no-debuginfo-for-noarch-packages-damn-it-r.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 3a14eb950148514c6d196ab3cefa7a37b82bff64 Mon Sep 17 00:00:00 2001
-From: Panu Matilainen <pmatilai@redhat.com>
-Date: Tue, 28 May 2024 14:03:29 +0300
-Subject: [PATCH] Hammer in "no debuginfo for noarch packages, damn it" rule
-
-All the work we now do to get target platform right gets thrown away by mock
-apparently always passing "--target $(uname -m)" equivalent to rpmbuild,
-causing %_target_cpu and all that stuff be wrong during build scriptlet
-execution. Those are right during the initial spec parse so the old
-implementation just barely scraped through it all.
-
-Hammer in a C-side test based on the package arch to disable debuginfo
-packages on noarch no matter what. Pfft.
-
-Fixes: #3115
----
- build/build.c     |  5 +++++
- tests/rpmbuild.at | 12 ++++++++++++
- 2 files changed, 17 insertions(+)
-
-diff --git a/build/build.c b/build/build.c
-index 0c2d73862..7451c9c22 100644
---- a/build/build.c
-+++ b/build/build.c
-@@ -386,6 +386,11 @@ static int buildSpec(rpmts ts, BTA_t buildArgs, rpmSpec spec, int what)
-     spec->buildTime = getBuildTime();
-     spec->buildHost = buildHost();
- 
-+    /* Don't generate debug packages on noarch no matter what --target says */
-+    const char *arch = headerGetString(spec->packages->header, RPMTAG_ARCH);
-+    if (rstreq(arch, "noarch"))
-+	rpmPushMacro(spec->macros, "_enable_debug_packages", NULL, "0", RMIL_SPEC);
-+
-     /* XXX TODO: rootDir is only relevant during build, eliminate from spec */
-     spec->rootDir = buildArgs->rootdir;
-     if (!spec->recursing && spec->BACount) {
-diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at
-index 2243afcf4..38fe476a3 100644
---- a/tests/rpmbuild.at
-+++ b/tests/rpmbuild.at
-@@ -2343,6 +2343,18 @@ runroot rpmbuild --quiet -bb \
- [0],
- [ignore],
- [ignore])
-+
-+RPMTEST_CHECK([
-+# mock uses --target <hostarch> everywhere, even noarch packages
-+target=$(runroot rpm --eval "%{_host_cpu}")
-+runroot rpmbuild --quiet -bb \
-+		--target ${target} \
-+		--define "%_enable_debug_packages 1" \
-+		/data/SPECS/hlinktest.spec
-+],
-+[0],
-+[ignore],
-+[ignore])
- RPMTEST_CLEANUP
- 
- # ------------------------------
--- 
-2.45.1
-

diff --git a/0001-Improve-_builddir-backwards-compatibility.patch b/0001-Improve-_builddir-backwards-compatibility.patch
deleted file mode 100644
index 8ce28b2..0000000
--- a/0001-Improve-_builddir-backwards-compatibility.patch
+++ /dev/null
@@ -1,142 +0,0 @@
-From 371a0a5aae45c75e56ffd1a268f70afce5624850 Mon Sep 17 00:00:00 2001
-Message-ID: <371a0a5aae45c75e56ffd1a268f70afce5624850.1717998944.git.pmatilai@redhat.com>
-From: Panu Matilainen <pmatilai@redhat.com>
-Date: Fri, 7 Jun 2024 13:38:11 +0300
-Subject: [PATCH] Improve %{_builddir} backwards compatibility
-
-Yet another %{_builddir} related quirk: it's not uncommon for packages
-to do things like this at the top of the spec:
-
-    %global vpath_build %{_builddir}/%{buildsubdir}/vpathbuild
-
-The problem here being use of %global, long before these macros are defined
-at all. If %define was used this was no problem at all, but it only
-works with %global if these macros are either in their final value, or
-not defined at all. And with our new fancy intermediate builddir
-hackery, %{_builddir} is neither, which makes the behavior inconsistent.
-
-%global and %define *are* different and no amount of trickery can (or
-should) make that go away, but as this breaks existing users it's worth
-trying to bend over a bit. So funnily enough, the best fix for this is
-to UNDEFINE %{_builddir} for the initial spec parse stage. Any later
-uses where it actually matters will get re-expanded with the right
-value. Or in other words, lets keep digging the hole, I'm sure we'll
-break through to the other side soon...
-
-Add couple of tests for the expected builddir behaviors
-
-Fixes: #3151
----
- build/parsePreamble.c       |  8 --------
- build/parseSpec.c           | 13 +++++++++++++
- tests/data/SPECS/mydir.spec | 22 ++++++++++++++++++++++
- tests/rpmbuild.at           | 24 ++++++++++++++++++++++++
- 4 files changed, 59 insertions(+), 8 deletions(-)
- create mode 100644 tests/data/SPECS/mydir.spec
-
-diff --git a/build/parsePreamble.c b/build/parsePreamble.c
-index 43812f4f9..20bb3e294 100644
---- a/build/parsePreamble.c
-+++ b/build/parsePreamble.c
-@@ -1286,14 +1286,6 @@ int parsePreamble(rpmSpec spec, int initialPackage, enum parseStages stage)
- 	}
- 
- 	if (!spec->buildDir) {
--	    /* Grab top builddir on first entry as we'll override _builddir */
--	    if (!rpmMacroIsDefined(spec->macros, "_top_builddir")) {
--		char *top_builddir = rpmExpand("%{_builddir}", NULL);
--		rpmPushMacroFlags(spec->macros, "_top_builddir", NULL,
--				top_builddir, RMIL_GLOBAL, RPMMACRO_LITERAL);
--		free(top_builddir);
--	    }
--
- 	    /* Using release here causes a buildid no-recompute test to fail */
- 	    spec->buildDir = rpmExpand("%{_top_builddir}/%{NAME}-%{VERSION}-build", NULL);
- 	    /* Override toplevel _builddir for backwards compatibility */
-diff --git a/build/parseSpec.c b/build/parseSpec.c
-index 440cb0b1b..fd822499b 100644
---- a/build/parseSpec.c
-+++ b/build/parseSpec.c
-@@ -1298,6 +1298,19 @@ static rpmSpec parseSpec(const char *specFile, rpmSpecFlags flags,
-     /* If explicit --buildroot was passed, grab hold of it */
-     if (buildRoot)
- 	spec->buildRoot = xstrdup(buildRoot);
-+
-+    /* Grab top builddir on first entry as we'll override _builddir */
-+    if (!rpmMacroIsDefined(spec->macros, "_top_builddir")) {
-+	char *top_builddir = rpmExpand("%{_builddir}", NULL);
-+	rpmPushMacroFlags(spec->macros, "_top_builddir", NULL,
-+			top_builddir, RMIL_GLOBAL, RPMMACRO_LITERAL);
-+
-+	/* Undefine (!!) %_builddir so %global misuses fall through */
-+	while (rpmMacroIsDefined(spec->macros, "_builddir"))
-+	    rpmPopMacro(spec->macros, "_builddir");
-+	free(top_builddir);
-+    }
-+
-     rpmPushMacro(NULL, "_docdir", NULL, "%{_defaultdocdir}", RMIL_SPEC);
-     rpmPushMacro(NULL, "_licensedir", NULL, "%{_defaultlicensedir}", RMIL_SPEC);
-     spec->recursing = recursing;
-diff --git a/tests/data/SPECS/mydir.spec b/tests/data/SPECS/mydir.spec
-new file mode 100644
-index 000000000..130aba29e
---- /dev/null
-+++ b/tests/data/SPECS/mydir.spec
-@@ -0,0 +1,22 @@
-+# these *are* different but %%global is widely misused, it only works
-+# because rpm lets the undefined macros pass for later expansion
-+%global mydir1 %{_builddir}/%{buildsubdir}
-+%define mydir2 %{_builddir}/%{buildsubdir}
-+
-+Name: mydir
-+Version: 1.0
-+Release: 1
-+BuildArch: noarch
-+Summary: Test builddir oddities
-+License: GPL
-+
-+%prep
-+%setup -T -c
-+
-+%build
-+echo mydir1=%{mydir1}
-+echo mydir2=%{mydir2}
-+
-+%install
-+
-+%files
-diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at
-index 8205722d5..a33195dc4 100644
---- a/tests/rpmbuild.at
-+++ b/tests/rpmbuild.at
-@@ -3328,3 +3328,27 @@ runroot rpm -qpl /build/RPMS/noarch/brtest-1.0-1.noarch.rpm
- ],
- [])
- RPMTEST_CLEANUP
-+
-+AT_SETUP([builddir])
-+AT_KEYWORDS([build builddir])
-+
-+RPMDB_INIT
-+# Trick for compatibly getting the builddir out of old and new rpm
-+RPMTEST_CHECK([
-+runroot rpmbuild -bc --short-circuit --define '__spec_build_pre echo builddir=%{_builddir}; exit 0' /data/SPECS/hello.spec | awk /^builddir/
-+],
-+[0],
-+[builddir=/build/BUILD/hello-1.0-build
-+],
-+[])
-+
-+# Test for %{_builddir} related %global misuse workaround
-+RPMTEST_CHECK([
-+runroot rpmbuild -bc /data/SPECS/mydir.spec 2>&1 | awk /^mydir/
-+],
-+[0],
-+[mydir1=/build/BUILD/mydir-1.0-build/mydir-1.0
-+mydir2=/build/BUILD/mydir-1.0-build/mydir-1.0
-+],
-+[])
-+RPMTEST_CLEANUP
--- 
-2.45.1
-

diff --git a/0001-Minimally-bring-back-buildroot-cli-switch-for-cpack.patch b/0001-Minimally-bring-back-buildroot-cli-switch-for-cpack.patch
deleted file mode 100644
index b0ba253..0000000
--- a/0001-Minimally-bring-back-buildroot-cli-switch-for-cpack.patch
+++ /dev/null
@@ -1,237 +0,0 @@
-From 996b3ac32d244094c1d3a875d7098d459bb36c71 Mon Sep 17 00:00:00 2001
-Message-ID: <996b3ac32d244094c1d3a875d7098d459bb36c71.1717480260.git.pmatilai@redhat.com>
-From: Panu Matilainen <pmatilai@redhat.com>
-Date: Mon, 3 Jun 2024 11:59:29 +0300
-Subject: [PATCH 1/3] Minimally bring back --buildroot cli switch for cpack
-
-Turns out cmake's cpack rpm module is using --buildroot to preinstall
-content to a known location and then point a dummy rpmbuild spec to
-that location using --buildroot.
-
-This is not how rpmbuild wants to be used but we can't very well break cpack
-(and who knows what else may be using it) just like that, commit
-9d35c8df497534e1fbd806a4dc78802bcf35d7cb went a step too far with the
-buildroot elimination.
-
-Do a partial revert of 9d35c8df497534e1fbd806a4dc78802bcf35d7cb to
-honor buildRoot argument to rpmSpecParse() again and bring back
---buildroot cli switch to set it, just enough to cover this usage. Also
-add a test-case to mimick the "install from the outside" use that cpack does.
----
- build/parsePreamble.c        | 20 ++++++++++++++++----
- build/parseSpec.c            | 12 +++++++-----
- docs/man/rpmbuild.8.md       |  7 ++++---
- include/rpm/rpmbuild.h       |  2 +-
- tests/data/SPECS/brtest.spec | 11 +++++++++++
- tests/rpmbuild.at            | 25 +++++++++++++++++++++++++
- tools/rpmbuild.c             | 10 ++++++++++
- 7 files changed, 74 insertions(+), 13 deletions(-)
- create mode 100644 tests/data/SPECS/brtest.spec
-
-diff --git a/build/parsePreamble.c b/build/parsePreamble.c
-index cae2cea07..f62004ba0 100644
---- a/build/parsePreamble.c
-+++ b/build/parsePreamble.c
-@@ -1304,15 +1304,27 @@ int parsePreamble(rpmSpec spec, int initialPackage, enum parseStages stage)
- 	    rpmPushMacroFlags(spec->macros, "builddir", NULL, spec->buildDir,
- 				RMIL_SPEC, RPMMACRO_LITERAL);
- 
--	    spec->buildRoot = rpmGetPath(spec->buildDir, "/BUILDROOT", NULL);
--	    rpmPushMacroFlags(spec->macros, "buildroot", NULL, spec->buildRoot,
--				RMIL_SPEC, RPMMACRO_LITERAL);
--
- 	    char *specparts = rpmGetPath(spec->buildDir, "/SPECPARTS", NULL);
- 	    rpmPushMacroFlags(spec->macros, "specpartsdir", NULL, specparts,
- 				RMIL_SPEC, RPMMACRO_LITERAL);
- 	    free(specparts);
- 	}
-+
-+	if (!spec->buildRoot) {
-+	    spec->buildRoot = rpmGetPath(spec->buildDir, "/BUILDROOT", NULL);
-+	} else {
-+	    char *buildRoot = rpmGetPath(spec->buildRoot, NULL);
-+	    free(spec->buildRoot);
-+	    spec->buildRoot = buildRoot;
-+	}
-+
-+	if (rstreq(spec->buildRoot, "") || rstreq(spec->buildRoot, "/")) {
-+	    rpmlog(RPMLOG_ERR, _("Invalid buildroot: '%s'\n"), spec->buildRoot);
-+	    goto exit;
-+	}
-+
-+	rpmPushMacroFlags(spec->macros, "buildroot", NULL, spec->buildRoot,
-+			    RMIL_SPEC, RPMMACRO_LITERAL);
-     }
- 
-     /* if we get down here nextPart has been set to non-error */
-diff --git a/build/parseSpec.c b/build/parseSpec.c
-index 620da0fa5..440cb0b1b 100644
---- a/build/parseSpec.c
-+++ b/build/parseSpec.c
-@@ -1068,7 +1068,7 @@ static rpmRC applyAppendPrepend(rpmSpec spec)
- }
- 
- static rpmSpec parseSpec(const char *specFile, rpmSpecFlags flags,
--			 int recursing);
-+			 const char *buildRoot, int recursing);
- 
- /* is part allowed at this stage */
- static int checkPart(int parsePart, enum parseStages stage) {
-@@ -1216,7 +1216,7 @@ static rpmRC parseSpecSection(rpmSpec *specptr, enum parseStages stage)
- 		if (!rpmMachineScore(RPM_MACHTABLE_BUILDARCH, spec->BANames[x]))
- 		    continue;
- 		rpmPushMacro(NULL, "_target_cpu", NULL, spec->BANames[x], RMIL_RPMRC);
--		spec->BASpecs[index] = parseSpec(spec->specFile, spec->flags, 1);
-+		spec->BASpecs[index] = parseSpec(spec->specFile, spec->flags, spec->buildRoot, 1);
- 		if (spec->BASpecs[index] == NULL) {
- 			spec->BACount = index;
- 			goto errxit;
-@@ -1286,7 +1286,7 @@ errxit:
- 
- 
- static rpmSpec parseSpec(const char *specFile, rpmSpecFlags flags,
--			 int recursing)
-+			 const char *buildRoot, int recursing)
- {
-     rpmSpec spec;
- 
-@@ -1295,7 +1295,9 @@ static rpmSpec parseSpec(const char *specFile, rpmSpecFlags flags,
- 
-     spec->specFile = rpmGetPath(specFile, NULL);
-     pushOFI(spec, spec->specFile);
--
-+    /* If explicit --buildroot was passed, grab hold of it */
-+    if (buildRoot)
-+	spec->buildRoot = xstrdup(buildRoot);
-     rpmPushMacro(NULL, "_docdir", NULL, "%{_defaultdocdir}", RMIL_SPEC);
-     rpmPushMacro(NULL, "_licensedir", NULL, "%{_defaultlicensedir}", RMIL_SPEC);
-     spec->recursing = recursing;
-@@ -1378,7 +1380,7 @@ static rpmRC finalizeSpec(rpmSpec spec)
- rpmSpec rpmSpecParse(const char *specFile, rpmSpecFlags flags,
- 		     const char *buildRoot)
- {
--    rpmSpec spec = parseSpec(specFile, flags, 0);
-+    rpmSpec spec = parseSpec(specFile, flags, buildRoot, 0);
-     if (spec && !(flags & RPMSPEC_NOFINALIZE)) {
- 	finalizeSpec(spec);
-     }
-diff --git a/docs/man/rpmbuild.8.md b/docs/man/rpmbuild.8.md
-index 8c06a7712..bfd202751 100644
---- a/docs/man/rpmbuild.8.md
-+++ b/docs/man/rpmbuild.8.md
-@@ -211,10 +211,11 @@ all the stages preceding it), and is one of:
- 
- The following options may also be used:
- 
--**\--buildroot ***DIRECTORY*
-+**\--buildroot ***DIRECTORY* (DEPRECATED)
- 
--:   When building a package, override the BuildRoot tag with directory
--    *DIRECTORY*.
-+:   When building a package, override rpm's buildroot to *DIRECTORY*.
-+    This option is deprecated and will be removed in the future, do
-+    not introduce new usages.
- 
- **\--clean**
- 
-diff --git a/include/rpm/rpmbuild.h b/include/rpm/rpmbuild.h
-index 8baafdf45..23f037d6e 100644
---- a/include/rpm/rpmbuild.h
-+++ b/include/rpm/rpmbuild.h
-@@ -78,7 +78,7 @@ typedef	struct rpmBuildArguments_s *	BTA_t;
-  *
-  * @param specFile	path to spec file
-  * @param flags		flags to control operation
-- * @param buildRoot	unused
-+ * @param buildRoot	buildRoot override or NULL for default
-  * @return		new spec control structure
-  */
- rpmSpec rpmSpecParse(const char *specFile, rpmSpecFlags flags,
-diff --git a/tests/data/SPECS/brtest.spec b/tests/data/SPECS/brtest.spec
-new file mode 100644
-index 000000000..cde4d80e0
---- /dev/null
-+++ b/tests/data/SPECS/brtest.spec
-@@ -0,0 +1,11 @@
-+Summary:          Testing buildroot behavior
-+Name:             brtest
-+Version:          1.0
-+Release:          1
-+License:          GPL
-+BuildArch:	noarch
-+
-+%description
-+
-+%files
-+/out/sider
-diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at
-index a77ceeca4..19998012d 100644
---- a/tests/rpmbuild.at
-+++ b/tests/rpmbuild.at
-@@ -3289,3 +3289,28 @@ runroot rpmbuild -bb /data/SPECS/install-hack.spec
- [ignore])
- RPMTEST_CLEANUP
- 
-+# Mimick what cpack does. It's not how rpmbuild wants to be used, so
-+# please don't copy this to any new usages.
-+AT_SETUP([rpmbuild --buildroot])
-+AT_KEYWORDS([build])
-+
-+RPMDB_INIT
-+RPMTEST_CHECK([
-+runroot_other mkdir -p /tmp/buildroot/out
-+runroot_other touch /tmp/buildroot/out/sider
-+runroot rpmbuild -bb --quiet \
-+	--buildroot /tmp/buildroot \
-+	/data/SPECS/brtest.spec
-+],
-+[0],
-+[],
-+[])
-+
-+RPMTEST_CHECK([
-+runroot rpm -qpl /build/RPMS/noarch/brtest-1.0-1.noarch.rpm
-+],
-+[0],
-+[/out/sider
-+],
-+[])
-+RPMTEST_CLEANUP
-diff --git a/tools/rpmbuild.c b/tools/rpmbuild.c
-index 6e6d2cfe4..3e736444c 100644
---- a/tools/rpmbuild.c
-+++ b/tools/rpmbuild.c
-@@ -21,6 +21,7 @@ static struct rpmBuildArguments_s rpmBTArgs;
- #define	POPT_NOLANG		-1012
- #define	POPT_RMSOURCE		-1013
- #define	POPT_RMBUILD		-1014
-+#define	POPT_BUILDROOT		-1015
- #define	POPT_TARGETPLATFORM	-1016
- #define	POPT_NOBUILD		-1017
- #define	POPT_RMSPEC		-1019
-@@ -127,6 +128,13 @@ static void buildArgCallback( poptContext con,
-     case POPT_RMSOURCE: rba->buildAmount |= RPMBUILD_RMSOURCE; break;
-     case POPT_RMSPEC: rba->buildAmount |= RPMBUILD_RMSPEC; break;
-     case POPT_RMBUILD: rba->buildAmount |= RPMBUILD_RMBUILD; break;
-+    case POPT_BUILDROOT:
-+	if (rba->buildRootOverride) {
-+	    rpmlog(RPMLOG_ERR, _("buildroot already specified, ignoring %s\n"), arg);
-+	    break;
-+	}
-+	rba->buildRootOverride = xstrdup(arg);
-+	break;
-     case POPT_TARGETPLATFORM:
- 	argvSplit(&build_targets, arg, ",");
- 	break;
-@@ -246,6 +254,8 @@ static struct poptOption rpmBuildPoptTable[] = {
- 	N_("build through %install (%prep, %build, then install) from <source package>"),
- 	N_("<source package>") },
- 
-+ { "buildroot", '\0', POPT_ARG_STRING, 0,  POPT_BUILDROOT,
-+	N_("override build root (DEPRECATED)"), "DIRECTORY" },
-  { "build-in-place", '\0', 0, 0, POPT_BUILDINPLACE,
- 	N_("run build in current directory"), NULL },
-  { "clean", '\0', 0, 0, POPT_RMBUILD,
--- 
-2.45.1
-

diff --git a/0002-Drop-an-accidentally-added-duplicated-test.patch b/0002-Drop-an-accidentally-added-duplicated-test.patch
deleted file mode 100644
index 103dfe3..0000000
--- a/0002-Drop-an-accidentally-added-duplicated-test.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 31758e51cd60a7eb33b7280e0f9efee767455d4d Mon Sep 17 00:00:00 2001
-From: Panu Matilainen <pmatilai@redhat.com>
-Date: Thu, 23 May 2024 07:48:53 +0300
-Subject: [PATCH 2/3] Drop an accidentally added duplicated test
-
-Commit a68a2e50578347384bb2f1b08314d8bf7026b9bc added the same test
-twice, hardly intentionally.
----
- tests/rpmbuild.at | 16 ----------------
- 1 file changed, 16 deletions(-)
-
-diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at
-index a060abe1f..7e4b088aa 100644
---- a/tests/rpmbuild.at
-+++ b/tests/rpmbuild.at
-@@ -2311,22 +2311,6 @@ runroot rpmbuild \
- )
- RPMTEST_CLEANUP
- 
--# Test that -br creates an src.rpm on success
--AT_SETUP([rpmbuild -br success])
--AT_KEYWORDS([build])
--RPMTEST_CHECK([
--RPMDB_INIT
--
--runroot rpmbuild \
--  -br  /data/SPECS/mini.spec
--],
--[0],
--[Wrote: /build/SRPMS/mini-1-1.src.rpm
--],
--[],
--)
--RPMTEST_CLEANUP
--
- # ------------------------------
- # Check dynamic build requires
- AT_SETUP([rpmbuild -bd with errors])
--- 
-2.45.1
-

diff --git a/0002-Minimally-bring-back-_buildrootdir-for-backwards-com.patch b/0002-Minimally-bring-back-_buildrootdir-for-backwards-com.patch
deleted file mode 100644
index fd0dda8..0000000
--- a/0002-Minimally-bring-back-_buildrootdir-for-backwards-com.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 67f6bc4d9501b3db43b983ef25813a4cef8bf701 Mon Sep 17 00:00:00 2001
-Message-ID: <67f6bc4d9501b3db43b983ef25813a4cef8bf701.1717480260.git.pmatilai@redhat.com>
-In-Reply-To: <996b3ac32d244094c1d3a875d7098d459bb36c71.1717480260.git.pmatilai@redhat.com>
-References: <996b3ac32d244094c1d3a875d7098d459bb36c71.1717480260.git.pmatilai@redhat.com>
-From: Panu Matilainen <pmatilai@redhat.com>
-Date: Mon, 3 Jun 2024 13:24:32 +0300
-Subject: [PATCH 2/3] Minimally bring back %{_buildrootdir} for backwards
- compatibility
-
-This is yet another thing that specs use for purposes they shouldn't,
-in the traditional setup they don't own the top %{_buildrootdir} directory
-any more than they own %{_builddir}.
-
-We don't want people to muck with the %{_buildrootdir} but what we can
-do is just define it to be the dirname of %{buildroot}. This way in
-normal use, %{_buildrootdir} equals %{builddir} which is again a safe
-place for packages to fiddle around, and also works with --buildroot.
-
-Like %buildroot itself, this is now only ever defined inside a build,
-because that's the only place where it's relevant and meaningfully
-defineable.
----
- build/parsePreamble.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/build/parsePreamble.c b/build/parsePreamble.c
-index f62004ba0..43812f4f9 100644
---- a/build/parsePreamble.c
-+++ b/build/parsePreamble.c
-@@ -1325,6 +1325,10 @@ int parsePreamble(rpmSpec spec, int initialPackage, enum parseStages stage)
- 
- 	rpmPushMacroFlags(spec->macros, "buildroot", NULL, spec->buildRoot,
- 			    RMIL_SPEC, RPMMACRO_LITERAL);
-+
-+	/* Silly compat thing, but many specs use %_buildrootdir */
-+	rpmPushMacroFlags(spec->macros, "_buildrootdir", NULL,
-+			    "%{dirname:%{buildroot}}", RMIL_GLOBAL, 0);
-     }
- 
-     /* if we get down here nextPart has been set to non-error */
--- 
-2.45.1
-

diff --git a/0003-Make-build-in-place-much-less-of-a-hack-and-also-wor.patch b/0003-Make-build-in-place-much-less-of-a-hack-and-also-wor.patch
deleted file mode 100644
index 09c6fe1..0000000
--- a/0003-Make-build-in-place-much-less-of-a-hack-and-also-wor.patch
+++ /dev/null
@@ -1,172 +0,0 @@
-From d1075106bb315913574e1acac921058d23dd5130 Mon Sep 17 00:00:00 2001
-From: Panu Matilainen <pmatilai@redhat.com>
-Date: Thu, 23 May 2024 10:22:15 +0300
-Subject: [PATCH 3/3] Make --build-in-place much less of a hack and also, work
-
-Instead of skipping everything in %setup, take advantage of it:
-we shouldn't unpack any sources but otherwise we can just let it
-fall through it, defining buildsubdir and everything, if we let
-rpm do its normal %mkbuilddir thing and just symlink to the in-place
-tree from rpm's %builddir. This way it's not such an ugly duckling
-interfering with how normal rpms are built, and even honors %setup
-flags to a degree.
-
-This fixes two regressions: one introduced when adding %mkbuilddir that
-nukes your current directory with no questions asked if --build-in-place
-is used before it even starts, and an earlier one from commit
-b34333fa021c0ee7215714eeef96d1a2843ea08e that would nuke your precious
-in-place directory afterwards. And as a side-effect of all this, debuginfo
-generation also now works with --build-in-place.
-
-Fixes: #3122
-Fixes: #3042
----
- build/parsePrep.c | 17 ++++++++++-----
- tests/rpmbuild.at | 55 +++++++++++++++++++++++++++++++++++++++++++++++
- tools/rpmbuild.c  |  8 +------
- 3 files changed, 68 insertions(+), 12 deletions(-)
-
-diff --git a/build/parsePrep.c b/build/parsePrep.c
-index 4754827f5..6aa692d40 100644
---- a/build/parsePrep.c
-+++ b/build/parsePrep.c
-@@ -171,6 +171,7 @@ void doSetupMacro(rpmMacroBuf mb, rpmMacroEntry me, ARGV_t margs, size_t *parsed
-     int leaveDirs = 0, skipDefaultAction = 0;
-     int createDir = 0, quietly = 0, autoPath = 0;
-     char * dirName = NULL;
-+    int buildInPlace = rpmExpandNumeric("%{?_build_in_place}");
-     struct poptOption optionsTable[] = {
- 	    { NULL, 'a', POPT_ARG_STRING, NULL, 'a',	NULL, NULL},
- 	    { NULL, 'b', POPT_ARG_STRING, NULL, 'b',	NULL, NULL},
-@@ -190,10 +191,6 @@ void doSetupMacro(rpmMacroBuf mb, rpmMacroEntry me, ARGV_t margs, size_t *parsed
- 	goto exit;
-     }
- 
--    if (rpmExpandNumeric("%{_build_in_place}")) {
--	goto exit;
--    }
--
-     optCon = poptGetContext(NULL, argc, argv, optionsTable, 0);
-     while ((arg = poptGetNextOpt(optCon)) > 0) {
- 	char *optArg = poptGetOptArg(optCon);
-@@ -206,7 +203,8 @@ void doSetupMacro(rpmMacroBuf mb, rpmMacroEntry me, ARGV_t margs, size_t *parsed
- 	    goto exit;
- 	}
- 
--	{   char *chptr = doUntar(spec, num, quietly, 0);
-+	if (!buildInPlace) {
-+	    char *chptr = doUntar(spec, num, quietly, 0);
- 	    if (chptr == NULL)
- 		goto exit;
- 
-@@ -235,6 +233,15 @@ void doSetupMacro(rpmMacroBuf mb, rpmMacroEntry me, ARGV_t margs, size_t *parsed
- 	free(buildSubdir);
-     }
-     
-+    if (buildInPlace) {
-+	skipDefaultAction = 1;
-+	leaveDirs = 1;
-+	/* note that pwd needs to be from parse, not build time */
-+	char *buf = rpmExpand("ln -s %(pwd) %{buildsubdir}", NULL);
-+	appendMb(mb, buf, 1);
-+	free(buf);
-+    }
-+
-     /* cd to the build dir */
-     {	char * buildDir = rpmGenPath(spec->rootDir, "%{_builddir}", "");
- 
-diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at
-index 7e4b088aa..a665a6bce 100644
---- a/tests/rpmbuild.at
-+++ b/tests/rpmbuild.at
-@@ -321,6 +321,61 @@ run rpmbuild \
- [ignore])
- RPMTEST_CLEANUP
- 
-+AT_SETUP([rpmbuild --build-in-place])
-+AT_KEYWORDS([build])
-+RPMDB_INIT
-+
-+RPMTEST_CHECK([
-+runroot_other tar xf /data/SOURCES/hello-2.0.tar.gz
-+runroot_other mv hello-2.0/hello.spec .
-+runroot_other find hello-2.0 | sort
-+],
-+[0],
-+[hello-2.0
-+hello-2.0/COPYING
-+hello-2.0/FAQ
-+hello-2.0/Makefile
-+hello-2.0/README
-+hello-2.0/hello.c
-+],
-+[])
-+
-+RPMTEST_CHECK([
-+runroot --chdir hello-2.0 rpmbuild -bb --build-in-place ../hello.spec
-+],
-+[0],
-+[ignore],
-+[ignore])
-+
-+RPMTEST_CHECK([
-+runroot rpm -qp --qf "%{name}-%{version}-%{release}\n" /build/RPMS/*/*.rpm
-+],
-+[0],
-+[hello-2.0-1
-+hello-debuginfo-2.0-1
-+],
-+[])
-+
-+# finally, see that we left the tree intact 
-+RPMTEST_CHECK([
-+runroot_other find hello-2.0 | sort
-+],
-+[0],
-+[hello-2.0
-+hello-2.0/COPYING
-+hello-2.0/FAQ
-+hello-2.0/Makefile
-+hello-2.0/README
-+hello-2.0/debugfiles.list
-+hello-2.0/debuglinks.list
-+hello-2.0/debugsources.list
-+hello-2.0/elfbins.list
-+hello-2.0/hello
-+hello-2.0/hello.c
-+],
-+[])
-+RPMTEST_CLEANUP
-+
- AT_SETUP([rpmbuild with %autosetup -C])
- AT_KEYWORDS([build])
- RPMDB_INIT
-diff --git a/tools/rpmbuild.c b/tools/rpmbuild.c
-index 459427fe3..dd36e24d8 100644
---- a/tools/rpmbuild.c
-+++ b/tools/rpmbuild.c
-@@ -136,6 +136,7 @@ static void buildArgCallback( poptContext con,
-     case POPT_BUILDINPLACE:
- 	rpmDefineMacro(NULL, "_build_in_place 1", 0);
- 	buildInPlace = 1;
-+	nobuildAmount |= RPMBUILD_RMBUILD;
- 	break;
-     }
- }
-@@ -432,13 +433,6 @@ static int buildForTarget(rpmts ts, const char * arg, BTA_t ba,
-     int rc = 1; /* assume failure */
-     rpmSpecFlags specFlags = spec_flags;
- 
--    /* Override default BUILD value for _builddir */
--    if (buildInPlace) {
--	char *cwd = rpmGetCwd();
--	rpmPushMacro(NULL, "_builddir", NULL, cwd, 0);
--	free(cwd);
--    }
--
-     if (ba->buildRootOverride)
- 	buildRootURL = rpmGenPath(NULL, ba->buildRootOverride, NULL);
- 
--- 
-2.45.1
-

diff --git a/0003-Require-buildsubdir-to-be-defined-to-get-debuginfo-p.patch b/0003-Require-buildsubdir-to-be-defined-to-get-debuginfo-p.patch
deleted file mode 100644
index 6ee467a..0000000
--- a/0003-Require-buildsubdir-to-be-defined-to-get-debuginfo-p.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-From 71e71c7b9a1100560f2f0541c83a0929425f5197 Mon Sep 17 00:00:00 2001
-Message-ID: <71e71c7b9a1100560f2f0541c83a0929425f5197.1717480260.git.pmatilai@redhat.com>
-In-Reply-To: <996b3ac32d244094c1d3a875d7098d459bb36c71.1717480260.git.pmatilai@redhat.com>
-References: <996b3ac32d244094c1d3a875d7098d459bb36c71.1717480260.git.pmatilai@redhat.com>
-From: Panu Matilainen <pmatilai@redhat.com>
-Date: Mon, 3 Jun 2024 16:31:05 +0300
-Subject: [PATCH 3/3] Require %{buildsubdir} to be defined to get debuginfo
- packages again
-
-One of the intentions with the debuginfo enablement rework in 4.20
-was to allow debuginfo generation on packages that don't use %setup,
-or in other words, don't have %{buildsubdir} defined. Turns out there's
-just so many things out there, relying on all these exact bits and pieces
-to be JUST SO, this causes more harm than its worth.
-
-So bring back the requirement of %{buildsubdir} macro to be defined for
-debuginfo generation to take place, update the caps testcase to cover
-both. At least we can now just define buildsubdir from the spec or even
-command line, so the promise to have debuginfo without %setup still
-holds, it's just not automatic everywhere.
----
- platform.in       |  2 +-
- tests/rpmbuild.at | 16 +++++++++++++++-
- 2 files changed, 16 insertions(+), 2 deletions(-)
-
-diff --git a/platform.in b/platform.in
-index 7ff4a29cd..2e7c6b50a 100644
---- a/platform.in
-+++ b/platform.in
-@@ -59,7 +59,7 @@
- 
- %__spec_install_template\
- %{__spec_install_pre}\
--%[ 0%{?_enable_debug_packages} > 0 ? "%(echo "%{debug_package}" > %{specpartsdir}/rpm-debuginfo.specpart)" : "" ]\
-+%[ 0%{?_enable_debug_packages} > 0 ? "%{?buildsubdir:%(echo "%{debug_package}" > %{specpartsdir}/rpm-debuginfo.specpart)}" : "" ]\
- %{nil}
- 
- %__spec_install_pre %{___build_pre}\
-diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at
-index 19998012d..8205722d5 100644
---- a/tests/rpmbuild.at
-+++ b/tests/rpmbuild.at
-@@ -3173,10 +3173,24 @@ runroot rpm -qp --qf "%{name}\n" /build/RPMS/*/*.rpm|sort
- ],
- [0],
- [caps
--caps-debuginfo
- ],
- [])
- 
-+RPMTEST_CHECK([
-+runroot rpmbuild --quiet -bb --define "buildsubdir ." /data/SPECS/caps.spec
-+],
-+[0],
-+[],
-+[])
-+
-+RPMTEST_CHECK([
-+runroot rpm -qp --qf "%{name}\n" /build/RPMS/*/*.rpm|sort
-+],
-+[0],
-+[caps
-+caps-debuginfo
-+],
-+[])
- RPMTEST_CHECK([
- runroot rpm -q --filecaps /build/RPMS/*/caps-1.0-1.*.rpm | grep -v build-id
- ],
--- 
-2.45.1
-

diff --git a/rpm.spec b/rpm.spec
index efc2e6a..32e3659 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -25,9 +25,9 @@
 
 %define rpmhome /usr/lib/rpm
 
-%global rpmver 4.19.91
+%global rpmver 4.19.92
 #global snapver rc1
-%global baserelease 13
+%global baserelease 1
 %global sover 10
 
 %global srcver %{rpmver}%{?snapver:-%{snapver}}
@@ -148,21 +148,6 @@ rpm-4.19.91-weak-user-group.patch
 0001-Revert-Add-a-deprecation-warning-for-clamp_mtime_to_.patch
 
 # Patches already upstream:
-0001-Ensure-noarch-packages-don-t-get-debuginfo.patch
-0001-Fix-noprep-regression-from-introducing-mkbuilddir.patch
-0002-Drop-an-accidentally-added-duplicated-test.patch
-0003-Make-build-in-place-much-less-of-a-hack-and-also-wor.patch
-0001-Fix-incomplete-header-on-plain-src.rpm-build-modes-r.patch
-0001-Hammer-in-no-debuginfo-for-noarch-packages-damn-it-r.patch
-0001-Fix-regression-on-subpackage-debuginfo-RPMTAG_SOURCE.patch
-0001-Fix-a-buildroot-regression-on-an-early-__spec_instal.patch
-0001-Minimally-bring-back-buildroot-cli-switch-for-cpack.patch
-0002-Minimally-bring-back-_buildrootdir-for-backwards-com.patch
-0003-Require-buildsubdir-to-be-defined-to-get-debuginfo-p.patch
-0001-Always-clear-the-RPMEXPAND_KEEP_QUOTED-flag-if-we-do.patch
-0001-Improve-_builddir-backwards-compatibility.patch
-0001-Fix-signfiles-regression-from-13a02b15d6552bc8e44023.patch
-0001-Avoid-special-characters-from-VERSION-in-builddir.patch
 
 # These are not yet upstream
 rpm-4.7.1-geode-i686.patch
@@ -665,6 +650,9 @@ fi
 %doc %{_defaultdocdir}/rpm/API/
 
 %changelog
+* Mon Jun 24 2024 Panu Matilainen <pmatilai@redhat.com> - 4.19.92-1
+- Rebase to 4.20 beta1
+
 * Wed Jun 12 2024 Panu Matilainen <pmatilai@redhat.com> - 4.19.91-13
 - Avoid tilde and caret in the builddir path (#2290987)
 

diff --git a/sources b/sources
index fcf335a..0639403 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (rpm-4.19.91.tar.bz2) = 4364b0eafbf8f71c42541b3db9c5f67fdcbd08ac30ab51f3c9169e2b3442095190e7bcd33c6d6650b08461b7879ccdf6e8712afacd36c0e6b99ba9cf9213cd51
+SHA512 (rpm-4.19.92.tar.bz2) = ad9ca56eb268da2cd234a5dfc201bba41d00d583bf2ded34f51e28db3cb18cdfb83750ca49152b7d890729ed42ea474a38b66f5b28bec5177e5c808c16d6eeec

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-23  9:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-23  9:35 [rpms/rpm] pmatilai-v6: Rebase to rpm 4.20 beta1 Panu Matilainen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox