diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2010-09-02 11:01:15 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2010-09-02 11:16:07 +0300 |
commit | 3c7d4f89bb68d68b9d775fc6623c3f1c342ac0bd (patch) | |
tree | 8794558aea95c03c4d8e56de5963191b43e5a8b7 /build | |
parent | 36f0c779d6770f5b3c8bdc72a562a4f7880ed4b7 (diff) | |
download | rpm-3c7d4f89bb68d68b9d775fc6623c3f1c342ac0bd.tar.gz rpm-3c7d4f89bb68d68b9d775fc6623c3f1c342ac0bd.tar.bz2 rpm-3c7d4f89bb68d68b9d775fc6623c3f1c342ac0bd.zip |
Detect short-circuited build based on executed build steps from buildSpec()
- Avoids having to access rpmBTArgs from deep packageBinaries(),
API changing is not an issue anymore...
Diffstat (limited to 'build')
-rw-r--r-- | build/build.c | 4 | ||||
-rw-r--r-- | build/pack.c | 4 | ||||
-rw-r--r-- | build/rpmbuild_internal.h | 3 |
3 files changed, 7 insertions, 4 deletions
diff --git a/build/build.c b/build/build.c index 0584dcf3f..cab152bd1 100644 --- a/build/build.c +++ b/build/build.c @@ -234,6 +234,8 @@ static rpmRC buildSpec(BTA_t buildArgs, rpmSpec spec, int what) } } } else { + int didBuild = (what & (RPMBUILD_PREP|RPMBUILD_BUILD|RPMBUILD_INSTALL)); + if ((what & RPMBUILD_PREP) && (rc = doScript(spec, RPMBUILD_PREP, NULL, NULL, test))) goto exit; @@ -268,7 +270,7 @@ static rpmRC buildSpec(BTA_t buildArgs, rpmSpec spec, int what) return rc; if (((what & RPMBUILD_PACKAGEBINARY) && !test) && - (rc = packageBinaries(spec, cookie))) + (rc = packageBinaries(spec, cookie, (didBuild == 0)))) goto exit; if ((what & RPMBUILD_CLEAN) && diff --git a/build/pack.c b/build/pack.c index 8e0c8685c..fa4b4efa9 100644 --- a/build/pack.c +++ b/build/pack.c @@ -668,7 +668,7 @@ static rpmRC checkPackages(char *pkgcheck) return RPMRC_OK; } -rpmRC packageBinaries(rpmSpec spec, const char *cookie) +rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating) { struct cpioSourceArchive_s csabuf; CSA_t csa = &csabuf; @@ -705,7 +705,7 @@ rpmRC packageBinaries(rpmSpec spec, const char *cookie) headerPutBin(pkg->header, RPMTAG_SOURCEPKGID, spec->sourcePkgId,16); } - if (rpmBTArgs.shortCircuit) { + if (cheating) { (void) rpmlibNeedsFeature(pkg->header, "ShortCircuited", "4.9.0-1"); } diff --git a/build/rpmbuild_internal.h b/build/rpmbuild_internal.h index 0b17496be..93fcdd4ae 100644 --- a/build/rpmbuild_internal.h +++ b/build/rpmbuild_internal.h @@ -285,10 +285,11 @@ int processSourceFiles(rpmSpec spec); * Generate binary package(s). * @param spec spec file control structure * @param cookie build identifier "cookie" or NULL + * @param cheating was build shortcircuited? * @return RPMRC_OK on success */ RPM_GNUC_INTERNAL -rpmRC packageBinaries(rpmSpec spec, const char *cookie); +rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating); /** \ingroup rpmbuild * Generate source package. |