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.43; helo=mga05.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 7A5F82112DF47 for ; Wed, 12 Sep 2018 17:48:00 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Sep 2018 17:48:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,367,1531810800"; d="scan'208";a="72526829" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga007.jf.intel.com with ESMTP; 12 Sep 2018 17:47:09 -0700 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 12 Sep 2018 17:47:08 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX126.amr.corp.intel.com (10.18.125.43) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 12 Sep 2018 17:47:08 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.240]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.143]) with mapi id 14.03.0319.002; Thu, 13 Sep 2018 08:47:06 +0800 From: "Zhu, Yonghong" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Zhu, Yonghong" Thread-Topic: [edk2] [Patch] BaseTools: Align the boolean type PCD value's display in the report Thread-Index: AQHUSjr7Lkmsm5IOgU2+LsbYG5SnHaTtYgbg Date: Thu, 13 Sep 2018 00:47:06 +0000 Message-ID: References: <1536716982-26968-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1536716982-26968-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: Align the boolean type PCD value's display in the report X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Sep 2018 00:48:00 -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, September 12, 2018 9:50 AM To: edk2-devel@lists.01.org Cc: Gao, Liming Subject: [edk2] [Patch] BaseTools: Align the boolean type PCD value's displ= ay in the report From: zhijufan This patch align the boolean type PCD value's display in the build report. = Original it may display 0x0, also may use 0 for the same PCD. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhiju.Fan --- BaseTools/Source/Python/build/BuildReport.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Sourc= e/Python/build/BuildReport.py index a598d64..c7fa1b9 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -1012,11 +1012,11 @@ class PcdReport(object): FileWrite(File, "") FileWrite(File, Key) First =3D False =20 =20 - if Pcd.DatumType in TAB_PCD_CLEAN_NUMERIC_TYPES: + if Pcd.DatumType in TAB_PCD_NUMERIC_TYPES: PcdValueNumber =3D int(PcdValue.strip(), 0) if DecDefaultValue is None: DecMatch =3D True else: DecDefaultValueNumber =3D int(DecDefaultValue.stri= p(), 0) @@ -1100,10 +1100,19 @@ class PcdReport(object): DecMatch =3D False =20 # # Report PCD item according to their override relationship # + if Pcd.DatumType =3D=3D 'BOOLEAN': + if DscDefaultValue: + DscDefaultValue =3D str(int(DscDefaultValue, 0)) + if DecDefaultValue: + DecDefaultValue =3D str(int(DecDefaultValue, 0)) + if InfDefaultValue: + InfDefaultValue =3D str(int(InfDefaultValue, 0)) + if Pcd.DefaultValue: + Pcd.DefaultValue =3D str(int(Pcd.DefaultValue,=20 + 0)) if DecMatch: self.PrintPcdValue(File, Pcd, PcdTokenCName, TypeName,= IsStructure, DscMatch, DscDefaultValBak, InfMatch, InfDefaultValue, DecMat= ch, DecDefaultValue, ' ') elif InfDefaultValue and InfMatch: self.PrintPcdValue(File, Pcd, PcdTokenCName, TypeName,= IsStructure, DscMatch, DscDefaultValBak, InfMatch, InfDefaultValue, DecMat= ch, DecDefaultValue, '*M') elif BuildOptionMatch: @@ -1124,13 +1133,15 @@ class PcdReport(object): continue if not BuildOptionMatch: ModuleOverride =3D self.ModulePcdOverride.get((Pcd= .TokenCName, Pcd.TokenSpaceGuidCName), {}) for ModulePath in ModuleOverride: ModuleDefault =3D ModuleOverride[ModulePath] - if Pcd.DatumType in TAB_PCD_CLEAN_NUMERIC_TYPE= S: + if Pcd.DatumType in TAB_PCD_NUMERIC_TYPES: ModulePcdDefaultValueNumber =3D int(Module= Default.strip(), 0) Match =3D (ModulePcdDefaultValueNumber =3D= =3D PcdValueNumber) + if Pcd.DatumType =3D=3D 'BOOLEAN': + ModuleDefault =3D=20 + str(ModulePcdDefaultValueNumber) else: Match =3D (ModuleDefault.strip() =3D=3D Pc= dValue.strip()) if Match: continue IsByteArray, ArrayList =3D ByteArrayForamt(Mod= uleDefault.strip()) @@ -1245,10 +1256,12 @@ class PcdReport(object): if SkuInfo.DefaultStoreDict: DefaultStoreList =3D sorted(SkuInfo.DefaultStoreDi= ct.keys()) for DefaultStore in DefaultStoreList: Value =3D SkuInfo.DefaultStoreDict[DefaultStor= e] IsByteArray, ArrayList =3D ByteArrayForamt(Val= ue) + if Pcd.DatumType =3D=3D 'BOOLEAN': + Value =3D str(int(Value, 0)) if FirstPrint: FirstPrint =3D False if IsByteArray: if self.DefaultStoreSingle and self.Sk= uSingle: FileWrite(File, ' %-*s : %6s %10= s =3D %s' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.D= atumType + ')', '{')) @@ -1307,10 +1320,12 @@ class PcdReport(object): self.PrintStructureInfo(File, OverrideFiel= dStruct) self.PrintPcdDefault(File, Pcd, IsStructure, D= scMatch, DscDefaultValue, InfMatch, InfDefaultValue, DecMatch, DecDefaultVa= lue) else: Value =3D SkuInfo.DefaultValue IsByteArray, ArrayList =3D ByteArrayForamt(Value) + if Pcd.DatumType =3D=3D 'BOOLEAN': + Value =3D str(int(Value, 0)) if FirstPrint: FirstPrint =3D False if IsByteArray: if self.SkuSingle: FileWrite(File, ' %-*s : %6s %10s =3D %s= ' % (self.MaxLen, Flag + ' ' + PcdTokenCName, TypeName, '(' + Pcd.DatumType= + ')', "{")) -- 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel