1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-27 15:06:15 +01:00

- build: fix passing of commandline options and arguments to build.main(),

which was still using sys.argv
- build: use own api server as upstream URL in urllist. So far,
  api.opensuse.org was hardcoded in the download URL [#265211].
This commit is contained in:
Dr. Peter Poeml 2007-04-25 11:22:40 +00:00
parent b58b6e5a3f
commit 354c01be55
3 changed files with 14 additions and 9 deletions

View File

@ -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']:

View File

@ -1095,7 +1095,7 @@ class Osc(cmdln.Cmdln):
print line.strip()
return 1
osc.build.main(sys.argv[1:])
osc.build.main(opts, args)

View File

@ -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',