- rc= os.system( "%s -ev %s" % (RPM_PATH, rpm_list) )
-
- if rc != 0:
- Error( "Unable to delete RPMs, continuing. rc=%d" % rc )
- else:
- Message( "RPMs deleted successfully." )
+ Message( "Deleting RPMs from %s: %s" %(DELETE_RPM_LIST_FILE," ".join(rpm_list)))
+
+ # invoke them separately as otherwise one faulty (e.g. already uninstalled)
+ # would prevent the other ones from uninstalling
+ for rpm in rpm_list:
+ # is it installed
+ is_installed = os.system ("%s -q %s"%(RPM_PATH,rpm))==0
+ if not is_installed:
+ Message ("Ignoring rpm %s marked to delete, already uninstalled"%rpm)
+ continue
+ uninstalled = os.system( "%s -ev %s" % (RPM_PATH, rpm) )==0
+ if uninstalled:
+ Message ("Successfully removed RPM %s"%rpm)
+ continue
+ else:
+ Error( "Unable to delete RPM %s, continuing. rc=%d" % (rpm,uninstalled))