2022-04-26 08:20:13 +00:00
|
|
|
From feeeca5148ceadba5fa0af13bfabda0b716566d5 Mon Sep 17 00:00:00 2001
|
|
|
|
Message-Id: <feeeca5148ceadba5fa0af13bfabda0b716566d5.1650961200.git.pmatilai@redhat.com>
|
2022-04-26 08:07:48 +00:00
|
|
|
From: Panu Matilainen <pmatilai@redhat.com>
|
|
|
|
Date: Tue, 26 Apr 2022 11:00:41 +0300
|
|
|
|
Subject: [PATCH] Fix rpmbuild -br not building .src.rpm regression
|
|
|
|
(RhBug:2078744)
|
|
|
|
|
|
|
|
Successful rpmbuild -br needs to produce an src.rpm, this was untested
|
|
|
|
in the testsuite and commit ad8b9bd2ca93cf4319680f056bb40bfc24661991
|
|
|
|
missed this twist in the logic. Fixing is an obvious one-liner now,
|
|
|
|
add a test to ensure it doesn't happen again.
|
|
|
|
---
|
2022-04-26 08:20:13 +00:00
|
|
|
rpmbuild.c | 4 ++++
|
2022-04-26 08:07:48 +00:00
|
|
|
tests/rpmbuild.at | 16 ++++++++++++++++
|
2022-04-26 08:20:13 +00:00
|
|
|
2 files changed, 20 insertions(+)
|
2022-04-26 08:07:48 +00:00
|
|
|
|
|
|
|
diff --git a/rpmbuild.c b/rpmbuild.c
|
2022-04-26 08:20:13 +00:00
|
|
|
index de78976ff..da3810f75 100644
|
2022-04-26 08:07:48 +00:00
|
|
|
--- a/rpmbuild.c
|
|
|
|
+++ b/rpmbuild.c
|
2022-04-26 08:20:13 +00:00
|
|
|
@@ -667,6 +667,10 @@ int main(int argc, char *argv[])
|
2022-04-26 08:07:48 +00:00
|
|
|
break;
|
|
|
|
/* fallthrough */
|
|
|
|
case 'r':
|
2022-04-26 08:20:13 +00:00
|
|
|
+ /* build src.rpm only on explicit -br */
|
|
|
|
+ if (buildChar == 'r')
|
|
|
|
+ ba->buildAmount |= RPMBUILD_PACKAGESOURCE;
|
2022-04-26 08:07:48 +00:00
|
|
|
+ /* fallthrough */
|
|
|
|
case 'd':
|
|
|
|
ba->buildAmount |= RPMBUILD_BUILDREQUIRES;
|
|
|
|
ba->buildAmount |= RPMBUILD_DUMPBUILDREQUIRES;
|
|
|
|
diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at
|
|
|
|
index b7bd0d7f0..8746fa501 100644
|
|
|
|
--- a/tests/rpmbuild.at
|
|
|
|
+++ b/tests/rpmbuild.at
|
|
|
|
@@ -1707,6 +1707,22 @@ runroot rpmbuild \
|
|
|
|
)
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
+# Test that -br creates an src.rpm on success
|
|
|
|
+AT_SETUP([rpmbuild -br success])
|
|
|
|
+AT_KEYWORDS([build])
|
|
|
|
+AT_CHECK([
|
|
|
|
+RPMDB_INIT
|
|
|
|
+
|
|
|
|
+runroot rpmbuild \
|
|
|
|
+ -br /data/SPECS/mini.spec
|
|
|
|
+],
|
|
|
|
+[0],
|
|
|
|
+[Wrote: /build/SRPMS/mini-1-1.src.rpm
|
|
|
|
+],
|
|
|
|
+[],
|
|
|
|
+)
|
|
|
|
+AT_CLEANUP
|
|
|
|
+
|
|
|
|
# ------------------------------
|
|
|
|
# Check dynamic build requires
|
|
|
|
AT_SETUP([rpmbuild -bd with errors])
|
|
|
|
--
|
|
|
|
2.35.1
|
|
|
|
|