|
Panu Matilainen |
2f2f9e |
From 0aedb84b3c6535b0befb2cc64912645d927b9dfd Mon Sep 17 00:00:00 2001
|
|
Panu Matilainen |
2f2f9e |
Message-Id: <0aedb84b3c6535b0befb2cc64912645d927b9dfd.1650986658.git.pmatilai@redhat.com>
|
|
Panu Matilainen |
2f2f9e |
From: Panu Matilainen <pmatilai@redhat.com>
|
|
Panu Matilainen |
2f2f9e |
Date: Tue, 26 Apr 2022 18:08:14 +0300
|
|
Panu Matilainen |
2f2f9e |
Subject: [PATCH] Fix regressions on dynamic buildrequires cli switches
|
|
Panu Matilainen |
2f2f9e |
(RhBug:2078744)
|
|
Panu Matilainen |
2f2f9e |
|
|
Panu Matilainen |
2f2f9e |
This effectively reverts commits b8935fb23518e26aa7b9316d27f2565813d20291
|
|
Panu Matilainen |
2f2f9e |
and ad8b9bd2ca93cf4319680f056bb40bfc24661991 and separating -br and -bd
|
|
Panu Matilainen |
2f2f9e |
from the normal build flow: these are so different from regular builds
|
|
Panu Matilainen |
2f2f9e |
and in particular, have special semantics wrt --nodeps that trying to
|
|
Panu Matilainen |
2f2f9e |
cram them into the normal flow only makes it far harder to read and
|
|
Panu Matilainen |
2f2f9e |
understand.
|
|
Panu Matilainen |
2f2f9e |
---
|
|
Panu Matilainen |
2f2f9e |
rpmbuild.c | 22 +++++++++++++++-------
|
|
Panu Matilainen |
2f2f9e |
tests/rpmbuild.at | 32 ++++++++++++++++++++++++++++++++
|
|
Panu Matilainen |
2f2f9e |
2 files changed, 47 insertions(+), 7 deletions(-)
|
|
Panu Matilainen |
2f2f9e |
|
|
Panu Matilainen |
2f2f9e |
diff --git a/rpmbuild.c b/rpmbuild.c
|
|
Panu Matilainen |
2f2f9e |
index de78976ff..abe164e32 100644
|
|
Panu Matilainen |
2f2f9e |
--- a/rpmbuild.c
|
|
Panu Matilainen |
2f2f9e |
+++ b/rpmbuild.c
|
|
Panu Matilainen |
2f2f9e |
@@ -663,24 +663,32 @@ int main(int argc, char *argv[])
|
|
Panu Matilainen |
2f2f9e |
/* fallthrough */
|
|
Panu Matilainen |
2f2f9e |
case 'f':
|
|
Panu Matilainen |
2f2f9e |
ba->buildAmount |= RPMBUILD_CONF;
|
|
Panu Matilainen |
2f2f9e |
+ ba->buildAmount |= RPMBUILD_BUILDREQUIRES;
|
|
Panu Matilainen |
2f2f9e |
+ if (!noDeps) {
|
|
Panu Matilainen |
2f2f9e |
+ ba->buildAmount |= RPMBUILD_DUMPBUILDREQUIRES;
|
|
Panu Matilainen |
2f2f9e |
+ ba->buildAmount |= RPMBUILD_CHECKBUILDREQUIRES;
|
|
Panu Matilainen |
2f2f9e |
+ }
|
|
Panu Matilainen |
2f2f9e |
if ((buildChar == 'f') && shortCircuit)
|
|
Panu Matilainen |
2f2f9e |
break;
|
|
Panu Matilainen |
2f2f9e |
/* fallthrough */
|
|
Panu Matilainen |
2f2f9e |
+ case 'p':
|
|
Panu Matilainen |
2f2f9e |
+ ba->buildAmount |= RPMBUILD_PREP;
|
|
Panu Matilainen |
2f2f9e |
+ break;
|
|
Panu Matilainen |
2f2f9e |
+ case 'l':
|
|
Panu Matilainen |
2f2f9e |
+ ba->buildAmount |= RPMBUILD_FILECHECK;
|
|
Panu Matilainen |
2f2f9e |
+ break;
|
|
Panu Matilainen |
2f2f9e |
case 'r':
|
|
Panu Matilainen |
2f2f9e |
+ /* fallthrough */
|
|
Panu Matilainen |
2f2f9e |
case 'd':
|
|
Panu Matilainen |
2f2f9e |
+ if (!shortCircuit)
|
|
Panu Matilainen |
2f2f9e |
+ ba->buildAmount |= RPMBUILD_PREP;
|
|
Panu Matilainen |
2f2f9e |
ba->buildAmount |= RPMBUILD_BUILDREQUIRES;
|
|
Panu Matilainen |
2f2f9e |
ba->buildAmount |= RPMBUILD_DUMPBUILDREQUIRES;
|
|
Panu Matilainen |
2f2f9e |
if (!noDeps)
|
|
Panu Matilainen |
2f2f9e |
ba->buildAmount |= RPMBUILD_CHECKBUILDREQUIRES;
|
|
Panu Matilainen |
2f2f9e |
- if ((buildChar == 'r' || buildChar == 'd') && shortCircuit)
|
|
Panu Matilainen |
2f2f9e |
+ if (buildChar == 'd')
|
|
Panu Matilainen |
2f2f9e |
break;
|
|
Panu Matilainen |
2f2f9e |
/* fallthrough */
|
|
Panu Matilainen |
2f2f9e |
- case 'p':
|
|
Panu Matilainen |
2f2f9e |
- ba->buildAmount |= RPMBUILD_PREP;
|
|
Panu Matilainen |
2f2f9e |
- break;
|
|
Panu Matilainen |
2f2f9e |
- case 'l':
|
|
Panu Matilainen |
2f2f9e |
- ba->buildAmount |= RPMBUILD_FILECHECK;
|
|
Panu Matilainen |
2f2f9e |
- break;
|
|
Panu Matilainen |
2f2f9e |
case 's':
|
|
Panu Matilainen |
2f2f9e |
ba->buildAmount |= RPMBUILD_PACKAGESOURCE;
|
|
Panu Matilainen |
2f2f9e |
break;
|
|
Panu Matilainen |
2f2f9e |
diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at
|
|
Panu Matilainen |
2f2f9e |
index b7bd0d7f0..6142bb1ae 100644
|
|
Panu Matilainen |
2f2f9e |
--- a/tests/rpmbuild.at
|
|
Panu Matilainen |
2f2f9e |
+++ b/tests/rpmbuild.at
|
|
Panu Matilainen |
2f2f9e |
@@ -1707,6 +1707,38 @@ runroot rpmbuild \
|
|
Panu Matilainen |
2f2f9e |
)
|
|
Panu Matilainen |
2f2f9e |
AT_CLEANUP
|
|
Panu Matilainen |
2f2f9e |
|
|
Panu Matilainen |
2f2f9e |
+# Test that -br creates an src.rpm on success
|
|
Panu Matilainen |
2f2f9e |
+AT_SETUP([rpmbuild -br success])
|
|
Panu Matilainen |
2f2f9e |
+AT_KEYWORDS([build])
|
|
Panu Matilainen |
2f2f9e |
+AT_CHECK([
|
|
Panu Matilainen |
2f2f9e |
+RPMDB_INIT
|
|
Panu Matilainen |
2f2f9e |
+
|
|
Panu Matilainen |
2f2f9e |
+runroot rpmbuild \
|
|
Panu Matilainen |
2f2f9e |
+ -br /data/SPECS/mini.spec
|
|
Panu Matilainen |
2f2f9e |
+],
|
|
Panu Matilainen |
2f2f9e |
+[0],
|
|
Panu Matilainen |
2f2f9e |
+[Wrote: /build/SRPMS/mini-1-1.src.rpm
|
|
Panu Matilainen |
2f2f9e |
+],
|
|
Panu Matilainen |
2f2f9e |
+[],
|
|
Panu Matilainen |
2f2f9e |
+)
|
|
Panu Matilainen |
2f2f9e |
+AT_CLEANUP
|
|
Panu Matilainen |
2f2f9e |
+
|
|
Panu Matilainen |
2f2f9e |
+# Test that -br creates an src.rpm on success
|
|
Panu Matilainen |
2f2f9e |
+AT_SETUP([rpmbuild -br success])
|
|
Panu Matilainen |
2f2f9e |
+AT_KEYWORDS([build])
|
|
Panu Matilainen |
2f2f9e |
+AT_CHECK([
|
|
Panu Matilainen |
2f2f9e |
+RPMDB_INIT
|
|
Panu Matilainen |
2f2f9e |
+
|
|
Panu Matilainen |
2f2f9e |
+runroot rpmbuild \
|
|
Panu Matilainen |
2f2f9e |
+ -br /data/SPECS/mini.spec
|
|
Panu Matilainen |
2f2f9e |
+],
|
|
Panu Matilainen |
2f2f9e |
+[0],
|
|
Panu Matilainen |
2f2f9e |
+[Wrote: /build/SRPMS/mini-1-1.src.rpm
|
|
Panu Matilainen |
2f2f9e |
+],
|
|
Panu Matilainen |
2f2f9e |
+[],
|
|
Panu Matilainen |
2f2f9e |
+)
|
|
Panu Matilainen |
2f2f9e |
+AT_CLEANUP
|
|
Panu Matilainen |
2f2f9e |
+
|
|
Panu Matilainen |
2f2f9e |
# ------------------------------
|
|
Panu Matilainen |
2f2f9e |
# Check dynamic build requires
|
|
Panu Matilainen |
2f2f9e |
AT_SETUP([rpmbuild -bd with errors])
|
|
Panu Matilainen |
2f2f9e |
--
|
|
Panu Matilainen |
2f2f9e |
2.35.1
|
|
Panu Matilainen |
2f2f9e |
|