Add a new check. When the SPEC file is different from the package name.

This commit is contained in:
Alberto Planas 2014-08-22 09:56:05 +02:00
parent a65f4d5844
commit 8acd18874f
2 changed files with 13 additions and 3 deletions

View File

@ -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

View File

@ -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.