Blame SOURCES/BZ-1349433-verifytree-handle-no-core-group.patch

085af2
commit b586ff502946fbd3271db8370cb546f696c51cfd
085af2
Author: Michal Domonkos <mdomonko@redhat.com>
085af2
Date:   Fri Oct 20 19:47:36 2017 +0200
085af2
085af2
    verifytree: handle no @core group gracefully. BZ 1349433
085af2
    
085af2
    It's not clear to me whether @core group is really mandatory, however
085af2
    let's make verifytree fail if it's not defined so that we don't change
085af2
    the return code to 0 for that case; we would return 1 previously (python
085af2
    traceback) and now we OR the BAD_COMPS flag which is 4 (still not 1 but
085af2
    at least non-zero).
085af2
085af2
diff --git a/verifytree.py b/verifytree.py
085af2
index 6a127cd..603a633 100755
085af2
--- a/verifytree.py
085af2
+++ b/verifytree.py
085af2
@@ -278,7 +278,14 @@ def main():
085af2
     elif not (retval & BAD_COMPS or opts.nocomps):
085af2
         print "Checking mandatory @core packages"
085af2
         group = my.comps.return_group('core')
085af2
-        for pname in group.mandatory_packages:
085af2
+        if group is not None:
085af2
+            pkgs = group.mandatory_packages
085af2
+        else:
085af2
+            print "  @core group not found"
085af2
+            retval = retval | BAD_COMPS
085af2
+            report('COMPS','FAILED')
085af2
+            pkgs = []
085af2
+        for pname in pkgs:
085af2
             # FIXME: this pulls from pkgSack, which (I guess) is populated 
085af2
             # based on the arch etc. of the current host.. so you can't check
085af2
             # the x86_64 repo from an i386 machine, f'rinstance.