diff options
Diffstat (limited to 'URPM.xs')
-rw-r--r-- | URPM.xs | 32 |
1 files changed, 14 insertions, 18 deletions
@@ -3174,7 +3174,7 @@ Trans_check(trans, ...) PREINIT: I32 gimme = GIMME_V; int translate_message = 0; - int i; + int i, r; PPCODE: for (i = 1; i < items-1; i+=2) { STRLEN len; @@ -3184,28 +3184,24 @@ Trans_check(trans, ...) translate_message = SvIV(ST(i+1)); } } - if (rpmtsCheck(trans->ts)) { + r = rpmtsCheck(trans->ts); + rpmps ps = rpmtsProblems(trans->ts); + if (rpmpsNumProblems(ps) > 0) { if (gimme == G_SCALAR) { XPUSHs(sv_2mortal(newSViv(0))); } else if (gimme == G_ARRAY) { - XPUSHs(sv_2mortal(newSVpv("error while checking dependencies", 0))); - } - } else { - rpmps ps = rpmtsProblems(trans->ts); - if (rpmpsNumProblems(ps) > 0) { - if (gimme == G_SCALAR) { - XPUSHs(sv_2mortal(newSViv(0))); - } else if (gimme == G_ARRAY) { - /* now translation is handled by rpmlib, but only for version 4.2 and above */ - PUTBACK; - return_problems(ps, 1, 0); - SPAGAIN; - } - } else if (gimme == G_SCALAR) { - XPUSHs(sv_2mortal(newSViv(1))); + /* now translation is handled by rpmlib, but only for version 4.2 and above */ + PUTBACK; + return_problems(ps, 1, 0); + SPAGAIN; } - ps = rpmpsFree(ps); + } else if (gimme == G_SCALAR) { + XPUSHs(sv_2mortal(newSViv(1))); } + if(r == 1) + XPUSHs(sv_2mortal(newSVpv("error while checking dependencies", 0))); + + ps = rpmpsFree(ps); void Trans_order(trans) |