b6aa4b0 comps-sync.py: handle arch-dependent package specs (#311)

1 file Authored by adamwill 2 years ago, Committed by kevin 2 years ago,
1 file changed. 113 lines added. 54 lines removed.
    comps-sync.py: handle arch-dependent package specs (#311)
    
    comps allows for a package to be included in a group only on
    specified arches, with a line like this:
    
          <packagereq arch="aarch64,x86_64" type="default">kio-gdrive</packagereq>
    
    up till now, `comps-sync.py` effectively ignored this, treating
    such a line exactly the same as this:
    
          <packagereq type="default">kio-gdrive</packagereq>
    
    and attempting to include the package even when building on e.g.
    ppc64le.
    
    Solving this is unfortunately tricky due to exactly how libcomps
    handles these arch restrictions. It does not expose the list of
    arches as a property of each returned 'package' object when you
    do a group search. Instead you're supposed to filter the group
    search down to the arch(es) you are interested in, and it only
    includes the appropriate packages for that arch. So all we can
    do is run our queries multiple times, once for each arch we may
    wish to build on, keep track of the results per arch as we go,
    and do some fancy footwork to keep track of the mapping between
    "archful" comps entries and the lists in the YAML files.
    
    Signed-off-by: Adam Williamson <awilliam@redhat.com>
    
        
file modified
+113 -54