BaseTools: DSC Components section support flexible PCD

DSC Components section support flexible PCD, and for binary driver, we
need patch this value. Update the split char ',' not ', ' because some
value may have space, while others may not have this space.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com>
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Yunhua Feng
2018-03-03 09:12:18 +08:00
committed by Liming Gao
parent 0e2a5749d8
commit 0537f332c9
2 changed files with 17 additions and 1 deletions

View File

@ -161,10 +161,11 @@ def PatchBinaryFile(FileName, ValueOffset, TypeName, ValueString, MaxSize=0):
#
# Patch {0x1, 0x2, ...} byte by byte
#
ValueList = ValueString[1 : len(ValueString) - 1].split(', ')
ValueList = ValueString[1 : len(ValueString) - 1].split(',')
Index = 0
try:
for ByteString in ValueList:
ByteString = ByteString.strip()
if ByteString.upper().startswith('0X'):
ByteValue = int(ByteString, 16)
else: