diff options
author | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2011-01-06 16:16:14 +0000 |
---|---|---|
committer | Per Øyvind Karlsen <peroyvind@mandriva.org> | 2011-01-06 16:16:14 +0000 |
commit | c8d377dcb0d6997f8eba4057ac7c283e9fc0ee08 (patch) | |
tree | 7680abcb2c28d768ff1486404e90f65c74072fa6 | |
parent | ecf169cda8a941162c4797da967e0d4ee8e68a2a (diff) | |
download | perl-URPM-c8d377dcb0d6997f8eba4057ac7c283e9fc0ee08.tar perl-URPM-c8d377dcb0d6997f8eba4057ac7c283e9fc0ee08.tar.gz perl-URPM-c8d377dcb0d6997f8eba4057ac7c283e9fc0ee08.tar.bz2 perl-URPM-c8d377dcb0d6997f8eba4057ac7c283e9fc0ee08.tar.xz perl-URPM-c8d377dcb0d6997f8eba4057ac7c283e9fc0ee08.zip |
check URPM::Transactin::add() for errors and return them if any (#61746)
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | URPM.xs | 11 |
2 files changed, 12 insertions, 2 deletions
@@ -1,5 +1,6 @@ -Version 4.4 - Dec 2010, by +Version 4.4 - Jan 2011, by +- check URPM::Transactin::add() for errors and return them if any (#61746) - make URPM::Package::get_tag() & URPM::Package::get_tag_modifiers() accept string name of tags - URPM::DB::traverse_tag() & URPM::DB::traverse_tag_find() will now accept @@ -3036,6 +3036,7 @@ Trans_add(trans, pkg, ...) CODE: if ((pkg->flag & FLAG_ID) <= FLAG_ID_MAX && pkg->h != NULL) { int update = 0; + int rc; rpmRelocation relocations = NULL; /* compability mode with older interface of add */ if (items == 3) { @@ -3064,9 +3065,17 @@ Trans_add(trans, pkg, ...) } } } - RETVAL = rpmtsAddInstallElement(trans->ts, pkg->h, (fnpyKey)(1+(long)(pkg->flag & FLAG_ID)), update, relocations) == 0; + rc = rpmtsAddInstallElement(trans->ts, pkg->h, (fnpyKey)(1+(long)(pkg->flag & FLAG_ID)), update, relocations); + if(rc) { + rpmps ps = rpmtsProblems(trans->ts); + PUTBACK; + return_problems(ps, 1, 0); + SPAGAIN; + } + /* free allocated memory, check rpm is copying it just above, at least in 4.0.4 */ rpmfiFreeRelocations(relocations); + RETVAL = rc == 0; } else RETVAL = 0; OUTPUT: RETVAL |