summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);