* [Patch] BaseTools: Fix a bug for Unused PCDs section display in the report
@ 2018-09-13 5:35 Yonghong Zhu
2018-09-14 5:01 ` Zhu, Yonghong
0 siblings, 1 reply; 2+ messages in thread
From: Yonghong Zhu @ 2018-09-13 5:35 UTC (permalink / raw)
To: edk2-devel; +Cc: zhijufan, Liming Gao
From: zhijufan <zhijux.fan@intel.com>
Fix a regression issue caused by ac4578af364, when there doesn't exist
not used PCD, it also display the not used Pcd section in the report.
Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=1170
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
---
BaseTools/Source/Python/build/BuildReport.py | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py
index c7fa1b9..49bcd9c 100644
--- a/BaseTools/Source/Python/build/BuildReport.py
+++ b/BaseTools/Source/Python/build/BuildReport.py
@@ -886,11 +886,21 @@ class PcdReport(object):
def GenerateReport(self, File, ModulePcdSet):
if not ModulePcdSet:
if self.ConditionalPcds:
self.GenerateReportDetail(File, ModulePcdSet, 1)
if self.UnusedPcds:
- self.GenerateReportDetail(File, ModulePcdSet, 2)
+ IsEmpty = True
+ for Token in self.UnusedPcds:
+ TokenDict = self.UnusedPcds[Token]
+ for Type in TokenDict:
+ if TokenDict[Type]:
+ IsEmpty = False
+ break
+ if not IsEmpty:
+ break
+ if not IsEmpty:
+ self.GenerateReportDetail(File, ModulePcdSet, 2)
self.GenerateReportDetail(File, ModulePcdSet)
##
# Generate report for PCD information
#
--
2.6.1.windows.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Patch] BaseTools: Fix a bug for Unused PCDs section display in the report
2018-09-13 5:35 [Patch] BaseTools: Fix a bug for Unused PCDs section display in the report Yonghong Zhu
@ 2018-09-14 5:01 ` Zhu, Yonghong
0 siblings, 0 replies; 2+ messages in thread
From: Zhu, Yonghong @ 2018-09-14 5:01 UTC (permalink / raw)
To: Zhu, Yonghong, edk2-devel@lists.01.org; +Cc: Gao, Liming, Zhu, Yonghong
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Best Regards,
Zhu Yonghong
-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Yonghong Zhu
Sent: Thursday, September 13, 2018 1:36 PM
To: edk2-devel@lists.01.org
Cc: Gao, Liming <liming.gao@intel.com>
Subject: [edk2] [Patch] BaseTools: Fix a bug for Unused PCDs section display in the report
From: zhijufan <zhijux.fan@intel.com>
Fix a regression issue caused by ac4578af364, when there doesn't exist not used PCD, it also display the not used Pcd section in the report.
Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=1170
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
---
BaseTools/Source/Python/build/BuildReport.py | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py
index c7fa1b9..49bcd9c 100644
--- a/BaseTools/Source/Python/build/BuildReport.py
+++ b/BaseTools/Source/Python/build/BuildReport.py
@@ -886,11 +886,21 @@ class PcdReport(object):
def GenerateReport(self, File, ModulePcdSet):
if not ModulePcdSet:
if self.ConditionalPcds:
self.GenerateReportDetail(File, ModulePcdSet, 1)
if self.UnusedPcds:
- self.GenerateReportDetail(File, ModulePcdSet, 2)
+ IsEmpty = True
+ for Token in self.UnusedPcds:
+ TokenDict = self.UnusedPcds[Token]
+ for Type in TokenDict:
+ if TokenDict[Type]:
+ IsEmpty = False
+ break
+ if not IsEmpty:
+ break
+ if not IsEmpty:
+ self.GenerateReportDetail(File, ModulePcdSet, 2)
self.GenerateReportDetail(File, ModulePcdSet)
##
# Generate report for PCD information
#
--
2.6.1.windows.1
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-09-14 5:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-13 5:35 [Patch] BaseTools: Fix a bug for Unused PCDs section display in the report Yonghong Zhu
2018-09-14 5:01 ` Zhu, Yonghong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox