From c1cf6a8d8d3e06a2ba9b90b6a8c48ac885faa057 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Tue, 16 Apr 2013 15:42:37 +0200 Subject: [PATCH] - fix the general architecture detection for incomplete "osc build" lines Conflicts: osc/commandline.py --- osc/build.py | 3 --- osc/commandline.py | 11 +++++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/osc/build.py b/osc/build.py index fbc2eedc..c5f5c7c4 100644 --- a/osc/build.py +++ b/osc/build.py @@ -45,8 +45,6 @@ qemu_can_build = [ 'armv4l', 'armv5el', 'armv5l', 'armv6l', 'armv7l', 'armv6el', ] can_also_build = { - 'aarch64':['aarch64'], - 'armv4l': [ 'armv4l' ], 'armv6l' :[ 'armv4l', 'armv5l', 'armv6l', 'armv5el', 'armv6el' ], 'armv7l' :[ 'armv4l', 'armv5l', 'armv6l', 'armv7l', 'armv5el', 'armv6el', 'armv7el' ], 'armv5el':[ 'armv4l', 'armv5l', 'armv5el' ], # not existing arch, just for compatibility @@ -58,7 +56,6 @@ can_also_build = { 'armv5tel':[ 'armv4l', 'armv5el', 'armv5tel' ], 's390x': ['s390' ], 'ppc64': [ 'ppc', 'ppc64' ], - 'sh4': [ 'sh4' ], 'i586': [ 'i386' ], 'i686': [ 'i586', 'i386' ], 'x86_64': ['i686', 'i586', 'i386' ], diff --git a/osc/commandline.py b/osc/commandline.py index 6f8c9c54..19383b92 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -5094,13 +5094,20 @@ Please submit there instead, or use --nodevelproject to force direct submission. import glob arg_arch = arg_repository = arg_descr = None if len(args) < 3: + # some magic, works only sometimes, but people seem to like it :/ + all_archs = [] + for mainarch in osc.build.can_also_build: + all_archs.append(mainarch) + for subarch in osc.build.can_also_build.get(mainarch): + all_archs.append(subarch) for arg in args: if arg.endswith('.spec') or arg.endswith('.dsc') or arg.endswith('.kiwi') or arg == 'PKGBUILD': arg_descr = arg else: - if (arg == osc.build.hostarch or osc.build.can_also_build.get(arg) != None) and arg_arch is None: + if (arg == osc.build.hostarch or arg in all_archs) and arg_arch is None: + # it seems to be an architecture in general arg_arch = arg - if not (arg in osc.build.can_also_build.get(osc.build.hostarch, []) or arg == osc.build.hostarch): + if not (arg in osc.build.can_also_build.get(osc.build.hostarch) or arg == osc.build.hostarch): print "WARNING: native compile is not possible, an emulator must be configured!" elif not arg_repository: arg_repository = arg