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

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