[Rpm-maint] [PATCH v2] Allow '--short-circuit' for '-bb'

Panu Matilainen pmatilai at laiskiainen.org
Wed Jun 23 09:38:53 UTC 2010


On Mon, 21 Jun 2010, Michal Schmidt wrote:

> This patch allows short-circuiting of building binary packages. To
> prevent accidental use of short-circuited rpms, they are marked with
> an unsatisfiable dependency "rpmlib(ShortCircuited)". A developer using
> this feature for local development and testing will use "--nodeps".
> Should such a rpm leak into the world, users will quickly notice
> it does not install by default.
>
> Warning: This adds a parameter to packageBinaries() which is a part of
> the public API, I believe.

librpmbuild public API is mostly just bad joke, but .. it should be 
possible to avoid changing it by looking at rpmBTArgs, eg (untested):

diff --git a/build/pack.c b/build/pack.c
index c7622cc..293aa50 100644
--- a/build/pack.c
+++ b/build/pack.c
@@ -753,6 +753,10 @@ rpmRC packageBinaries(rpmSpec spec)
  	if (spec->sourcePkgId != NULL) {
  	    headerPutBin(pkg->header, RPMTAG_SOURCEPKGID, spec->sourcePkgId,16);
  	}
+
+	if (rpmBTArgs.shortCircuit) {
+	    rpmlibNeedsFeature(pkg->header, "ShortCircuited", "4.9.0-1");
+	}

  	{   char *binFormat = rpmGetPath("%{_rpmfilename}", NULL);
  	    char *binRpm, *binDir;

 	- Panu -


More information about the Rpm-maint mailing list