parent
076d54c029
commit
8529a1baa3
1 changed files with 10 additions and 5 deletions
|
|
@ -60,6 +60,7 @@ import koji.rpmdiff
|
|||
import koji.tasks
|
||||
import koji.xmlrpcplus
|
||||
from koji.context import context
|
||||
from koji.daemon import SCM
|
||||
from koji.util import (
|
||||
base64encode,
|
||||
decode_bytes,
|
||||
|
|
@ -6901,16 +6902,20 @@ def merge_scratch(task_id):
|
|||
raise koji.ImportError('%s did not complete successfully' % build['nvr'])
|
||||
if not build['task_id']:
|
||||
raise koji.ImportError('no task for %s' % build['nvr'])
|
||||
build_task_info = Task(build['task_id']).getInfo(request=True)
|
||||
# Intentionally skip checking the build task state.
|
||||
# There are cases where the build can be valid even though the task has failed,
|
||||
# e.g. tagging failures.
|
||||
|
||||
# Compare SCM URLs only if build from an SCM
|
||||
if not task_info['request'][0].startswith('cli-build/'):
|
||||
build_task_info = Task(build['task_id']).getInfo(request=True)
|
||||
task_params = koji.tasks.parse_task_params(task_info['method'], task_info['request'])
|
||||
build_task_params = koji.tasks.parse_task_params(build_task_info['method'],
|
||||
build_task_info['request'])
|
||||
if 'src' in task_params and SCM.is_scm_url(task_params['src']):
|
||||
# compare the task and build and make sure they are compatible with importing
|
||||
if task_info['request'][0] != build_task_info['request'][0]:
|
||||
raise koji.ImportError('SCM URLs for the task and build do not match: %s, %s' % \
|
||||
(task_info['request'][0], build_task_info['request'][0]))
|
||||
if task_params['src'] != build_task_params['src']:
|
||||
raise koji.ImportError('SCM URLs for the task and build do not match: %s, %s' %
|
||||
(task_params['src'], build_task_params['src']))
|
||||
build_arches = set()
|
||||
for rpminfo in list_rpms(buildID=build['id']):
|
||||
if rpminfo['arch'] == 'src':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue