1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-12 16:56:15 +01:00

- added support for a per apiurl "build-root" option

Resolution order:
OSC_BUILD_ROOT env var > apiurl build-root option > general build-root option
This commit is contained in:
Marcus Huewe 2014-06-04 15:33:30 +02:00
parent e2abfe9e6a
commit 7efd6db501
2 changed files with 9 additions and 2 deletions

View File

@ -487,6 +487,7 @@ def main(apiurl, opts, argv):
if opts.shell:
buildargs.append("--shell")
orig_build_root = config['build-root']
# make it possible to override configuration of the rc file
for var in ['OSC_PACKAGECACHEDIR', 'OSC_SU_WRAPPER', 'OSC_BUILD_ROOT']:
val = os.getenv(var)
@ -508,11 +509,15 @@ def main(apiurl, opts, argv):
pacname = os.path.splitext(build_descr)[0]
apihost = urlsplit(apiurl)[1]
if not build_root:
build_root = config['build-root']
if build_root == orig_build_root:
# ENV var was not set
build_root = config['api_host_options'][apiurl].get('build-root', build_root)
try:
build_root = config['build-root'] % {'repo': repo, 'arch': arch,
build_root = build_root % {'repo': repo, 'arch': arch,
'project': prj, 'package': pacname, 'apihost': apihost}
except:
build_root = config['build-root']
pass
cache_dir = config['packagecachedir'] % {'apihost': apihost}

View File

@ -923,6 +923,8 @@ def get_config(override_conffile=None,
api_host_options[apiurl][key] = cp.getboolean(url, key)
else:
api_host_options[apiurl][key] = cp.get(url, key)
if cp.has_option(url, 'build-root', proper=True):
api_host_options[apiurl]['build-root'] = cp.get(url, 'build-root', raw=True)
if not 'sslcertck' in api_host_options[apiurl]:
api_host_options[apiurl]['sslcertck'] = True