aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2011-03-06 05:27:24 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2011-03-06 05:27:24 +0000
commitdc11e8acceef06ea80b2b312a1ba45a3773616b7 (patch)
tree9c36fe45224a10a1ef6faf20038f9b8c7d0674b0
parent1fd571fe46baa6bbd3b371b3e00ae53d8bdfb9ca (diff)
downloadperl-URPM-dc11e8acceef06ea80b2b312a1ba45a3773616b7.tar
perl-URPM-dc11e8acceef06ea80b2b312a1ba45a3773616b7.tar.gz
perl-URPM-dc11e8acceef06ea80b2b312a1ba45a3773616b7.tar.bz2
perl-URPM-dc11e8acceef06ea80b2b312a1ba45a3773616b7.tar.xz
perl-URPM-dc11e8acceef06ea80b2b312a1ba45a3773616b7.zip
strip away distepoch in return_list_str()
-rw-r--r--NEWS2
-rw-r--r--URPM.xs21
2 files changed, 20 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 87fa096..2a36401 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-Version 3.37.2 - 2011, by Per Øyvind Karlsen
+Version 3.37.2 - 6 March 2011, by Per Øyvind Karlsen
- fix incorrect arch returned for packages without any (ie. public keys)
- eliminate disttag & distepoch when extracting name, version, release to
diff --git a/URPM.xs b/URPM.xs
index 0c962ed..9ce50b6 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -478,11 +478,28 @@ return_list_str(char *s, Header header, int32_t tag_name, int32_t tag_flags, int
if (tag_flags && tag_version) {
while(ps != NULL) {
++count;
- if (f(s, ps-s, NULL, 0, NULL, param)) return -count;
+ char *tmp, *ps2 = NULL;
+ if((tmp = strchr(s, '[')) &&
+ (tmp = strchr(tmp, '-')) &&
+ (tmp = strchr(tmp, ':')) &&
+ tmp < ps) {
+ backup_char(tmp);
+ *tmp = ']';
+ ps2 = ++tmp;
+ }
+ if (f(s, ps2 ? ps2-s : ps-s, NULL, 0, NULL, param)) { restore_chars(); return -count; }
+ restore_chars();
s = ps + 1; ps = strchr(s, '@');
}
++count;
- if (f(s, 0, NULL, 0, NULL, param)) return -count;
+ if((ps = strchr(s, '[')) &&
+ (ps = strchr(ps, '-')) &&
+ (ps = strchr(ps, ':'))) {
+ backup_char(ps);
+ *ps++ = ']';
+ }
+ if (f(s, ps ? ps-s : 0, NULL, 0, NULL, param)) { restore_chars(); return -count; }
+ restore_chars();
} else {
char *eos;
while(ps != NULL) {