From e8fbfd4c928dfc23368ba78fdbc531dddb7db2b9 Mon Sep 17 00:00:00 2001 From: batt Date: Tue, 27 Apr 2010 10:52:44 +0000 Subject: [PATCH] Fix problems with older BeRTOS versions. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3536 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/BProject.py | 3 +-- wizard/bertos_utils.py | 11 ++++++----- wizard/mktemplates/template.mk | 9 ++------- wizard/mktemplates/template_user.mk | 11 ++--------- 4 files changed, 11 insertions(+), 23 deletions(-) diff --git a/wizard/BProject.py b/wizard/BProject.py index b3116d70..79e4477f 100644 --- a/wizard/BProject.py +++ b/wizard/BProject.py @@ -86,8 +86,7 @@ class BProject(object): # NOTE: this can throw an Exception if the user has changed the directory containing the project self.infos["PROJECT_NAME"] = project_data.get("PROJECT_NAME", os.path.basename(project_dir)) self.infos["PROJECT_PATH"] = os.path.dirname(project_file) - project_src_path = project_data.get("PROJECT_SRC_PATH", None) - project_src_path = os.path.join(project_dir, project_data.get("PROJECT_SRC_PATH", None)) + project_src_path = os.path.join(project_dir, project_data.get("PROJECT_SRC_PATH", project_data["PROJECT_NAME"])) if project_src_path: self.infos["PROJECT_SRC_PATH"] = project_src_path diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index c0dc0867..493ffbe2 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -283,12 +283,13 @@ def findModuleFiles(module, project_info): try: version_string = bertosVersion(project_info.info("BERTOS_PATH")) version_list = [int(i) for i in version_string.split()[-1].split('.')] - if version_list < [2, 5]: - # For older versions of BeRTOS add the toolchain to the tags - tags.append(project_info.info("CPU_INFOS")["TOOLCHAIN"]) except ValueError: - # If the version file hasn't a valid version number do nothing - pass + # If the version file hasn't a valid version number assume it's an older + # project. + version_list = [0, 0] + if version_list < [2, 5]: + # For older versions of BeRTOS add the toolchain to the tags + tags.append(project_info.info("CPU_INFOS")["TOOLCHAIN"]) for tag in tags: for filename, path in project_info.searchFiles(module + "_" + tag + ".c"): diff --git a/wizard/mktemplates/template.mk b/wizard/mktemplates/template.mk index ca87743f..3fff1294 100644 --- a/wizard/mktemplates/template.mk +++ b/wizard/mktemplates/template.mk @@ -1,11 +1,6 @@ # -# Copyright 2009 Develer S.r.l. (http://www.develer.com/) -# All rights reserved. -# -# Makefile template for BeRTOS wizard. -# -# Author: Lorenzo Berni -# +# Wizard autogenerated makefile. +# DO NOT EDIT, use the $pname_user.mk file instead. # # Constants automatically defined by the selected modules diff --git a/wizard/mktemplates/template_user.mk b/wizard/mktemplates/template_user.mk index 230efd58..d0a87242 100644 --- a/wizard/mktemplates/template_user.mk +++ b/wizard/mktemplates/template_user.mk @@ -1,11 +1,6 @@ # -# Copyright 2009 Develer S.r.l. (http://www.develer.com/) -# All rights reserved. -# -# Makefile template for BeRTOS wizard. -# -# Author: Lorenzo Berni -# +# User makefile. +# Edit this file to change compiler options and related stuff. # # Programmer interface configuration, see http://dev.bertos.org/wiki/ProgrammerInterface for help @@ -46,5 +41,3 @@ $pname_USER_CPPFLAGS = \ -fno-strict-aliasing \ -fwrapv \ # - -# Include the mk file generated by the wizard -- 2.25.1