diff --git a/osc/build.py b/osc/build.py index a7334c74..973e0f2c 100644 --- a/osc/build.py +++ b/osc/build.py @@ -17,6 +17,7 @@ try: except ImportError: import cElementTree as ET +from conf import config change_personality = { 'i686': 'linux32', @@ -117,6 +118,9 @@ class Pac: self.mp['buildarch'] = self.buildarch self.mp['pacsuffix'] = self.pacsuffix + self.mp['scheme'] = config['scheme'] + self.mp['apisrv'] = config['apisrv'] + self.filename = '%(name)s-%(version)s-%(release)s.%(arch)s.%(pacsuffix)s' % self.mp self.mp['filename'] = self.filename @@ -161,15 +165,16 @@ def get_built_files(pacdir, pactype): return s_built, b_built -def main(argv): +def main(opts, argv): - from conf import config - - repo = argv[1] - arch = argv[2] - spec = argv[3] + repo = argv[0] + arch = argv[1] + spec = argv[2] buildargs = [] - buildargs += argv[4:] + if opts.clean: + buildargs.append('--clean') + if opts.noinit: + buildargs.append('--noinit') # make it possible to override configuration of the rc file for var in ['OSC_PACKAGECACHEDIR', 'OSC_SU_WRAPPER', 'BUILD_ROOT', 'OSC_BUILD_ROOT']: diff --git a/osc/commandline.py b/osc/commandline.py index 03a424ab..5ae6726b 100755 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -1095,7 +1095,7 @@ class Osc(cmdln.Cmdln): print line.strip() return 1 - osc.build.main(sys.argv[1:]) + osc.build.main(opts, args) diff --git a/osc/conf.py b/osc/conf.py index 384de73e..07388de0 100644 --- a/osc/conf.py +++ b/osc/conf.py @@ -53,7 +53,7 @@ DEFAULTS = { 'apisrv': 'https://api.opensuse.org/', # the normal repo server, redirecting to mirrors 'http://software.opensuse.org/download/%(project)s/%(repository)s/%(arch)s/%(filename)s', # direct access to "full" tree - 'http://api.opensuse.org/rpm/%(project)s/%(repository)s/_repository/%(buildarch)s/%(name)s', + '%(scheme)s://%(apisrv)s/rpm/%(project)s/%(repository)s/_repository/%(buildarch)s/%(name)s', ], 'http_debug': '0',