From 62f50d267fd1f6e5c2a78ac88dda9bd305900cdf Mon Sep 17 00:00:00 2001 From: Max Lin Date: Fri, 10 Mar 2017 18:39:43 +0800 Subject: [PATCH] Make sure sub-package is build successful in FCC too --- fcc_submitter.py | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/fcc_submitter.py b/fcc_submitter.py index 4874b1ed..9a9c7267 100755 --- a/fcc_submitter.py +++ b/fcc_submitter.py @@ -245,10 +245,16 @@ class FccSubmitter(object): return None raise e root = ET.fromstring(http_GET(url).read()) + data = {} linkinfo = root.find('linkinfo') + if linkinfo: + data['linkinfo'] = linkinfo.attrib['package'] + files = [ entry.get('name').replace('.spec', '') for entry in root.findall('entry') if entry.get('name').endswith('.spec') ] - if linkinfo is not None and len(files) > 1: - return linkinfo.attrib['package'] + data['specs'] = files + + if len(files) > 1: + return data else: return False @@ -316,29 +322,39 @@ class FccSubmitter(object): for i in range(0, min(int(self.submit_limit), len(succeeded_packages))): package = succeeded_packages[i] + submit_ok = True if package in deleted_packages: logging.info('%s has been dropped from %s, ignore it!'%(package, self.to_prj)) - continue + submit_ok = False if self.is_sle_base_pkgs(package) is True: logging.info('%s origin from SLE base, skip for now!'%package) - continue + submit_ok = False # make sure it is new package new_pkg = self.is_new_package(self.to_prj, package) if new_pkg is not True: logging.info('%s is not a new package, do not submit.' % package) - continue + submit_ok = False multi_specs = self.check_multiple_specfiles(self.factory, package) if multi_specs is None: logging.info('%s does not exist in %s'%(package, 'openSUSE:Factory')) - continue + submit_ok = False if multi_specs: - logging.info('%s in %s have multiple specs, it is linked to %s, skip it!'%(package, 'openSUSE:Factory', multi_specs)) - ms_packages.append(package) + if multi_specs['linkinfo']: + logging.info('%s in %s is sub-package of %s, skip it!'%(package, 'openSUSE:Factory', multi_specs['linkinfo'])) + ms_packages.append(package) + submit_ok = False + + for spec in multi_specs['specs']: + if spec not in succeeded_packages: + logging.info('%s is sub-pacakge of %s but build failed, skip it!'%(spec, package)) + submit_ok = False + + if not submit_ok: continue # make sure the package non-exist in target yet ie. expand=False