1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-26 09:56:13 +01:00

[osc] allow expansion of %(apihost)s also as part of setting

packagecachedir in .oscrc so we can have caches per apihost
This commit is contained in:
Martin Mohring 2011-04-14 21:54:00 +02:00
parent bba8272595
commit b0ddeb909d

View File

@ -359,6 +359,7 @@ def main(apiurl, opts, argv):
build_descr = argv[2] build_descr = argv[2]
xp = [] xp = []
build_root = None build_root = None
cache_dir = None
build_uid='' build_uid=''
vm_type = config['build-type'] vm_type = config['build-type']
@ -467,6 +468,8 @@ def main(apiurl, opts, argv):
build_root = config['build-root'] % {'repo': repo, 'arch': arch, build_root = config['build-root'] % {'repo': repo, 'arch': arch,
'project': prj, 'package': pacname, 'apihost': apihost} 'project': prj, 'package': pacname, 'apihost': apihost}
cache_dir = config['packagecachedir'] % {'apihost': apihost}
extra_pkgs = [] extra_pkgs = []
if not opts.extra_pkgs: if not opts.extra_pkgs:
extra_pkgs = config['extra-pkgs'] extra_pkgs = config['extra-pkgs']
@ -650,7 +653,7 @@ def main(apiurl, opts, argv):
if opts.disable_cpio_bulk_download: if opts.disable_cpio_bulk_download:
urllist.append( '%(apiurl)s/build/%(project)s/%(repository)s/%(repoarch)s/%(repopackage)s/%(repofilename)s' ) urllist.append( '%(apiurl)s/build/%(project)s/%(repository)s/%(repoarch)s/%(repopackage)s/%(repofilename)s' )
fetcher = Fetcher(cachedir = config['packagecachedir'], fetcher = Fetcher(cache_dir,
urllist = urllist, urllist = urllist,
api_host_options = config['api_host_options'], api_host_options = config['api_host_options'],
offline = opts.noinit or opts.offline, offline = opts.noinit or opts.offline,
@ -684,7 +687,7 @@ def main(apiurl, opts, argv):
for i in range(0, len(a)): for i in range(0, len(a)):
data[i] = a[i] data[i] = a[i]
destdir = os.path.join(config['packagecachedir'], data[0], data[2], data[3]) destdir = os.path.join(cache_dir, data[0], data[2], data[3])
old_pkg_dir = None old_pkg_dir = None
try: try:
print "Downloading previous build from %s ..." % '/'.join(data) print "Downloading previous build from %s ..." % '/'.join(data)