diff options
author | Carsey, Jaben <jaben.carsey@intel.com> | 2018-04-27 00:57:56 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-05-02 15:01:43 +0800 |
commit | 91fa33eeca8cea64490ccf4d92f920369a2a3eed (patch) | |
tree | 2cf6683a4720d51ba3d2c37117495a362b4d94b7 /BaseTools/Source/Python/GenFds/GenFds.py | |
parent | be409b67566348f75b69e66ef9604b248e053553 (diff) | |
download | edk2-91fa33eeca8cea64490ccf4d92f920369a2a3eed.tar.gz edk2-91fa33eeca8cea64490ccf4d92f920369a2a3eed.tar.bz2 edk2-91fa33eeca8cea64490ccf4d92f920369a2a3eed.zip |
BaseTools: Replace Binary File type strings with predefined constant
BINARY_FILE_TYPE_FW was 'FW'
BINARY_FILE_TYPE_GUID was 'GUID'
BINARY_FILE_TYPE_PREEFORM was 'PREEFORM'
BINARY_FILE_TYPE_UEFI_APP was 'UEFI_APP'
BINARY_FILE_TYPE_UNI_UI was 'UNI_UI'
BINARY_FILE_TYPE_UNI_VER was 'UNI_VER'
BINARY_FILE_TYPE_LIB was 'LIB'
BINARY_FILE_TYPE_PE32 was 'PE32'
BINARY_FILE_TYPE_PIC was 'PIC'
BINARY_FILE_TYPE_PEI_DEPEX was 'PEI_DEPEX'
BINARY_FILE_TYPE_DXE_DEPEX was 'DXE_DEPEX'
BINARY_FILE_TYPE_SMM_DEPEX was 'SMM_DEPEX'
BINARY_FILE_TYPE_TE was 'TE'
BINARY_FILE_TYPE_VER was 'VER'
BINARY_FILE_TYPE_UI was 'UI'
BINARY_FILE_TYPE_BIN was 'BIN'
BINARY_FILE_TYPE_FV was 'FV'
v2 - split apart FV and GUID types with different meanings.
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/GenFds/GenFds.py')
-rw-r--r-- | BaseTools/Source/Python/GenFds/GenFds.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/BaseTools/Source/Python/GenFds/GenFds.py b/BaseTools/Source/Python/GenFds/GenFds.py index 54c7d82830..ccd137955d 100644 --- a/BaseTools/Source/Python/GenFds/GenFds.py +++ b/BaseTools/Source/Python/GenFds/GenFds.py @@ -315,7 +315,7 @@ def main(): for Fd in FdfParserObj.Profile.FdDict:
FdObj = FdfParserObj.Profile.FdDict[Fd]
for RegionObj in FdObj.RegionList:
- if RegionObj.RegionType != 'FV':
+ if RegionObj.RegionType != BINARY_FILE_TYPE_FV:
continue
for RegionData in RegionObj.RegionDataList:
if FvObj.UiFvName.upper() == RegionData.upper():
@@ -405,7 +405,7 @@ def FindExtendTool(KeyStringList, CurrentArchList, NameGuid): KeyList[1] + \
'_' + \
KeyList[2]
- if Key in KeyStringList and KeyList[4] == 'GUID':
+ if Key in KeyStringList and KeyList[4] == TAB_GUID:
ToolPathKey = Key + '_' + KeyList[3] + '_PATH'
ToolOptionKey = Key + '_' + KeyList[3] + '_FLAGS'
ToolPath = ToolDefinition.get(ToolPathKey)
@@ -447,7 +447,7 @@ def FindExtendTool(KeyStringList, CurrentArchList, NameGuid): if NameGuid == BuildOption[Op]:
KeyList = Op.split('_')
Key = KeyList[0] + '_' + KeyList[1] +'_' + KeyList[2]
- if Key in KeyStringList and KeyList[4] == 'GUID':
+ if Key in KeyStringList and KeyList[4] == TAB_GUID:
ToolPathKey = Key + '_' + KeyList[3] + '_PATH'
ToolOptionKey = Key + '_' + KeyList[3] + '_FLAGS'
if ToolPathKey in BuildOption:
@@ -589,7 +589,7 @@ class GenFds : if FdObj is None:
for ElementFd in GenFdsGlobalVariable.FdfParser.Profile.FdDict.values():
for ElementRegion in ElementFd.RegionList:
- if ElementRegion.RegionType == 'FV':
+ if ElementRegion.RegionType == BINARY_FILE_TYPE_FV:
for ElementRegionData in ElementRegion.RegionDataList:
if ElementRegionData is not None and ElementRegionData.upper() == FvObj.UiFvName:
if FvObj.BlockSizeList != []:
@@ -601,7 +601,7 @@ class GenFds : return DefaultBlockSize
else:
for ElementRegion in FdObj.RegionList:
- if ElementRegion.RegionType == 'FV':
+ if ElementRegion.RegionType == BINARY_FILE_TYPE_FV:
for ElementRegionData in ElementRegion.RegionDataList:
if ElementRegionData is not None and ElementRegionData.upper() == FvObj.UiFvName:
if FvObj.BlockSizeList != []:
|