aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2011-05-03 21:35:01 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2011-05-03 21:35:01 +0000
commit105620c668a657aaf3ba1581ef9000fab6bffe72 (patch)
treee10fbc96e7cbf821a07bd6ef0c7d2acaf41342f4
parentbb611ce824bd67b832816ba74f4f2818fec34c0d (diff)
downloadperl-URPM-105620c668a657aaf3ba1581ef9000fab6bffe72.tar
perl-URPM-105620c668a657aaf3ba1581ef9000fab6bffe72.tar.gz
perl-URPM-105620c668a657aaf3ba1581ef9000fab6bffe72.tar.bz2
perl-URPM-105620c668a657aaf3ba1581ef9000fab6bffe72.tar.xz
perl-URPM-105620c668a657aaf3ba1581ef9000fab6bffe72.zip
fix getting EVR of src.rpms properly
-rw-r--r--URPM.xs17
1 files changed, 10 insertions, 7 deletions
diff --git a/URPM.xs b/URPM.xs
index 752d7ea..5972bb1 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -718,7 +718,7 @@ return_list_tag(URPM__Package pkg, const char *tag_name) {
_free(nvra);
} else if (headerGet(pkg->h, he, 0)) {
if (tag == RPMTAG_ARCH)
- XPUSHs(sv_2mortal(newSVpv((headerIsEntry(pkg->h, RPMTAG_SOURCERPM) || headerIsEntry(pkg->h, RPMTAG_SOURCERPM)) ? he->p.str : "src", 0)));
+ XPUSHs(sv_2mortal(newSVpv((headerIsEntry(pkg->h, RPMTAG_SOURCERPM) || headerIsEntry(pkg->h, RPMTAG_SOURCEPACKAGE)) ? he->p.str : "src", 0)));
else
switch (he->t) {
case RPM_UINT8_TYPE:
@@ -986,12 +986,15 @@ get_evr(URPM__Package pkg) {
needle += 2;
size_t len = strlen(needle);
- if (pkg->provides == NULL)
- pkg->provides = pack_list(pkg->h, RPMTAG_PROVIDENAME, RPMTAG_PROVIDEFLAGS, RPMTAG_PROVIDEVERSION, NULL);
-
- evr = strstr(pkg->provides, needle);
- if(strlen(evr) != len)
- backup_char((char*)&evr[len]);
+ if (headerIsEntry(pkg->h, RPMTAG_SOURCERPM) || headerIsEntry(pkg->h, RPMTAG_SOURCEPACKAGE))
+ evr = needle;
+ else {
+ if (pkg->provides == NULL)
+ pkg->provides = pack_list(pkg->h, RPMTAG_PROVIDENAME, RPMTAG_PROVIDEFLAGS, RPMTAG_PROVIDEVERSION, NULL);
+ evr = strstr(pkg->provides, needle);
+ }
+ if(strlen(evr) != len)
+ backup_char((char*)&evr[len]);
ds = rpmdsFree(ds);
}
return evr;