summaryrefslogtreecommitdiffstats
path: root/BaseTools
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2016-04-14 23:03:45 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2016-04-15 08:41:21 +0800
commit67a69059f714c0728676d13d97f10bd12730b378 (patch)
tree582c8448ccd01e35ab43d9738d64230e14fbc5bc /BaseTools
parent61b02ba1f2a3f80fa06f5006f0aea1572093a067 (diff)
downloadedk2-67a69059f714c0728676d13d97f10bd12730b378.tar.gz
edk2-67a69059f714c0728676d13d97f10bd12730b378.tar.bz2
edk2-67a69059f714c0728676d13d97f10bd12730b378.zip
BaseTools: Fix the bug to correctly handle the [BuildOptions]
the last fix call os.path.normpath() function, which removes the trailing slash character, it cause NASM failure for ResetVector driver. Cc: Liming Gao <liming.gao@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools')
-rw-r--r--BaseTools/Source/Python/Common/MultipleWorkspace.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/BaseTools/Source/Python/Common/MultipleWorkspace.py b/BaseTools/Source/Python/Common/MultipleWorkspace.py
index 4e4c37ae13..2a76d49cc6 100644
--- a/BaseTools/Source/Python/Common/MultipleWorkspace.py
+++ b/BaseTools/Source/Python/Common/MultipleWorkspace.py
@@ -131,13 +131,16 @@ class MultipleWorkspace(object):
PathList = PathStr.split()
if PathList:
for i, str in enumerate(PathList):
- if str.find(TAB_WORKSPACE) != -1:
- MacroStartPos = str.find(TAB_WORKSPACE)
- MacroEndPos = str.find(')', MacroStartPos)
- Substr = str[MacroEndPos+1:]
- if Substr.startswith('/') or Substr.startswith('\\'):
- Substr = Substr[1:]
- PathList[i] = str[0:MacroStartPos] + os.path.normpath(cls.join(cls.WORKSPACE, Substr))
+ MacroStartPos = str.find(TAB_WORKSPACE)
+ if MacroStartPos != -1:
+ Substr = str[MacroStartPos:]
+ Path = Substr.replace(TAB_WORKSPACE, cls.WORKSPACE).strip()
+ if not os.path.exists(Path):
+ for Pkg in cls.PACKAGES_PATH:
+ Path = Substr.replace(TAB_WORKSPACE, Pkg).strip()
+ if os.path.exists(Path):
+ break
+ PathList[i] = str[0:MacroStartPos] + Path
PathStr = ' '.join(PathList)
return PathStr