From 8acd18874fd5d8708e1a5477ea19d24a96bd5fae Mon Sep 17 00:00:00 2001 From: Alberto Planas Date: Fri, 22 Aug 2014 09:56:05 +0200 Subject: [PATCH] Add a new check. When the SPEC file is different from the package name. --- osc-check_repo.py | 2 +- osclib/checkrepo.py | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/osc-check_repo.py b/osc-check_repo.py index b1f78599..9af12931 100644 --- a/osc-check_repo.py +++ b/osc-check_repo.py @@ -205,7 +205,7 @@ def _check_repo_group(self, id_, requests): execution_plan = defaultdict(list) - DEBUG_PLAN = 1 + DEBUG_PLAN = 0 # Get all the (project, repo, disturl) where the disturl is # compatible with the request. For the same package we can have diff --git a/osclib/checkrepo.py b/osclib/checkrepo.py index a6d82c10..fe7d05dd 100644 --- a/osclib/checkrepo.py +++ b/osclib/checkrepo.py @@ -407,8 +407,18 @@ class CheckRepo(object): specs = [en.attrib['name'][:-5] for en in root.findall('entry') if en.attrib['name'].endswith('.spec')] - # source checker validated it exists - specs.remove(rq.src_package) + # source checker already validated it + if rq.src_package in specs: + specs.remove(rq.src_package) + elif rq.tgt_package in specs: + specs.remove(rq.tgt_package) + else: + msg = 'The name of the SPEC files %s do not match with the name of the package (%s)' + msg = msg % (specs, rq.src_package) + print('DECLINED', msg) + self.change_review_state(request_id, 'declined', message=msg) + rq.updated = True + return requests # Makes sure that the .spec file builds properly.