Fix toolchain validation in case of multiple occurrences of the characters "gcc"...
authorrasky <rasky@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 24 Aug 2010 12:38:03 +0000 (12:38 +0000)
committerrasky <rasky@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 24 Aug 2010 12:38:03 +0000 (12:38 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4192 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/bertos_utils.py
wizard/toolchain_validation.py

index dffa2ab843094373b291494513d751418adc4363..3c0fba640fd537e52b11a3dda73be7ff277cd5e2 100644 (file)
@@ -193,8 +193,8 @@ def mkGenerator(project_info):
             cpu_mk_parameters.append("%s = %s" %(key.replace("MK", mk_data["$pname"]), value))
     mk_data["$cpuparameters"] = "\n".join(cpu_mk_parameters)
     mk_data["$csrc"], mk_data["$pcsrc"], mk_data["$cppasrc"], mk_data["$cxxsrc"], mk_data["$asrc"], mk_data["$constants"] = csrcGenerator(project_info)
-    mk_data["$prefix"] = replaceSeparators(project_info.info("TOOLCHAIN")["path"].split("gcc")[0])
-    mk_data["$suffix"] = replaceSeparators(project_info.info("TOOLCHAIN")["path"].split("gcc")[1])
+    mk_data["$prefix"] = replaceSeparators(project_info.info("TOOLCHAIN")["path"].rsplit("gcc", 1)[0])
+    mk_data["$suffix"] = replaceSeparators(project_info.info("TOOLCHAIN")["path"].rsplit("gcc", 1)[1])
     mk_data["$hwpath"] = relpath.relpath(project_info.info("PROJECT_HW_PATH"), project_info.info("PROJECT_PATH"))
     for key in mk_data:
         makefile = makefile.replace(key, mk_data[key])
index e6386ee610796cb831b7ce577aed93c4e6af654b..34809a0d6187e7cb190fa026d0d56e03c2990349 100644 (file)
@@ -45,7 +45,9 @@ def validateToolchain(toolchain):
     if not os.path.exists(toolchain):
         return {}
     for tool in TOOLCHAIN_ITEMS:
-        if not os.path.exists(toolchain.replace("gcc", tool)):
+        toolchainpre  = toolchain.rsplit("gcc", 1)[0]
+        toolchainpost = toolchain.rsplit("gcc", 1)[1]
+        if not os.path.exists(toolchainpre + tool + toolchainpost):
             return {}
     validation_process = QProcess()
     validation_process.start(toolchain, ["-v"])