diff options
author | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2011-05-03 21:35:01 +0000 |
---|---|---|
committer | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2011-05-03 21:35:01 +0000 |
commit | 105620c668a657aaf3ba1581ef9000fab6bffe72 (patch) | |
tree | e10fbc96e7cbf821a07bd6ef0c7d2acaf41342f4 | |
parent | bb611ce824bd67b832816ba74f4f2818fec34c0d (diff) | |
download | perl-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.xs | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -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; |