aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2011-01-06 16:16:14 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2011-01-06 16:16:14 +0000
commitc8d377dcb0d6997f8eba4057ac7c283e9fc0ee08 (patch)
tree7680abcb2c28d768ff1486404e90f65c74072fa6 /URPM.xs
parentecf169cda8a941162c4797da967e0d4ee8e68a2a (diff)
downloadperl-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)
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs11
1 files changed, 10 insertions, 1 deletions
diff --git a/URPM.xs b/URPM.xs
index 1973a97..0e72818 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -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