From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 C864C21A04812 for ; Tue, 4 Apr 2017 19:23:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1491359018; x=1522895018; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=sTycU3m+T7dRVSW1hB5dZWJanbi66Uqd6SwOekt1HqI=; b=Ku/zl/KBAXm7qipLE5MKpjw07KyOiDGeAU9GaJQxgmeYeqPw9zRwX6ol qxKetY1UqMr3zii8s5ZbTB+GPzUb9w==; Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Apr 2017 19:23:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,276,1486454400"; d="scan'208";a="842019429" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by FMSMGA003.fm.intel.com with ESMTP; 04 Apr 2017 19:23:37 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 4 Apr 2017 19:23:37 -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; Tue, 4 Apr 2017 19:23:37 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.117]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.193]) with mapi id 14.03.0319.002; Wed, 5 Apr 2017 10:23:35 +0800 From: "Zhu, Yonghong" To: "Chen, Hesheng" , "edk2-devel@lists.01.org" Thread-Topic: [patch 3/3] BaseTools/UPT: Fix a parser issue Thread-Index: AQHSqql7jKXWXtX5bUuwjrcwS9VO3qG2EeXQ Date: Wed, 5 Apr 2017 02:23:34 +0000 Message-ID: References: <1491024785-9388-1-git-send-email-hesheng.chen@intel.com> <1491024785-9388-3-git-send-email-hesheng.chen@intel.com> In-Reply-To: <1491024785-9388-3-git-send-email-hesheng.chen@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMTVlMzIxOGUtZmMyZC00NGM0LWE2YzAtMjRhMDUzOWVlYTQyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlorQ0pNUzVFSWdYR1R4bEVXUnpsQWkxYkV4RnJGa0NzaUFOOWVGYWg0TjA9In0= x-ctpclassification: CTP_IC x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [patch 3/3] BaseTools/UPT: Fix a parser issue X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Apr 2017 02:23:39 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Yonghong Zhu Best Regards, Zhu Yonghong -----Original Message----- From: Chen, Hesheng=20 Sent: Saturday, April 1, 2017 1:33 PM To: edk2-devel@lists.01.org Cc: Zhu, Yonghong Subject: [patch 3/3] BaseTools/UPT: Fix a parser issue Update the method to get PCD information and support empty section. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: hesschen --- BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py | 5 +++-- BaseTools/Source/Python/UPT/GenMetaFile/GenMetaFileMisc.py | 13 ++++------= --- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py b/BaseTo= ols/Source/Python/UPT/GenMetaFile/GenInfFile.py index bb8a120..a376f56 100644 --- a/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py +++ b/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py @@ -568,8 +568,9 @@ def GenUserExtensions(ModuleObject): if UserExtension.GetIdentifier() =3D=3D 'Depex': continue Statement =3D UserExtension.GetStatement() - if not Statement: - continue +# Comment the code to support user extension without any statement just th= e section header in [] +# if not Statement: +# continue ArchList =3D UserExtension.GetSupArchList() for Index in xrange(0, len(ArchList)): ArchList[Index] =3D ConvertArchForInstall(ArchList[Index]) diff --git a/BaseTools/Source/Python/UPT/GenMetaFile/GenMetaFileMisc.py b/B= aseTools/Source/Python/UPT/GenMetaFile/GenMetaFileMisc.py index 0a8624c..3c6c9ee 100644 --- a/BaseTools/Source/Python/UPT/GenMetaFile/GenMetaFileMisc.py +++ b/BaseTools/Source/Python/UPT/GenMetaFile/GenMetaFileMisc.py @@ -2,7 +2,7 @@ # # This file contained the miscellaneous routines for GenMetaFile usage. # -# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.
+# Copyright (c) 2011 - 2017, Intel Corporation. All rights=20 +reserved.
# # This program and the accompanying materials are licensed and made availa= ble # under the terms and conditions of the BSD License which accompanies = this @@ -108,33 +108,28 @@ def ObtainPcdName(Packages, TokenSpaceGuidValue,= Token): TokenSpaceGuidName =3D '' PcdCName =3D '' TokenSpaceGuidNameFound =3D False - PcdCNameFound =3D False =20 # # Get TokenSpaceGuidCName from Guids section=20 # for GuidKey in DecGuidsDict: GuidList =3D DecGuidsDict[GuidKey] - if TokenSpaceGuidNameFound: - break for GuidItem in GuidList: if TokenSpaceGuidValue.upper() =3D=3D GuidItem.GuidString.= upper(): TokenSpaceGuidName =3D GuidItem.GuidCName TokenSpaceGuidNameFound =3D True break - + if TokenSpaceGuidNameFound: + break # # Retrieve PcdCName from Pcds Section # for PcdKey in DecPcdsDict: PcdList =3D DecPcdsDict[PcdKey] - if PcdCNameFound: - return TokenSpaceGuidName, PcdCName for PcdItem in PcdList: if TokenSpaceGuidName =3D=3D PcdItem.TokenSpaceGuidCName a= nd Token =3D=3D PcdItem.TokenValue: PcdCName =3D PcdItem.TokenCName - PcdCNameFound =3D True - break + return TokenSpaceGuidName, PcdCName =20 return TokenSpaceGuidName, PcdCName =20 -- 2.7.2.windows.1