From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B9DB622637DD9 for ; Wed, 18 Apr 2018 23:26:01 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Apr 2018 23:26:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,467,1517904000"; d="scan'208";a="51945427" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga002.jf.intel.com with ESMTP; 18 Apr 2018 23:26:00 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 18 Apr 2018 23:26:00 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 18 Apr 2018 23:26:00 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.210]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.40]) with mapi id 14.03.0319.002; Thu, 19 Apr 2018 14:25:58 +0800 From: "Zhu, Yonghong" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" CC: "Feng, YunhuaX" , "Zhu, Yonghong" Thread-Topic: [edk2] [PATCH] BaseTools: Support DSC component !include PCD items Thread-Index: AQHT1vMUzxVRsrNT+EydpqJxgV/Jt6QHoICA Date: Thu, 19 Apr 2018 06:25:58 +0000 Message-ID: References: <1524041743-35256-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1524041743-35256-1-git-send-email-yonghong.zhu@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] BaseTools: Support DSC component !include PCD items X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2018 06:26:02 -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: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Yong= hong Zhu Sent: Wednesday, April 18, 2018 4:56 PM To: edk2-devel@lists.01.org Cc: Feng, YunhuaX Subject: [edk2] [PATCH] BaseTools: Support DSC component !include PCD items From: Yunhua Feng DSC format: [Components] TestPkg/TestDriver.inf { !include TestPkg/Test.txt } Test.txt content: PcdToken.PcdCName | 0x123 Per spec we should support this usage. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng --- BaseTools/Source/Python/Workspace/MetaFileParser.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTool= s/Source/Python/Workspace/MetaFileParser.py index f4c1868483..fb275aef82 100644 --- a/BaseTools/Source/Python/Workspace/MetaFileParser.py +++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py @@ -1536,13 +1536,17 @@ class DscParser(MetaFileParser): Line=3Dself._LineIndex + 1, ExtraData= =3DErrorInfo1 + "\n" + ErrorInfo2) =20 self._FileWithError =3D IncludedFile1 =20 IncludedFileTable =3D MetaFileStorage(self._Table.Cur, Include= dFile1, MODEL_FILE_DSC, False) - Owner =3D self._Content[self._ContentIndex - 1][0] + FromItem =3D self._Content[self._ContentIndex - 1][0] + if self._Content[self._ContentIndex - 1][8] !=3D -1.0: + Owner =3D self._Content[self._ContentIndex - 1][8] + else: + Owner =3D self._Content[self._ContentIndex - 1][0] Parser =3D DscParser(IncludedFile1, self._FileType, self._Arch= , IncludedFileTable, - Owner=3DOwner, From=3DOwner) + Owner=3DOwner, From=3DFromItem) =20 self.IncludedFiles.add (IncludedFile1) =20 # Does not allow lower level included file to include upper le= vel included file if Parser._From !=3D Owner and int(Owner) > int (Parser._From)= : @@ -1550,11 +1554,14 @@ class DscParser(MetaFileParser): Line=3Dself._LineIndex + 1, ExtraData=3D"{0} is alread= y included at a higher level.".format(IncludedFile1)) =20 =20 # set the parser status with current status Parser._SectionName =3D self._SectionName - Parser._SectionType =3D self._SectionType + if self._InSubsection: + Parser._SectionType =3D self._SubsectionType + else: + Parser._SectionType =3D self._SectionType Parser._Scope =3D self._Scope Parser._Enabled =3D self._Enabled # Parse the included file Parser.Start() =20 --=20 2.12.2.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel