From nobody Thu May 2 05:15:42 2024 Delivered-To: importer@patchew.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; Authentication-Results: mx.zoho.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 1496930847010128.30274512574397; Thu, 8 Jun 2017 07:07:27 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 8F42120945544; Thu, 8 Jun 2017 07:06:15 -0700 (PDT) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 19C0B21A18AAA for ; Thu, 8 Jun 2017 07:06:15 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jun 2017 07:07:23 -0700 Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.121]) by orsmga004.jf.intel.com with ESMTP; 08 Jun 2017 07:07:22 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,315,1493708400"; d="scan'208";a="95960006" From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Thu, 8 Jun 2017 22:07:19 +0800 Message-Id: <1496930839-16612-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [edk2] [Patch] BaseTools: Enhance the report to not show the empty section 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: , Cc: Liming Gao 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" Enhance the report to not show the empty section, eg: Module Library Sub-section, if there is nothing in this section, we will not show it in the report. Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu Reviewed-by: Liming Gao --- BaseTools/Source/Python/build/BuildReport.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Sourc= e/Python/build/BuildReport.py index 91d1e93..d700d6f 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -316,13 +316,13 @@ class LibraryReport(object): # # @param self The object pointer # @param File The file object for report # def GenerateReport(self, File): - FileWrite(File, gSubSectionStart) - FileWrite(File, TAB_BRG_LIBRARY) if len(self.LibraryList) > 0: + FileWrite(File, gSubSectionStart) + FileWrite(File, TAB_BRG_LIBRARY) FileWrite(File, gSubSectionSep) for LibraryItem in self.LibraryList: LibInfPath =3D LibraryItem[0] FileWrite(File, LibInfPath) =20 @@ -345,11 +345,11 @@ class LibraryReport(object): if EdkIILibInfo: FileWrite(File, "{%s: %s}" % (LibClass, EdkIILibIn= fo)) else: FileWrite(File, "{%s}" % LibClass) =20 - FileWrite(File, gSubSectionEnd) + FileWrite(File, gSubSectionEnd) =20 ## # Reports dependency expression information # # This class reports the module dependency expression subsection in the bu= ild report file. @@ -409,13 +409,10 @@ class DepexReport(object): # @param File The file object for report # @param GlobalDepexParser The platform global Dependency expression p= arser object # def GenerateReport(self, File, GlobalDepexParser): if not self.Depex: - FileWrite(File, gSubSectionStart) - FileWrite(File, TAB_DEPEX) - FileWrite(File, gSubSectionEnd) return FileWrite(File, gSubSectionStart) if os.path.isfile(self._DepexFileName): try: DepexStatements =3D GlobalDepexParser.ParseDepexFile(self.= _DepexFileName) @@ -864,11 +861,11 @@ class PcdReport(object): FileWrite(File, " *F - Platform scoped PCD override in FDF f= ile") if not ReportSubType: FileWrite(File, " *M - Module scoped PCD override") FileWrite(File, gSectionSep) else: - if not ReportSubType: + if not ReportSubType and ModulePcdSet: # # For module PCD sub-section # FileWrite(File, gSubSectionStart) FileWrite(File, TAB_BRG_PCD) @@ -1009,11 +1006,11 @@ class PcdReport(object): FileWrite(File, ' *M %-*s =3D %s' % (self.= MaxLen + 19, ModulePath, ModuleDefault.strip())) =20 if ModulePcdSet =3D=3D None: FileWrite(File, gSectionEnd) else: - if not ReportSubType: + if not ReportSubType and ModulePcdSet: FileWrite(File, gSubSectionEnd) =20 =20 =20 ## --=20 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel