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:
parent
b58b6e5a3f
commit
354c01be55
19
osc/build.py
19
osc/build.py
@ -17,6 +17,7 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
import cElementTree as ET
|
import cElementTree as ET
|
||||||
|
|
||||||
|
from conf import config
|
||||||
|
|
||||||
change_personality = {
|
change_personality = {
|
||||||
'i686': 'linux32',
|
'i686': 'linux32',
|
||||||
@ -117,6 +118,9 @@ class Pac:
|
|||||||
self.mp['buildarch'] = self.buildarch
|
self.mp['buildarch'] = self.buildarch
|
||||||
self.mp['pacsuffix'] = self.pacsuffix
|
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.filename = '%(name)s-%(version)s-%(release)s.%(arch)s.%(pacsuffix)s' % self.mp
|
||||||
|
|
||||||
self.mp['filename'] = self.filename
|
self.mp['filename'] = self.filename
|
||||||
@ -161,15 +165,16 @@ def get_built_files(pacdir, pactype):
|
|||||||
return s_built, b_built
|
return s_built, b_built
|
||||||
|
|
||||||
|
|
||||||
def main(argv):
|
def main(opts, argv):
|
||||||
|
|
||||||
from conf import config
|
repo = argv[0]
|
||||||
|
arch = argv[1]
|
||||||
repo = argv[1]
|
spec = argv[2]
|
||||||
arch = argv[2]
|
|
||||||
spec = argv[3]
|
|
||||||
buildargs = []
|
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
|
# make it possible to override configuration of the rc file
|
||||||
for var in ['OSC_PACKAGECACHEDIR', 'OSC_SU_WRAPPER', 'BUILD_ROOT', 'OSC_BUILD_ROOT']:
|
for var in ['OSC_PACKAGECACHEDIR', 'OSC_SU_WRAPPER', 'BUILD_ROOT', 'OSC_BUILD_ROOT']:
|
||||||
|
@ -1095,7 +1095,7 @@ class Osc(cmdln.Cmdln):
|
|||||||
print line.strip()
|
print line.strip()
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
osc.build.main(sys.argv[1:])
|
osc.build.main(opts, args)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ DEFAULTS = { 'apisrv': 'https://api.opensuse.org/',
|
|||||||
# the normal repo server, redirecting to mirrors
|
# the normal repo server, redirecting to mirrors
|
||||||
'http://software.opensuse.org/download/%(project)s/%(repository)s/%(arch)s/%(filename)s',
|
'http://software.opensuse.org/download/%(project)s/%(repository)s/%(arch)s/%(filename)s',
|
||||||
# direct access to "full" tree
|
# 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',
|
'http_debug': '0',
|
||||||
|
Loading…
Reference in New Issue
Block a user