make repo_id an option to buildSRPMFromSCM for consistency with buildArch, but make it non-optional

This commit is contained in:
Mike Bonnet 2009-01-28 10:45:06 -05:00
parent ef3b090424
commit 6199ad1b95
2 changed files with 9 additions and 3 deletions

View file

@ -1697,7 +1697,7 @@ class BuildTask(BaseTaskHandler):
def getSRPMFromSCM(self, url, build_tag, repo_id):
#TODO - allow different ways to get the srpm
task_id = session.host.subtask(method='buildSRPMFromSCM',
arglist=[url, build_tag, repo_id],
arglist=[url, build_tag, {'repo_id': repo_id}],
label='srpm',
parent=self.id)
# wait for subtask to finish
@ -2002,13 +2002,19 @@ class BuildSRPMFromSCMTask(BaseTaskHandler):
if re.match("%%define\s+%s\s+" % tag, spec, re.M):
raise koji.BuildError, "%s is not allowed to be defined in spec file" % tag
def handler(self, url, build_tag, repo_id):
def handler(self, url, build_tag, opts=None):
global options
# will throw a BuildError if the url is invalid
scm = SCM(url)
scm.assert_allowed(options.allowed_scms)
if not opts:
opts = {}
repo_id = opts.get('repo_id')
if not repo_id:
raise koji.BuildError, "A repo id must be provided"
repo_info = session.repoInfo(repo_id, strict=True)
event_id = repo_info['create_event']
build_tag = session.getTag(build_tag, strict=True, event=event_id)

View file

@ -71,7 +71,7 @@
<strong>Build Tag:</strong>: <a href="taginfo?tagID=$buildTag.name">$buildTag.name</a><br/>
#end if
#if $len($params) > 2
<strong>Repo ID:</strong>: $params[2]<br/>
$printOpts($params[2])
#end if
#elif $task.method == 'buildSRPMFromCVS'
<strong>CVS URL:</strong> $params[0]