[Yum-devel] yum-utils package-cleanup -- exit with error if problems found

Matthew Miller mattdm at mattdm.org
Mon Sep 17 20:20:23 UTC 2007


This would be handy for scripting an automatic package database problem
check....


--- package-cleanup.20070917	2007-07-06 13:32:06.000000000 -0400
+++ package-cleanup	2007-09-17 16:17:44.000000000 -0400
@@ -101,8 +101,12 @@
                 # Store the resolve_sack so that we can re-use it if another
                 # package has the same requirement
                 providers[(req,rflags,ver)] = resolve_sack
-    if not errors and reportProblems:
-        print "No problems found"
+    if reportProblems:
+        if errors:
+            sys.exit(1)
+        else:
+            print "No problems found"
+            sys.exit(0)
     return provsomething
 
 def findDupes(my):

-- 
Matthew Miller           mattdm at mattdm.org          <http://mattdm.org/>
Boston University Linux      ------>              <http://linux.bu.edu/>



More information about the Yum-devel mailing list