From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by ml01.01.org (Postfix) with ESMTP id 7FC821A1E6B for ; Mon, 1 Aug 2016 23:17:01 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 01 Aug 2016 23:17:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,459,1464678000"; d="scan'208";a="742959131" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by FMSMGA003.fm.intel.com with ESMTP; 01 Aug 2016 23:17:01 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 1 Aug 2016 23:17:00 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 1 Aug 2016 23:16:59 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.181]) by shsmsx102.ccr.corp.intel.com ([169.254.2.147]) with mapi id 14.03.0248.002; Tue, 2 Aug 2016 14:16:58 +0800 From: "Zhu, Yonghong" To: "Chen, Hesheng" , "edk2-devel@lists.01.org" Thread-Topic: [patch] BaseTool/UPT: Not expand macro for UserExtension Thread-Index: AQHR7Aj3nlI3iYGp3kOxamJJzbVjQaA1Mr+A Date: Tue, 2 Aug 2016 06:16:57 +0000 Message-ID: References: <1470065134-86368-1-git-send-email-hesheng.chen@intel.com> In-Reply-To: <1470065134-86368-1-git-send-email-hesheng.chen@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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: Tue, 02 Aug 2016 06:17:01 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Yonghong Zhu =20 Best Regards, Zhu Yonghong -----Original Message----- From: Chen, Hesheng=20 Sent: Monday, August 01, 2016 11:26 PM To: edk2-devel@lists.01.org Cc: Zhu, Yonghong Subject: [patch] BaseTool/UPT: Not expand macro for UserExtension All MACRO values defined by the DEFINE statements n any section (except [Us= erextensions] 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/So= urce/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 +=3D Line =20 - self._RawData.CurrentLine =3D self._ReplaceMacro(CatLine) + # + # All MACRO values defined by the DEFINE statements in any section + # (except [Userextensions] sections for Intel) of the INF or DEC f= ile + # must be expanded before processing of the file. + # + __IsReplaceMacro =3D True + Header =3D self._RawData.CurrentScope[0] if self._RawData.CurrentS= cope else None + if Header and len(Header) > 2: + if Header[0].upper() =3D=3D 'USEREXTENSIONS' and not (Header[1= ] =3D=3D 'TianoCore' and Header[2] =3D=3D '"ExtraFiles"'): + __IsReplaceMacro =3D False + if __IsReplaceMacro: + self._RawData.CurrentLine =3D self._ReplaceMacro(CatLine) + else: + self._RawData.CurrentLine =3D CatLine + return CatLine, CommentList =20 ## Parse -- 2.7.2.windows.1