mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-05 03:38:12 +08:00
Move also distgit_src_get command to config
This commit is contained in:
@@ -446,18 +446,19 @@ class SCMBuilder(BaseBuilder):
|
||||
super(SCMBuilder, self).__init__(config, resultsdir)
|
||||
with open(config, "a") as f:
|
||||
branch = source.split("?#")[1]
|
||||
dist_git_get = self._get_clone_command(source).format(artifact_name)
|
||||
distgit_cmds = self._get_distgit_commands(source)
|
||||
distgit_get = distgit_cmds[0].format(artifact_name)
|
||||
f.writelines([
|
||||
"config_opts['scm'] = True\n",
|
||||
"config_opts['scm_opts']['method'] = 'distgit'\n",
|
||||
"config_opts['scm_opts']['branch'] = '{}'\n".format(branch),
|
||||
"config_opts['scm_opts']['package'] = '{}'\n".format(artifact_name),
|
||||
"config_opts['scm_opts']['distgit_get'] = '{}'\n".format(dist_git_get),
|
||||
"config_opts['scm_opts']['distgit_src_get'] = 'fedpkg sources'\n",
|
||||
"config_opts['scm_opts']['distgit_get'] = '{}'\n".format(distgit_get),
|
||||
"config_opts['scm_opts']['distgit_src_get'] = '{}'\n".format(distgit_cmds[1]),
|
||||
])
|
||||
|
||||
def _get_clone_command(self, source):
|
||||
for host, cmd in conf.distgits.items():
|
||||
def _get_distgit_commands(self, source):
|
||||
for host, cmds in conf.distgits.items():
|
||||
if source.startswith(host):
|
||||
return cmd
|
||||
raise KeyError("No defined command for {}".format(source))
|
||||
return cmds
|
||||
raise KeyError("No defined commands for {}".format(source))
|
||||
|
||||
@@ -289,7 +289,7 @@ class Config(object):
|
||||
'distgits': {
|
||||
'type': dict,
|
||||
'default': {
|
||||
'git://pkgs.fedoraproject.org': 'fedpkg clone --anonymous {}',
|
||||
'git://pkgs.fedoraproject.org': ('fedpkg clone --anonymous {}', 'fedpkg sources'),
|
||||
},
|
||||
'desc': 'Mapping between dist-git and command to '},
|
||||
'mock_config': {
|
||||
|
||||
Reference in New Issue
Block a user