1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-20 17:26:15 +02:00

osc build: moved the architecture check more to the top. Now we first check

whether we can build for the target architecture, *before* we start downloading
packges.
This commit is contained in:
Dr. Peter Poeml 2008-08-15 14:04:27 +00:00
parent d58fffc7b6
commit f82ea05051

View File

@ -331,6 +331,14 @@ def main(opts, argv):
bi = Buildinfo(bi_file.name, store_read_apiurl(os.curdir))
# real arch of this machine
# vs.
# arch we are supposed to build for
if hostarch != bi.buildarch:
if not bi.buildarch in can_also_build.get(hostarch, []):
print >>sys.stderr, 'Error: hostarch \'%s\' cannot build \'%s\'.' % (hostarch, bi.buildarch)
return 1
rpmlist_prefers = []
if opts.prefer_pkgs:
print 'Evaluating preferred packages'
@ -407,17 +415,9 @@ def main(opts, argv):
tmpl = '%s %s'
cmd = tmpl % (config['su-wrapper'], cmd)
# real arch of this machine
# vs.
# arch we are supposed to build for
# change personality, if needed
if hostarch != bi.buildarch:
# change personality, if needed
if bi.buildarch in can_also_build.get(hostarch, []):
cmd = change_personality[bi.buildarch] + ' ' + cmd
else:
print >>sys.stderr, 'Error: hostarch \'%s\' cannot build \'%s\'.' % (hostarch, bi.buildarch)
return 1
cmd = change_personality[bi.buildarch] + ' ' + cmd
print cmd
rc = os.system(cmd)