]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTool/UPT: Not expand macro for UserExtension
authorHess Chen <hesheng.chen@intel.com>
Mon, 1 Aug 2016 15:25:34 +0000 (23:25 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Wed, 3 Aug 2016 02:50:14 +0000 (10:50 +0800)
All MACRO values defined by the DEFINE statements
n any section (except [Userextensions] sections
other than TianoCore."ExtraFiles) of the INF or
DEC file must be expanded before processing of the file.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
BaseTools/Source/Python/UPT/Parser/DecParser.py

index 5a2842a230391b8c16b7a3a8ef4bd426094e87e5..85b8a17fe4d8e856e13ef9bc5d2b305172693779 100644 (file)
@@ -270,7 +270,21 @@ class _DecBase:
                     self._LoggerError(ST.ERR_DECPARSE_BACKSLASH_EMPTY)\r
                 CatLine += Line\r
          \r
-        self._RawData.CurrentLine = self._ReplaceMacro(CatLine)\r
+        #\r
+        # All MACRO values defined by the DEFINE statements in any section\r
+        # (except [Userextensions] sections for Intel) of the INF or DEC file\r
+        # must be expanded before processing of the file.\r
+        #\r
+        __IsReplaceMacro = True\r
+        Header = self._RawData.CurrentScope[0] if self._RawData.CurrentScope else None\r
+        if Header and len(Header) > 2:\r
+            if Header[0].upper() == 'USEREXTENSIONS' and not (Header[1] == 'TianoCore' and Header[2] == '"ExtraFiles"'):\r
+                __IsReplaceMacro = False\r
+        if __IsReplaceMacro:\r
+            self._RawData.CurrentLine = self._ReplaceMacro(CatLine)\r
+        else:\r
+            self._RawData.CurrentLine = CatLine\r
+\r
         return CatLine, CommentList\r
     \r
     ## Parse\r