1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-09-05 20:58:42 +02:00

- added "build-jobs" config option (default: "getconf _NPROCESSORS_ONLN")

This commit is contained in:
Marcus Huewe
2010-01-09 14:56:55 +01:00
parent 5c8ee534a9
commit 90a92be0dd
2 changed files with 11 additions and 10 deletions

View File

@@ -306,9 +306,8 @@ def main(opts, argv):
if opts.jobs:
buildargs.append('--jobs %s' % opts.jobs)
else:
smp_mflags = os.sysconf('SC_NPROCESSORS_ONLN')
if smp_mflags > 1:
buildargs.append('--jobs %s' % smp_mflags)
if config['build-jobs'] > 1:
buildargs.append('--jobs %s' % config['build-jobs'])
if opts.icecream:
buildargs.append('--icecream %s' % opts.icecream)
xp.append('icecream')

View File

@@ -37,6 +37,7 @@ The configuration dictionary could look like this:
import OscConfigParser
from osc import oscerr
from oscsslexcp import NoSecureSSLError
import os
GENERIC_KEYRING = False
GNOME_KEYRING = False
@@ -68,11 +69,12 @@ DEFAULTS = { 'apiurl': 'https://api.opensuse.org',
# build type settings
'build-cmd': '/usr/bin/build',
'build-type' : '', # may be empty for chroot, kvm or xen
'build-type': '', # may be empty for chroot, kvm or xen
'build-root': '/var/tmp/build-root',
'build-device': '', # required for VM builds
'build-memory' : '',# required for VM builds
'build-swap' : '', # optional for VM builds
'build-memory': '',# required for VM builds
'build-swap': '', # optional for VM builds
'build-jobs': os.sysconf('SC_NPROCESSORS_ONLN'), # compile with N jobs
'debug': '0',
'http_debug': '0',
@@ -141,6 +143,9 @@ apiurl = %(apiurl)s
# /srv/oscbuild/%%(repo)s-%%(arch)s-%%(project)s-%%(package)s
#build-root = %(build-root)s
# compile with N jobs (default: "getconf _NPROCESSORS_ONLN")
#build-jobs = N
# 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
@@ -288,7 +293,6 @@ def init_basicauth(config):
"""initialize urllib2 with the credentials for Basic Authentication"""
from osc.core import __version__
import os
import cookielib
if config['api_host_options'][config['apiurl']]['sslcertck']:
@@ -374,7 +378,6 @@ def get_configParser(conffile=None, force_read=False):
ConfigParser object is stored in a method attribute and this attribute
is returned unless you pass force_read=True.
"""
import os
conffile = conffile or os.environ.get('OSC_CONFIG', '~/.oscrc')
conffile = os.path.expanduser(conffile)
if force_read or not get_configParser.__dict__.has_key('cp'):
@@ -389,7 +392,7 @@ def write_initial_config(conffile, entries, custom_template = ''):
for the config file (e.g. { 'user' : 'username', 'pass' : 'password' } ).
custom_template is an optional configuration template.
"""
import os, StringIO, sys
import StringIO, sys
conf_template = custom_template or new_conf_template
config = DEFAULTS.copy()
config.update(entries)
@@ -481,7 +484,6 @@ def get_config(override_conffile = None,
override_no_gnome_keyring = None,
override_verbose = None):
"""do the actual work (see module documentation)"""
import os
import sys
import re
global config