diff options
authorWadim Egorov <>2019-03-18 11:10:54 +0100
committerStefan Müller-Klieser <>2019-04-09 11:08:58 +0200
commited10b341fb5d121c21e7ffc4dc32ab91b3acf604 (patch)
parenta9ef1c4b13055039920f0f030cd4e3e5db1963f2 (diff)
scripts: switch_machine: Fallback to UNASSIGNED for emtpy build list
Yocto builds that do not support any builds by "SUPPORTEDIMAGE" will throw the following error: Traceback (most recent call last): File "./sources/meta-phytec/scripts/", line 103, in <module> main() File "./sources/meta-phytec/scripts/", line 98, in main if not bsp.switch_machine(args.machine, args.distro): File "./sources/meta-phytec/scripts/", line 27, in switch_machine min_len_machines = min(len(build[0]) for build in builds) ValueError: min() arg is an empty sequence Instead of crashing it is better to do nothing and keep the machine as "UNASSIGNED". Maybe this can be handled properly by the with a dummy supported_build that gets selected if we have no builds at all. Signed-off-by: Wadim Egorov <> Signed-off-by: Stefan Müller-Klieser <>
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/ b/scripts/
index 9421b3f..e89c03a 100755
--- a/scripts/
+++ b/scripts/
@@ -22,6 +22,9 @@ class BSP_Switcher(BoardSupportPackage):
return self.write_machine_to_localconf()
builds = self.supported_builds
+ if builds == []:
+ print("No build/machine supported.")
+ return self.write_machine_to_localconf()
min_len_machines = min(len(build[0]) for build in builds)