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>
This commit is contained in:
@ -131,13 +131,16 @@ class MultipleWorkspace(object):
|
|||||||
PathList = PathStr.split()
|
PathList = PathStr.split()
|
||||||
if PathList:
|
if PathList:
|
||||||
for i, str in enumerate(PathList):
|
for i, str in enumerate(PathList):
|
||||||
if str.find(TAB_WORKSPACE) != -1:
|
MacroStartPos = str.find(TAB_WORKSPACE)
|
||||||
MacroStartPos = str.find(TAB_WORKSPACE)
|
if MacroStartPos != -1:
|
||||||
MacroEndPos = str.find(')', MacroStartPos)
|
Substr = str[MacroStartPos:]
|
||||||
Substr = str[MacroEndPos+1:]
|
Path = Substr.replace(TAB_WORKSPACE, cls.WORKSPACE).strip()
|
||||||
if Substr.startswith('/') or Substr.startswith('\\'):
|
if not os.path.exists(Path):
|
||||||
Substr = Substr[1:]
|
for Pkg in cls.PACKAGES_PATH:
|
||||||
PathList[i] = str[0:MacroStartPos] + os.path.normpath(cls.join(cls.WORKSPACE, Substr))
|
Path = Substr.replace(TAB_WORKSPACE, Pkg).strip()
|
||||||
|
if os.path.exists(Path):
|
||||||
|
break
|
||||||
|
PathList[i] = str[0:MacroStartPos] + Path
|
||||||
PathStr = ' '.join(PathList)
|
PathStr = ' '.join(PathList)
|
||||||
return PathStr
|
return PathStr
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user