1. Remove "/" or "\" following $(WORKSPACE) before getting real path when parsing...
authorhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 8 Nov 2007 05:21:28 +0000 (05:21 +0000)
committerhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 8 Nov 2007 05:21:28 +0000 (05:21 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@874 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/Common/DataType.py
Source/Python/Common/String.py

index 237a2ce..f1228b2 100644 (file)
@@ -23,6 +23,8 @@ TAB_SECTION_START = '['
 TAB_SECTION_END = ']'\r
 TAB_OPTION_START = '<'\r
 TAB_OPTION_END  = '>'\r
+TAB_SLASH = '\\'\r
+TAB_BACK_SLASH = '/'\r
 \r
 TAB_EDK_SOURCE = '$(EDK_SOURCE)'\r
 TAB_WORKSPACE = '$(WORKSPACE)'\r
index e284723..0c40b73 100644 (file)
@@ -336,7 +336,12 @@ def NormPath(Path, Defines = {}):
         #\r
         # Remove ${WORKSPACE}\r
         #\r
-        Path = Path.replace(DataType.TAB_WORKSPACE, '')\r
+        if Path.find(DataType.TAB_WORKSPACE) > -1:\r
+            Path = Path.replace(DataType.TAB_WORKSPACE, '')\r
+            if Path.find(DataType.TAB_SLASH) == 0:\r
+                Path = Path[1:]\r
+            if Path.find(DataType.TAB_BACK_SLASH) == 0:\r
+                Path = Path[1:]\r
 \r
         #\r
         # To local path format\r
@@ -569,7 +574,7 @@ def CheckFileType(CheckFilename, ExtName, ContainerFilename, SectionName, Line):
 #\r
 def CheckFileExist(WorkspaceDir, CheckFilename, ContainerFilename, SectionName, Line):\r
     if CheckFilename != '' and CheckFilename != None:\r
-        CheckFile = WorkspaceFile(WorkspaceDir, NormPath(CheckFilename))\r
+        CheckFile = WorkspaceFile(WorkspaceDir, CheckFilename)\r
         if os.path.exists(CheckFile) and os.path.isfile(CheckFile):\r
             pass\r
         else:\r