diff options
author | Zhao, ZhiqiangX <zhiqiangx.zhao@intel.com> | 2018-09-12 17:19:26 +0800 |
---|---|---|
committer | Liming Gao <liming.gao@intel.com> | 2018-09-25 09:43:51 +0800 |
commit | 0fd04efd01b0b3b8f05048343ab5f6109c66e07a (patch) | |
tree | d858e07f69e505bf284129a6523f3c57b5cd3b27 /BaseTools/Source/Python/build/BuildReport.py | |
parent | b602265d559b2f2ade4d09ba55652c23922c141f (diff) | |
download | edk2-0fd04efd01b0b3b8f05048343ab5f6109c66e07a.tar.gz edk2-0fd04efd01b0b3b8f05048343ab5f6109c66e07a.tar.bz2 edk2-0fd04efd01b0b3b8f05048343ab5f6109c66e07a.zip |
BaseTools: Latter full value should overwrite the former field value.
For structure Pcd, the latter full assign value in commandLine should
override the former field assign value. For example in commandLine,
build --pcd Token.pcd.field="haha" --pcd Token.pcd=H"{0x01,0x02}",
the former field value "haha" will be ignored and overwrite by the latter
full value "{0x01,0x02}".
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: ZhiqiangX Zhao <zhiqiangx.zhao@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/build/BuildReport.py')
-rw-r--r-- | BaseTools/Source/Python/build/BuildReport.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py index 49bcd9c060..4fe29f124d 100644 --- a/BaseTools/Source/Python/build/BuildReport.py +++ b/BaseTools/Source/Python/build/BuildReport.py @@ -992,12 +992,16 @@ class PcdReport(object): PcdValue = DecDefaultValue
if DscDefaultValue:
PcdValue = DscDefaultValue
- Pcd.DefaultValue = PcdValue
+ #The DefaultValue of StructurePcd already be the latest, no need to update.
+ if not self.IsStructurePcd(Pcd.TokenCName, Pcd.TokenSpaceGuidCName):
+ Pcd.DefaultValue = PcdValue
if ModulePcdSet is not None:
if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Type) not in ModulePcdSet:
continue
InfDefaultValue, PcdValue = ModulePcdSet[Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Type]
- Pcd.DefaultValue = PcdValue
+ #The DefaultValue of StructurePcd already be the latest, no need to update.
+ if not self.IsStructurePcd(Pcd.TokenCName, Pcd.TokenSpaceGuidCName):
+ Pcd.DefaultValue = PcdValue
if InfDefaultValue:
try:
InfDefaultValue = ValueExpressionEx(InfDefaultValue, Pcd.DatumType, self._GuidDict)(True)
@@ -1013,7 +1017,9 @@ class PcdReport(object): if pcd[2]:
continue
PcdValue = pcd[3]
- Pcd.DefaultValue = PcdValue
+ #The DefaultValue of StructurePcd already be the latest, no need to update.
+ if not self.IsStructurePcd(Pcd.TokenCName, Pcd.TokenSpaceGuidCName):
+ Pcd.DefaultValue = PcdValue
BuildOptionMatch = True
break
@@ -1060,7 +1066,7 @@ class PcdReport(object): DscMatch = (DscDefaultValue.strip() == PcdValue.strip())
IsStructure = False
- if GlobalData.gStructurePcd and (self.Arch in GlobalData.gStructurePcd) and ((Pcd.TokenCName, Pcd.TokenSpaceGuidCName) in GlobalData.gStructurePcd[self.Arch]):
+ if self.IsStructurePcd(Pcd.TokenCName, Pcd.TokenSpaceGuidCName):
IsStructure = True
if TypeName in ('DYNVPD', 'DEXVPD'):
SkuInfoList = Pcd.SkuInfoList
@@ -1438,6 +1444,12 @@ class PcdReport(object): else:
return value
+ def IsStructurePcd(self, PcdToken, PcdTokenSpaceGuid):
+ if GlobalData.gStructurePcd and (self.Arch in GlobalData.gStructurePcd) and ((PcdToken, PcdTokenSpaceGuid) in GlobalData.gStructurePcd[self.Arch]):
+ return True
+ else:
+ return False
+
##
# Reports platform and module Prediction information
#
|