diff options
-rw-r--r-- | URPM.xs | 34 | ||||
-rw-r--r-- | perl-URPM.spec | 6 |
2 files changed, 19 insertions, 21 deletions
@@ -1802,17 +1802,12 @@ Db_traverse(db,callback) pkg->flag = FLAG_ID_INVALID | FLAG_NO_HEADER_FREE; pkg->h = header; - ENTER; - SAVETMPS; PUSHMARK(SP); XPUSHs(sv_2mortal(sv_setref_pv(newSVpv("", 0), "URPM::Package", pkg))); PUTBACK; call_sv(callback, G_DISCARD | G_SCALAR); pkg->h = 0; /* avoid using it anymore, in case it has been copied inside callback */ - - FREETMPS; - LEAVE; } ++count; } @@ -1868,17 +1863,12 @@ Db_traverse_tag(db,tag,names,callback) pkg->flag = FLAG_ID_INVALID | FLAG_NO_HEADER_FREE; pkg->h = header; - ENTER; - SAVETMPS; PUSHMARK(SP); XPUSHs(sv_2mortal(sv_setref_pv(newSVpv("", 0), "URPM::Package", pkg))); PUTBACK; call_sv(callback, G_DISCARD | G_SCALAR); pkg->h = 0; /* avoid using it anymore, in case it has been copied inside callback */ - - FREETMPS; - LEAVE; } ++count; } @@ -2313,7 +2303,7 @@ Urpm_parse_hdlist(urpm, filename, ...) char *s = SvPV(ST(i), len); if (len == 7 && !memcmp(s, "packing", 7)) { - packing = SvIV(ST(i + 1)); + packing = SvIV(ST(i+1)); } else if (len == 8 && !memcmp(s, "callback", 8)) { callback = ST(i+1); } @@ -2346,21 +2336,25 @@ Urpm_parse_hdlist(urpm, filename, ...) sv_pkg = sv_setref_pv(newSVpv("", 0), "URPM::Package", _pkg = memcpy(malloc(sizeof(struct s_Package)), &pkg, sizeof(struct s_Package))); if (callback != NULL) { + int count; + /* now, a callback will be called for sure */ - dSP; + ENTER; + SAVETMPS; PUSHMARK(sp); XPUSHs(urpm); XPUSHs(sv_pkg); PUTBACK; - if (call_sv(callback, G_SCALAR) == 1) { - SPAGAIN; - if (!POPi) { - /* package should not be added in depslist, so we free it */ - SvREFCNT_dec(sv_pkg); - sv_pkg = NULL; - } - PUTBACK; + count = call_sv(callback, G_SCALAR); + SPAGAIN; + if (count == 1 && !POPi) { + /* package should not be added in depslist, so we free it */ + SvREFCNT_dec(sv_pkg); + sv_pkg = NULL; } + PUTBACK; + FREETMPS; + LEAVE; } if (sv_pkg) { if (provides) { diff --git a/perl-URPM.spec b/perl-URPM.spec index f718bed..7dfd8e6 100644 --- a/perl-URPM.spec +++ b/perl-URPM.spec @@ -1,7 +1,7 @@ %define name perl-URPM %define real_name URPM %define version 0.80 -%define release 1mdk +%define release 2mdk %{expand:%%define rpm_version %(rpm -q --queryformat '%{VERSION}-%{RELEASE}' rpm)} @@ -49,6 +49,10 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Wed Dec 11 2002 François Pons <fpons@mandrakesoft.com> 0.80-2mdk +- removed dSP in XS (sound like perl doesn't like them a lot), + this fixes urpmf problem of reading first hdlist. + * Thu Dec 5 2002 François Pons <fpons@mandrakesoft.com> 0.80-1mdk - added %%options for parse_(hdlist|synthesis|rpm) to support callback (for urpmf in perl). |