aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2011-06-21 11:12:33 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2011-06-21 11:12:33 +0000
commitd494971f6bfe48ccaa1dfb9811535048e05d2d36 (patch)
treee523a974959649c22a0ce757dfb40295d61cba4f
parent9b8cafaf4b5147791c21da13cdda9aeaaecbeb27 (diff)
downloadperl-URPM-d494971f6bfe48ccaa1dfb9811535048e05d2d36.tar
perl-URPM-d494971f6bfe48ccaa1dfb9811535048e05d2d36.tar.gz
perl-URPM-d494971f6bfe48ccaa1dfb9811535048e05d2d36.tar.bz2
perl-URPM-d494971f6bfe48ccaa1dfb9811535048e05d2d36.tar.xz
perl-URPM-d494971f6bfe48ccaa1dfb9811535048e05d2d36.zip
support getting disttag & distepoch from synthesis
-rw-r--r--NEWS3
-rw-r--r--URPM.xs20
2 files changed, 20 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 74911f3..b795c29 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,6 @@
-Version 3.37.2 - 26 April 2011, by Per Øyvind Karlsen
+Version 3.37.2 - 21 June 2011, by Per Øyvind Karlsen
+- support getting disttag & distepoch from synthesis
- fix URPM::Package->distepoch to actually work
- add disttag & distepoch at end of @info@ line
- add support for doing comparision against provides with distepoch to allow
diff --git a/URPM.xs b/URPM.xs
index 1539788..a67599f 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -2516,14 +2516,30 @@ Pkg_dirnames(pkg)
void Pkg_distepoch(pkg)
URPM::Package pkg
PPCODE:
- if (pkg->h) {
+ if (pkg->info) {
+ int i;
+ char *tmp = pkg->info, *eos = NULL;
+ for (i = 0; i < 5 && tmp != NULL; i++)
+ tmp = strchr(++tmp, '@');
+ if (tmp != NULL && *tmp)
+ eos = strchr(++tmp, '@');
+ XPUSHs(sv_2mortal(newSVpv((tmp && *tmp != '@') ? tmp : "", eos ? eos-tmp : 0)));
+ } else if (pkg->h) {
XPUSHs(sv_2mortal(newSVpv(get_name(pkg->h, RPMTAG_DISTEPOCH), 0)));
}
void Pkg_disttag(pkg)
URPM::Package pkg
PPCODE:
- if (pkg->h) {
+ if (pkg->info) {
+ int i;
+ char *tmp = pkg->info, *eos = NULL;
+ for (i = 0; i < 4 && tmp != NULL; i++)
+ tmp = strchr(++tmp, '@');
+ if (tmp != NULL && *tmp)
+ eos = strchr(++tmp, '@');
+ XPUSHs(sv_2mortal(newSVpv((tmp && *tmp != '@') ? tmp : "", eos ? eos-tmp : 0)));
+ } else if (pkg->h) {
XPUSHs(sv_2mortal(newSVpv(get_name(pkg->h, RPMTAG_DISTTAG), 0)));
}