1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-25 19:52:12 +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:
Dr. Peter Poeml 2008-07-12 12:06:23 +00:00
parent d3da0085a4
commit cdab0b19ea
2 changed files with 21 additions and 2 deletions

View File

@ -288,6 +288,13 @@ def main(opts, argv):
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'
bi_file = NamedTemporaryFile(suffix='.xml', prefix='buildinfo.', dir = '/tmp')
try:
@ -297,7 +304,7 @@ def main(opts, argv):
repo,
arch,
specfile=open(spec).read(),
addlist=opts.extra_pkgs))
addlist=extra_pkgs))
except urllib2.HTTPError, e:
if e.code == 404:
# check what caused the 404

View File

@ -63,6 +63,8 @@ DEFAULTS = { 'apisrv': 'https://api.opensuse.org/',
'cookiejar': '~/.osc_cookiejar',
# disable project tracking by default
'do_package_tracking': '0',
# default for osc build
'extra-pkgs': 'vim gdb strace',
}
boolean_opts = ['debug', 'do_package_tracking', 'http_debug', 'post_mortem', 'traceback']
@ -84,6 +86,12 @@ new_conf_template = """
# /srv/oscbuild/%%(repo)s-%%(arch)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
#debug = 1
@ -296,7 +304,11 @@ def get_config(override_conffile = None,
except:
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
if type(config['urllist']) == str: