1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-14 01:26:23 +01:00

- build: use the apiurl which is stored in the storedir (.osc/_apiurl)

when running osc build.
  This should fix bug #355144
This commit is contained in:
Marcus Hüwe 2008-01-23 19:37:44 +00:00
parent 646be729e7
commit 0e9e76ea68

View File

@ -43,7 +43,7 @@ if hostarch == 'i686': # FIXME
class Buildinfo:
"""represent the contents of a buildinfo file"""
def __init__(self, filename):
def __init__(self, filename, apiurl=config['apiurl']):
try:
tree = ET.parse(filename)
@ -60,6 +60,14 @@ class Buildinfo:
sys.stderr.write(error + '\n')
sys.exit(1)
if apiurl.startswith('https://') or apiurl.startswith('http://'):
import urlparse
scheme, netloc, path = urlparse.urlsplit(apiurl)[0:3]
apisrv = netloc+path
else:
print >>sys.stderr, 'invalid protocol for the apiurl: \'%s\'' % apiurl
sys.exit(1)
# are we building .rpm or .deb?
# need the right suffix for downloading
# if a package named debhelper is in the dependencies, it must be .deb
@ -82,7 +90,9 @@ class Buildinfo:
node.get('preinstall'),
node.get('runscripts'),
self.buildarch, # buildarch is used only for the URL to access the full tree...
self.pacsuffix)
self.pacsuffix,
scheme,
apisrv)
self.deps.append(p)
self.preinstall_list = [ dep.name for dep in self.deps if dep.preinstall ]
@ -105,7 +115,7 @@ class Buildinfo:
class Pac:
"""represent a package to be downloaded"""
def __init__(self, name, version, release, project, repository, arch,
preinstall, runscripts, buildarch, pacsuffix):
preinstall, runscripts, buildarch, pacsuffix, scheme=config['scheme'], apisrv=config['apisrv']):
self.name = name
self.version = version
@ -131,8 +141,8 @@ class Pac:
self.mp['buildarch'] = self.buildarch
self.mp['pacsuffix'] = self.pacsuffix
self.mp['scheme'] = config['scheme']
self.mp['apisrv'] = config['apisrv']
self.mp['scheme'] = scheme
self.mp['apisrv'] = apisrv
self.filename = '%(name)s-%(version)s-%(release)s.%(arch)s.%(pacsuffix)s' % self.mp
@ -277,7 +287,7 @@ def main(opts, argv):
bi_file.write(bi_text)
bi_file.flush()
bi = Buildinfo(bi_file.name)
bi = Buildinfo(bi_file.name, store_read_apiurl(os.curdir))
rpmlist_prefers = []
if opts.prefer_pkgs: