From nobody Fri May 3 09:51:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1524041749601750.7504339002452; Wed, 18 Apr 2018 01:55:49 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 45770225264B6; Wed, 18 Apr 2018 01:55:48 -0700 (PDT) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 0C7E4226838F5 for ; Wed, 18 Apr 2018 01:55:46 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Apr 2018 01:55:46 -0700 Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.129]) by fmsmga004.fm.intel.com with ESMTP; 18 Apr 2018 01:55:45 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,464,1517904000"; d="scan'208";a="47103039" From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Wed, 18 Apr 2018 16:55:43 +0800 Message-Id: <1524041743-35256-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [edk2] [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: , Cc: Yunhua Feng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Yonghong Zhu =20 --- 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