From b097f95a87e2b5c00e2b6db32806c21a2db9b992 Mon Sep 17 00:00:00 2001 From: rasky Date: Tue, 24 Aug 2010 12:38:03 +0000 Subject: [PATCH] Fix toolchain validation in case of multiple occurrences of the characters "gcc" in the pathname. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4192 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/bertos_utils.py | 4 ++-- wizard/toolchain_validation.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index dffa2ab8..3c0fba64 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -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]) diff --git a/wizard/toolchain_validation.py b/wizard/toolchain_validation.py index e6386ee6..34809a0d 100644 --- a/wizard/toolchain_validation.py +++ b/wizard/toolchain_validation.py @@ -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"]) -- 2.25.1