mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-26 04:02:11 +01:00
- osc build: make the --extra-pkgs option configurable via .oscrc.
Default is "extra-pkgs = vim gdb strace" -- and it can be overridden with -x '' on the commandline, or set to empty in the config. [bnc#345142] - make tilde expansion work on the packagecachedir setting
This commit is contained in:
parent
d3da0085a4
commit
cdab0b19ea
@ -288,6 +288,13 @@ def main(opts, argv):
|
|||||||
|
|
||||||
config['build-root'] = config['build-root'] % {'repo': repo, 'arch': arch}
|
config['build-root'] = config['build-root'] % {'repo': repo, 'arch': arch}
|
||||||
|
|
||||||
|
if not opts.extra_pkgs:
|
||||||
|
extra_pkgs = config['extra-pkgs']
|
||||||
|
elif opts.extra_pkgs == ['']:
|
||||||
|
extra_pkgs = None
|
||||||
|
else:
|
||||||
|
extra_pkgs = opts.extra_pkgs
|
||||||
|
|
||||||
print 'Getting buildinfo from server'
|
print 'Getting buildinfo from server'
|
||||||
bi_file = NamedTemporaryFile(suffix='.xml', prefix='buildinfo.', dir = '/tmp')
|
bi_file = NamedTemporaryFile(suffix='.xml', prefix='buildinfo.', dir = '/tmp')
|
||||||
try:
|
try:
|
||||||
@ -297,7 +304,7 @@ def main(opts, argv):
|
|||||||
repo,
|
repo,
|
||||||
arch,
|
arch,
|
||||||
specfile=open(spec).read(),
|
specfile=open(spec).read(),
|
||||||
addlist=opts.extra_pkgs))
|
addlist=extra_pkgs))
|
||||||
except urllib2.HTTPError, e:
|
except urllib2.HTTPError, e:
|
||||||
if e.code == 404:
|
if e.code == 404:
|
||||||
# check what caused the 404
|
# check what caused the 404
|
||||||
|
14
osc/conf.py
14
osc/conf.py
@ -63,6 +63,8 @@ DEFAULTS = { 'apisrv': 'https://api.opensuse.org/',
|
|||||||
'cookiejar': '~/.osc_cookiejar',
|
'cookiejar': '~/.osc_cookiejar',
|
||||||
# disable project tracking by default
|
# disable project tracking by default
|
||||||
'do_package_tracking': '0',
|
'do_package_tracking': '0',
|
||||||
|
# default for osc build
|
||||||
|
'extra-pkgs': 'vim gdb strace',
|
||||||
}
|
}
|
||||||
boolean_opts = ['debug', 'do_package_tracking', 'http_debug', 'post_mortem', 'traceback']
|
boolean_opts = ['debug', 'do_package_tracking', 'http_debug', 'post_mortem', 'traceback']
|
||||||
|
|
||||||
@ -84,6 +86,12 @@ new_conf_template = """
|
|||||||
# /srv/oscbuild/%%(repo)s-%%(arch)s
|
# /srv/oscbuild/%%(repo)s-%%(arch)s
|
||||||
#build-root = %(build-root)s
|
#build-root = %(build-root)s
|
||||||
|
|
||||||
|
# extra packages to install when building packages locally (osc build)
|
||||||
|
# this corresponds to osc build's -x option and can be overridden with that
|
||||||
|
# -x '' can also be given on the command line to override this setting, or
|
||||||
|
# you can have an empty setting here.
|
||||||
|
#extra-pkgs = vim gdb strace
|
||||||
|
|
||||||
# show info useful for debugging
|
# show info useful for debugging
|
||||||
#debug = 1
|
#debug = 1
|
||||||
|
|
||||||
@ -296,7 +304,11 @@ def get_config(override_conffile = None,
|
|||||||
except:
|
except:
|
||||||
raise oscerr.ConfigError('option %s requires an integer value' % i)
|
raise oscerr.ConfigError('option %s requires an integer value' % i)
|
||||||
|
|
||||||
packagecachedir = os.path.expanduser(config['packagecachedir'])
|
config['packagecachedir'] = os.path.expanduser(config['packagecachedir'])
|
||||||
|
|
||||||
|
config['extra-pkgs'] = [ i.strip(',') for i in config['extra-pkgs'].split() ]
|
||||||
|
if config['extra-pkgs'] == []:
|
||||||
|
config['extra-pkgs'] = None
|
||||||
|
|
||||||
# transform 'url1, url2, url3' form into a list
|
# transform 'url1, url2, url3' form into a list
|
||||||
if type(config['urllist']) == str:
|
if type(config['urllist']) == str:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user