Fix suitable toolchain finding process.
authorbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 29 Apr 2010 12:37:58 +0000 (12:37 +0000)
committerbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 29 Apr 2010 12:37:58 +0000 (12:37 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3571 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BRoutePage.py
wizard/toolchain_manager.py

index b34f790050986e74fab5d39588993afa6c341478..d8e6d3707e38512d7ce7ffb6562e1766b3c74edd 100644 (file)
@@ -78,18 +78,19 @@ class BRoutePage(BWizardPage):
             cpu_info = self.projectInfo("CPU_INFOS")
             if cpu_info:
                 target = cpu_info["TOOLCHAIN"]
+                # Try to find a suitable toolchain automatically
+                tm = ToolchainManager()
+                suitable_toolchains = tm.suitableToolchains(target)
+                if len(suitable_toolchains) == 1:
+                    return self.wizard().pageIndex(BOutputPage)
+                else:
+                    return self.wizard().pageIndex(BToolchainPage)
             else:
                 # It seems that the nextId method is called before the
                 # reloadData one (that is called after the page changing.
                 #
                 # TODO: fix this awful code lines
                 target = None
-            # Try to find a suitable toolchain automatically
-            tm = ToolchainManager()
-            suitable_toolchains = tm.suitableToolchains(target)
-            if len(suitable_toolchains) == 1:
-                return self.wizard().pageIndex(BOutputPage)
-            else:
                 return self.wizard().pageIndex(BToolchainPage)
 
     ####
index 8f18d9a9a59b65ecd4ebcb3cc00474a8703a34a4..6b6f359ed10224dbe37cd51f88bf850356ae1464 100755 (executable)
@@ -127,7 +127,8 @@ class ToolchainManager(object):
         toolchains = self.toolchains
         suitable_toolchains = []
         for name, info in toolchains:
-            if info and info.get('target', None) == target:
+            t = info.get("target", None)
+            if t and t.find(target) != -1:
                 suitable_toolchains.append(name)
         return suitable_toolchains