aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs6
1 files changed, 2 insertions, 4 deletions
diff --git a/URPM.xs b/URPM.xs
index cbe081f..b87f7d5 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -1826,6 +1826,7 @@ Db_create_transaction(db, prefix="/")
char *prefix
CODE:
if ((RETVAL = calloc(1, sizeof(struct s_Transaction))) != NULL) {
+ /* rpmSetVerbosity(RPMMESS_DEBUG); TODO check remove and add in same transaction */
RETVAL->db = db;
RETVAL->ts = rpmtransCreateSet(db, prefix);
}
@@ -1875,10 +1876,7 @@ Trans_remove(trans, name)
mi = rpmdbInitIterator(trans->db, RPMDBI_LABEL, name, 0);
while (h = rpmdbNextIterator(mi)) {
unsigned int recOffset = rpmdbGetIteratorOffset(mi);
- if (recOffset) {
- rpmtransRemovePackage(trans->ts, recOffset);
- ++count;
- }
+ count += recOffset != 0 && rpmtransRemovePackage(trans->ts, recOffset) == 0;
}
rpmdbFreeIterator(mi);
RETVAL=count;