]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Common/Misc.py
BaseTools: Update Build tool to support multiple workspaces
[mirror_edk2.git] / BaseTools / Source / Python / Common / Misc.py
index 8ba5819cc1e337af0b26f7c7c7f47f6e0c1954cc..0eedddc861255fedd891e281e89d3edc4e1ac0cf 100644 (file)
@@ -35,6 +35,7 @@ from BuildToolError import *
 from CommonDataClass.DataClass import *\r
 from Parsing import GetSplitValueList\r
 from Common.LongFilePathSupport import OpenLongFilePath as open\r
+from Common.MultipleWorkspace import MultipleWorkspace as mws\r
 \r
 ## Regular expression used to find out place holders in string template\r
 gPlaceholderPattern = re.compile("\$\{([^$()\s]+)\}", re.MULTILINE|re.UNICODE)\r
@@ -1728,6 +1729,7 @@ class PathClass(object):
 \r
         # Remove any '.' and '..' in path\r
         if self.Root:\r
+            self.Root = mws.getWs(self.Root, self.File)\r
             self.Path = os.path.normpath(os.path.join(self.Root, self.File))\r
             self.Root = os.path.normpath(CommonPath([self.Root, self.Path]))\r
             # eliminate the side-effect of 'C:'\r
@@ -1838,7 +1840,10 @@ class PathClass(object):
                 RealFile = os.path.join(self.AlterRoot, self.File)\r
             elif self.Root:\r
                 RealFile = os.path.join(self.Root, self.File)\r
-            return FILE_NOT_FOUND, os.path.join(self.AlterRoot, RealFile)\r
+            if len (mws.getPkgPath()) == 0:\r
+                return FILE_NOT_FOUND, os.path.join(self.AlterRoot, RealFile)\r
+            else:\r
+                return FILE_NOT_FOUND, "%s is not found in packages path:\n\t%s" % (self.File, '\n\t'.join(mws.getPkgPath()))\r
 \r
         ErrorCode = 0\r
         ErrorInfo = ''\r