summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-11-18 11:22:26 +0200
committerPanu Matilainen <pmatilai@redhat.com>2008-11-18 11:22:26 +0200
commitff9733b6fd8cb7dc8afccf38833d26d0363aeef7 (patch)
tree617248a42dedacc80e552e01343fc93fc146ac34 /build
parent8d6c4b8c95b59f5a71d90c582c2e98f5c7ed7b9d (diff)
downloadrpm-ff9733b6fd8cb7dc8afccf38833d26d0363aeef7.tar.gz
rpm-ff9733b6fd8cb7dc8afccf38833d26d0363aeef7.tar.bz2
rpm-ff9733b6fd8cb7dc8afccf38833d26d0363aeef7.zip
Generate and insert SOURCERPM tag earlier
- needed to make checking for source/binary package in rpmfiNew() reliable at build time
Diffstat (limited to 'build')
-rw-r--r--build/files.c14
-rw-r--r--build/pack.c19
2 files changed, 14 insertions, 19 deletions
diff --git a/build/files.c b/build/files.c
index 51d6392de..9b4446a50 100644
--- a/build/files.c
+++ b/build/files.c
@@ -1982,6 +1982,17 @@ static const rpmTag sourceTags[] = {
0
};
+static void genSourceRpmName(rpmSpec spec)
+{
+ if (spec->sourceRpmName == NULL) {
+ const char *name, *version, *release;
+
+ (void) headerNVR(spec->packages->header, &name, &version, &release);
+ rasprintf(&spec->sourceRpmName, "%s-%s-%s.%ssrc.rpm", name, version, release,
+ spec->noSource ? "no" : "");
+ }
+}
+
void initSourceHeader(rpmSpec spec)
{
HeaderIterator hi;
@@ -2034,6 +2045,7 @@ int processSourceFiles(rpmSpec spec)
if (spec->sourceHeader == NULL)
initSourceHeader(spec);
+ genSourceRpmName(spec);
/* Construct the file list and source entries */
appendLineStringBuf(sourceFiles, spec->specFile);
if (spec->sourceHeader != NULL)
@@ -2213,9 +2225,11 @@ int processBinaryFiles(rpmSpec spec, int installSpecialDoc, int test)
int rc = RPMRC_OK;
check_fileList = newStringBuf();
+ genSourceRpmName(spec);
for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
const char *n, *v, *r;
+ headerPutString(pkg->header, RPMTAG_SOURCERPM, spec->sourceRpmName);
if (pkg->fileList == NULL)
continue;
diff --git a/build/pack.c b/build/pack.c
index 2a6f81797..e0860c2b2 100644
--- a/build/pack.c
+++ b/build/pack.c
@@ -22,21 +22,6 @@
#include "debug.h"
/**
- */
-static inline int genSourceRpmName(rpmSpec spec)
-{
- if (spec->sourceRpmName == NULL) {
- const char *name, *version, *release;
-
- (void) headerNVR(spec->packages->header, &name, &version, &release);
- rasprintf(&spec->sourceRpmName, "%s-%s-%s.%ssrc.rpm", name, version, release,
- spec->noSource ? "no" : "");
- }
-
- return 0;
-}
-
-/**
* @todo Create transaction set *much* earlier.
*/
static rpmRC cpio_doio(FD_t fdo, Header h, CSA_t csa,
@@ -734,9 +719,6 @@ rpmRC packageBinaries(rpmSpec spec)
optflags = _free(optflags);
}
- (void) genSourceRpmName(spec);
- headerPutString(pkg->header, RPMTAG_SOURCERPM, spec->sourceRpmName);
-
if (spec->sourcePkgId != NULL) {
headerPutBin(pkg->header, RPMTAG_SOURCEPKGID, spec->sourcePkgId,16);
}
@@ -824,7 +806,6 @@ rpmRC packageSources(rpmSpec spec)
headerPutString(spec->sourceHeader, RPMTAG_RPMVERSION, VERSION);
headerPutString(spec->sourceHeader, RPMTAG_BUILDHOST, buildHost());
headerPutUint32(spec->sourceHeader, RPMTAG_BUILDTIME, getBuildTime(), 1);
- (void) genSourceRpmName(spec);
spec->cookie = _free(spec->cookie);