diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-04-10 15:52:36 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-04-10 15:52:36 +0300 |
commit | c01ef8228d373f9232b47ac0915bb5786e5266cf (patch) | |
tree | fd9fb9f1589a6c0a9af76bdf8ec1df48ee4c9fbf /build | |
parent | 61dff28fa4d9169fd71ccd7a9f83c1186037c3db (diff) | |
download | rpm-c01ef8228d373f9232b47ac0915bb5786e5266cf.tar.gz rpm-c01ef8228d373f9232b47ac0915bb5786e5266cf.tar.bz2 rpm-c01ef8228d373f9232b47ac0915bb5786e5266cf.zip |
Add a static, far simpler addPackageProvides() to build
- use instead of providePackageNVR() which needs to deal with all sorts
of hysteric "rpm 3.0.2 did this but 3.0.5 didn't" issues
Diffstat (limited to 'build')
-rw-r--r-- | build/pack.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/build/pack.c b/build/pack.c index e1a9ea1cd..711207b20 100644 --- a/build/pack.c +++ b/build/pack.c @@ -15,7 +15,6 @@ #include "lib/cpio.h" #include "lib/fsm.h" #include "lib/rpmfi_internal.h" /* XXX fi->fsm */ -#include "lib/legacy.h" /* XXX providePackageNVR */ #include "lib/signature.h" #include "lib/rpmlead.h" #include "build/buildio.h" @@ -596,6 +595,24 @@ static const rpmTag copyTags[] = { 0 }; +/* + * Add extra provides to package. + */ +static void addPackageProvides(Header h) +{ + HAE_t hae = headerAddOrAppendEntry; + const char *name = NULL; + char *evr; + rpmsenseFlags pflags = RPMSENSE_EQUAL; + + /* <name> = <evr> provide */ + evr = headerGetEVR(h, &name); + hae(h, RPMTAG_PROVIDENAME, RPM_STRING_ARRAY_TYPE, &name, 1); + hae(h, RPMTAG_PROVIDEFLAGS, RPM_INT32_TYPE, &pflags, 1); + hae(h, RPMTAG_PROVIDEVERSION, RPM_STRING_ARRAY_TYPE, &evr, 1); + free(evr); +} + rpmRC packageBinaries(rpmSpec spec) { struct cpioSourceArchive_s csabuf; @@ -628,7 +645,7 @@ rpmRC packageBinaries(rpmSpec spec) (void) headerAddEntry(pkg->header, RPMTAG_BUILDTIME, RPM_INT32_TYPE, getBuildTime(), 1); - providePackageNVR(pkg->header); + addPackageProvides(pkg->header); { char * optflags = rpmExpand("%{optflags}", NULL); (void) headerAddEntry(pkg->header, RPMTAG_OPTFLAGS, RPM_STRING_TYPE, |