aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--URPM.xs33
2 files changed, 20 insertions, 15 deletions
diff --git a/NEWS b/NEWS
index cfb78e0..5385646 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- fix setting rflags on packages (mga#6532)
+
Version 4.8 - 22 June 2012
- enable to read xz & bzip2 compressed synthesis
diff --git a/URPM.xs b/URPM.xs
index a620a54..b44e1de 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -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;