Skip to content

Commit

Permalink
- use hostarch from buildconfig instead of own architecture guessing
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianschroeter committed Feb 9, 2012
1 parent ba08ccb commit 39b85af
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions osc/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
'sparcv8': 'linux32',
}

# FIXME: qemu_can_build should not be needed anymore since OBS 2.3
qemu_can_build = [ 'armv4l', 'armv5el', 'armv5l', 'armv6l', 'armv7l', 'armv6el', 'armv7el', 'armv7hl', 'armv8el',
'sh4', 'mips', 'mipsel',
'ppc', 'ppc64',
Expand Down Expand Up @@ -106,6 +107,10 @@ def __init__(self, filename, apiurl, buildtype = 'spec', localpkgs = []):
self.pacsuffix = 'deb'

self.buildarch = root.find('arch').text
if root.find('hostarch') != None:
self.hostarch = root.find('hostarch').text
else:
self.hostarch = None
if root.find('release') != None:
self.release = root.find('release').text
else:
Expand Down Expand Up @@ -624,12 +629,17 @@ def main(apiurl, opts, argv):
# real arch of this machine
# vs.
# arch we are supposed to build for
if hostarch != bi.buildarch:
if bi.hostarch != None:
if hostarch != bi.hostarch and not hostarch in can_also_build.get(hostarch, []):
print >>sys.stderr, 'Error: hostarch \'%s\' is required.' % (bi.hostarch)
return 1
elif hostarch != bi.buildarch:
if not bi.buildarch in can_also_build.get(hostarch, []):
# OBSOLETE: qemu_can_build should not be needed anymore since OBS 2.3
if not bi.buildarch in qemu_can_build:
print >>sys.stderr, 'Error: hostarch \'%s\' cannot build \'%s\'.' % (hostarch, bi.buildarch)
return 1
print >>sys.stderr, 'WARNING: hostarch \'%s\' can build \'%s\' only via QEMU.' % (hostarch, bi.buildarch)
print >>sys.stderr, 'WARNING: It is guessed to build on hostarch \'%s\' for \'%s\' via QEMU.' % (hostarch, bi.buildarch)

rpmlist_prefers = []
if prefer_pkgs:
Expand Down

0 comments on commit 39b85af

Please sign in to comment.