mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-28 02:36:15 +01:00
- determine pacsuffix from buildtype (slightly modified version of David Greaves' <david@dgreaves.com> patch)
This commit is contained in:
parent
ddd9e0206d
commit
b742d58794
16
osc/build.py
16
osc/build.py
@ -53,7 +53,7 @@ if hostarch == 'i686': # FIXME
|
|||||||
class Buildinfo:
|
class Buildinfo:
|
||||||
"""represent the contents of a buildinfo file"""
|
"""represent the contents of a buildinfo file"""
|
||||||
|
|
||||||
def __init__(self, filename, apiurl):
|
def __init__(self, filename, apiurl, buildtype = 'spec'):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
tree = ET.parse(filename)
|
tree = ET.parse(filename)
|
||||||
@ -73,15 +73,13 @@ class Buildinfo:
|
|||||||
if not (apiurl.startswith('https://') or apiurl.startswith('http://')):
|
if not (apiurl.startswith('https://') or apiurl.startswith('http://')):
|
||||||
raise urllib2.URLError('invalid protocol for the apiurl: \'%s\'' % apiurl)
|
raise urllib2.URLError('invalid protocol for the apiurl: \'%s\'' % apiurl)
|
||||||
|
|
||||||
# are we building .rpm or .deb?
|
self.buildtype = buildtype
|
||||||
# need the right suffix for downloading
|
|
||||||
# if a package named debhelper is in the dependencies, it must be .deb
|
# are we building .rpm or .deb?
|
||||||
# XXX: shouldn't we deliver the type via the buildinfo?
|
# XXX: shouldn't we deliver the type via the buildinfo?
|
||||||
self.pacsuffix = 'rpm'
|
self.pacsuffix = 'rpm'
|
||||||
for node in root.findall('bdep'):
|
if self.buildtype == 'dsc':
|
||||||
if node.get('name') == 'debhelper':
|
self.pacsuffix = 'deb'
|
||||||
self.pacsuffix = 'deb'
|
|
||||||
break
|
|
||||||
|
|
||||||
self.buildarch = root.find('arch').text
|
self.buildarch = root.find('arch').text
|
||||||
self.downloadurl = root.get('downloadurl')
|
self.downloadurl = root.get('downloadurl')
|
||||||
@ -363,7 +361,7 @@ def main(opts, argv):
|
|||||||
bi_file.write(bi_text)
|
bi_file.write(bi_text)
|
||||||
bi_file.flush()
|
bi_file.flush()
|
||||||
|
|
||||||
bi = Buildinfo(bi_file.name, apiurl)
|
bi = Buildinfo(bi_file.name, apiurl, build_type)
|
||||||
if bi.debuginfo and not opts.disable_debuginfo:
|
if bi.debuginfo and not opts.disable_debuginfo:
|
||||||
buildargs.append('--debug')
|
buildargs.append('--debug')
|
||||||
buildargs = ' '.join(set(buildargs))
|
buildargs = ' '.join(set(buildargs))
|
||||||
|
Loading…
Reference in New Issue
Block a user