File erasebadreturn.diff of Package failed_rpm

Do not call rpmtsRun with an empty transaction list, it returns -1
which messes up the numFailed counter. [#43267]

Index: lib/rpminstall.c
===================================================================
--- lib/rpminstall.c.orig
+++ lib/rpminstall.c
@@ -844,7 +844,7 @@ int rpmErase(rpmts ts, struct rpmInstall
     }
 #endif
 
-    if (!stopUninstall) {
+    if (numPackages && !stopUninstall) {
 	(void) rpmtsSetFlags(ts, (rpmtsFlags(ts) | RPMTRANS_FLAG_REVERSE));
 
 	/* Drop added/available package indices and dependency sets. */
openSUSE Build Service is sponsored by