public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: hesschen <hesheng.chen@intel.com>
To: edk2-devel@lists.01.org
Subject: [patch] BaseTool/UPT: Not expand macro for UserExtension
Date: Mon,  1 Aug 2016 23:25:34 +0800	[thread overview]
Message-ID: <1470065134-86368-1-git-send-email-hesheng.chen@intel.com> (raw)

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: hesschen <hesheng.chen@intel.com>
---
 BaseTools/Source/Python/UPT/Parser/DecParser.py | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/UPT/Parser/DecParser.py b/BaseTools/Source/Python/UPT/Parser/DecParser.py
index e6658a9..937047f 100644
--- a/BaseTools/Source/Python/UPT/Parser/DecParser.py
+++ b/BaseTools/Source/Python/UPT/Parser/DecParser.py
@@ -270,7 +270,21 @@ class _DecBase:
                     self._LoggerError(ST.ERR_DECPARSE_BACKSLASH_EMPTY)
                 CatLine += Line
          
-        self._RawData.CurrentLine = self._ReplaceMacro(CatLine)
+        #
+        # All MACRO values defined by the DEFINE statements in any section
+        # (except [Userextensions] sections for Intel) of the INF or DEC file
+        # must be expanded before processing of the file.
+        #
+        __IsReplaceMacro = True
+        Header = self._RawData.CurrentScope[0] if self._RawData.CurrentScope else None
+        if Header and len(Header) > 2:
+            if Header[0].upper() == 'USEREXTENSIONS' and not (Header[1] == 'TianoCore' and Header[2] == '"ExtraFiles"'):
+                __IsReplaceMacro = False
+        if __IsReplaceMacro:
+            self._RawData.CurrentLine = self._ReplaceMacro(CatLine)
+        else:
+            self._RawData.CurrentLine = CatLine
+
         return CatLine, CommentList
     
     ## Parse
-- 
2.7.2.windows.1



             reply	other threads:[~2016-08-01 15:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-01 15:25 hesschen [this message]
2016-08-02  6:16 ` [patch] BaseTool/UPT: Not expand macro for UserExtension Zhu, Yonghong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1470065134-86368-1-git-send-email-hesheng.chen@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox