diff options
author | Francois Pons <fpons@mandriva.com> | 2002-12-11 11:27:06 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2002-12-11 11:27:06 +0000 |
commit | ccd1e1188079c523a84c5a3a6806d21669539e21 (patch) | |
tree | 14d202083d278745470dcf518c3b204841425cdc | |
parent | df710ae6593cff2d17e7bcfcee2e74e6b928b891 (diff) | |
download | perl-URPM-ccd1e1188079c523a84c5a3a6806d21669539e21.tar perl-URPM-ccd1e1188079c523a84c5a3a6806d21669539e21.tar.gz perl-URPM-ccd1e1188079c523a84c5a3a6806d21669539e21.tar.bz2 perl-URPM-ccd1e1188079c523a84c5a3a6806d21669539e21.tar.xz perl-URPM-ccd1e1188079c523a84c5a3a6806d21669539e21.zip |
0.80-2mdk
-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). |