]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fix the bug to correctly handle the [BuildOptions]
authorYonghong Zhu <yonghong.zhu@intel.com>
Thu, 14 Apr 2016 15:03:45 +0000 (23:03 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Fri, 15 Apr 2016 00:41:21 +0000 (08:41 +0800)
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>
BaseTools/Source/Python/Common/MultipleWorkspace.py

index 4e4c37ae131793783ac7d2cdb304c7f575b3638e..2a76d49cc627ad6cd96ceef1818cb2a7d215f184 100644 (file)
@@ -131,13 +131,16 @@ class MultipleWorkspace(object):
             PathList = PathStr.split()\r
             if PathList:\r
                 for i, str in enumerate(PathList):\r
-                    if str.find(TAB_WORKSPACE) != -1:\r
-                        MacroStartPos = str.find(TAB_WORKSPACE)\r
-                        MacroEndPos = str.find(')', MacroStartPos)\r
-                        Substr = str[MacroEndPos+1:]\r
-                        if Substr.startswith('/') or Substr.startswith('\\'):\r
-                            Substr = Substr[1:]\r
-                        PathList[i] = str[0:MacroStartPos] + os.path.normpath(cls.join(cls.WORKSPACE, Substr))\r
+                    MacroStartPos = str.find(TAB_WORKSPACE)\r
+                    if MacroStartPos != -1:\r
+                        Substr = str[MacroStartPos:]\r
+                        Path = Substr.replace(TAB_WORKSPACE, cls.WORKSPACE).strip()\r
+                        if not os.path.exists(Path):\r
+                            for Pkg in cls.PACKAGES_PATH:\r
+                                Path = Substr.replace(TAB_WORKSPACE, Pkg).strip()\r
+                                if os.path.exists(Path):\r
+                                    break\r
+                        PathList[i] = str[0:MacroStartPos] + Path\r
             PathStr = ' '.join(PathList)\r
         return PathStr\r
     \r