X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FCommon%2FMultipleWorkspace.py;h=2a76d49cc627ad6cd96ceef1818cb2a7d215f184;hp=4e4c37ae131793783ac7d2cdb304c7f575b3638e;hb=92beb1e4c73a40a708c7c0cade5c7cee314b3887;hpb=2b1c08acfceb94326c67b7d8f9fe5d8ab4cb7f61 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