diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-11-18 11:22:26 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-11-18 11:22:26 +0200 |
commit | ff9733b6fd8cb7dc8afccf38833d26d0363aeef7 (patch) | |
tree | 617248a42dedacc80e552e01343fc93fc146ac34 /build/files.c | |
parent | 8d6c4b8c95b59f5a71d90c582c2e98f5c7ed7b9d (diff) | |
download | librpm-tizen-ff9733b6fd8cb7dc8afccf38833d26d0363aeef7.tar.gz librpm-tizen-ff9733b6fd8cb7dc8afccf38833d26d0363aeef7.tar.bz2 librpm-tizen-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/files.c')
-rw-r--r-- | build/files.c | 14 |
1 files changed, 14 insertions, 0 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; |