Commit e8f4b73 pull in gather.py patches from dmach for test compose

1 file Authored and Committed by Adam Miller 2 years ago
pull in gather.py patches from dmach for test compose

    
 1 @@ -922,7 +922,6 @@
 2                   pprint.pformat(list(sorted(failed)))))
 3               self.logger.info("Couldn't find %i of %i srpms." % (
 4                   len(failed), len(self.src_by_bin)))
 5 -             raise RuntimeError("Could not find all srpms.")
 6   
 7       def add_srpms(self, po_list=None):
 8           """Cycle through the list of package objects and
 9 @@ -932,11 +931,14 @@
10           srpms = set()
11           po_list = po_list or self.po_list
12           for po in sorted(po_list):
13 -             srpm_po = self.sourcerpm_srpmpo_map[po.sourcerpm]
14 -             if srpm_po in self.completed_add_srpms:
15 +             try:
16 +                 srpm_po = self.sourcerpm_srpmpo_map[po.sourcerpm]
17 +             except KeyError:
18 +                 self.logger.error("Cannot get source RPM '%s' for %s" % (po.sourcerpm, po.nvra))
19 +                 srpm_po = None
20 + 
21 +             if srpm_po is None:
22                   continue
23 -             msg = "Added source package %s.%s (repo: %s)" % (srpm_po.name, srpm_po.arch, srpm_po.repoid)
24 -             self.add_source(srpm_po, msg)
25   
26               # flags
27               if po in self.input_packages:
28 @@ -948,6 +950,12 @@
29               if po in self.multilib_packages:
30                   self.multilib_packages.add(srpm_po)
31   
32 +             if srpm_po in self.completed_add_srpms:
33 +                 continue
34 + 
35 +             msg = "Added source package %s.%s (repo: %s)" % (srpm_po.name, srpm_po.arch, srpm_po.repoid)
36 +             self.add_source(srpm_po, msg)
37 + 
38               self.completed_add_srpms.add(srpm_po)
39               srpms.add(srpm_po)
40           return srpms