From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by ml01.01.org (Postfix) with ESMTP id 161B01A1E43 for ; Mon, 1 Aug 2016 08:25:40 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 01 Aug 2016 08:25:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,455,1464678000"; d="scan'208";a="1006365301" Received: from tiano01.ccr.corp.intel.com ([10.239.9.145]) by orsmga001.jf.intel.com with ESMTP; 01 Aug 2016 08:25:39 -0700 From: hesschen To: edk2-devel@lists.01.org Date: Mon, 1 Aug 2016 23:25:34 +0800 Message-Id: <1470065134-86368-1-git-send-email-hesheng.chen@intel.com> X-Mailer: git-send-email 2.7.2.windows.1 Subject: [patch] BaseTool/UPT: Not expand macro for UserExtension X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2016 15:25:40 -0000 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 --- 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