X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=BaseTools%2FSource%2FPython%2FCommon%2FMultipleWorkspace.py;h=2a76d49cc627ad6cd96ceef1818cb2a7d215f184;hp=feb1f8d5ebe6e67706045c31b5c459d6936b1008;hb=92beb1e4c73a40a708c7c0cade5c7cee314b3887;hpb=1e69581335354a7df3bc07b21e495b0b3c5909c0
diff --git a/BaseTools/Source/Python/Common/MultipleWorkspace.py b/BaseTools/Source/Python/Common/MultipleWorkspace.py
index feb1f8d5eb..2a76d49cc6 100644
--- a/BaseTools/Source/Python/Common/MultipleWorkspace.py
+++ b/BaseTools/Source/Python/Common/MultipleWorkspace.py
@@ -4,7 +4,7 @@
# This file is required to make Python interpreter treat the directory
# as containing package.
#
-# Copyright (c) 2015, Intel Corporation. All rights reserved.
+# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
@@ -128,12 +128,20 @@ class MultipleWorkspace(object):
@classmethod
def handleWsMacro(cls, PathStr):
if TAB_WORKSPACE in PathStr:
- Path = PathStr.replace(TAB_WORKSPACE, cls.WORKSPACE).strip()
- if not os.path.exists(Path):
- for Pkg in cls.PACKAGES_PATH:
- Path = PathStr.replace(TAB_WORKSPACE, Pkg).strip()
- if os.path.exists(Path):
- return Path
+ PathList = PathStr.split()
+ if PathList:
+ for i, str in enumerate(PathList):
+ 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
## getPkgPath()