diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-06-25 18:20:04 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-06-25 18:20:04 +0000 |
commit | 0a22ad25bcb7f0aaca19d3f85affc52034e2a766 (patch) | |
tree | 5984459cedd200fb40c1dfcf3c247f3bd6893d80 /URPM.xs | |
parent | 4e573e14073b99b2b422f1fef4ef7cbb97fecf37 (diff) | |
download | perl-URPM-0a22ad25bcb7f0aaca19d3f85affc52034e2a766.tar perl-URPM-0a22ad25bcb7f0aaca19d3f85affc52034e2a766.tar.gz perl-URPM-0a22ad25bcb7f0aaca19d3f85affc52034e2a766.tar.bz2 perl-URPM-0a22ad25bcb7f0aaca19d3f85affc52034e2a766.tar.xz perl-URPM-0a22ad25bcb7f0aaca19d3f85affc52034e2a766.zip |
revert commit r4982 on Jun 18 2012 (was: "(push_rflags) factorize code)
thus fixing setting rflags on packages (mga#6532)
Diffstat (limited to 'URPM.xs')
-rw-r--r-- | URPM.xs | 33 |
1 files changed, 18 insertions, 15 deletions
@@ -1334,19 +1334,6 @@ rpmtag_from_string(char *tag) else croak("unknown tag [%s]", tag); } -static void push_rflags(URPM__Package pkg, int gimme) { - dSP; - if (gimme == G_ARRAY && pkg->rflags != NULL) { - char *s = pkg->rflags; - char *eos; - while ((eos = strchr(s, '\t')) != NULL) { - mXPUSHs(newSVpv(s, eos-s)); - s = eos + 1; - } - mXPUSHs(newSVpv(s, 0)); - } -} - static int compare_evrs(int lepoch, char*lversion, char*lrelease, int repoch, char*rversion, char*rrelease) { int compare; compare = lepoch - repoch; @@ -2281,7 +2268,15 @@ Pkg_rflags(pkg) PREINIT: I32 gimme = GIMME_V; PPCODE: - push_rflags(pkg, gimme); + if (gimme == G_ARRAY && pkg->rflags != NULL) { + char *s = pkg->rflags; + char *eos; + while ((eos = strchr(s, '\t')) != NULL) { + mXPUSHs(newSVpv(s, eos-s)); + s = eos + 1; + } + mXPUSHs(newSVpv(s, 0)); + } void Pkg_set_rflags(pkg, ...) @@ -2307,7 +2302,15 @@ Pkg_set_rflags(pkg, ...) } new_rflags[total_len - 1] = 0; /* but mark end-of-string correctly */ - push_rflags(pkg, gimme); + if (gimme == G_ARRAY && pkg->rflags != NULL) { + char *s = pkg->rflags; + char *eos; + while ((eos = strchr(s, '\t')) != NULL) { + mXPUSHs(newSVpv(s, eos-s)); + s = eos + 1; + } + mXPUSHs(newSVpv(s, 0)); + } free(pkg->rflags); pkg->rflags = new_rflags; |