BaseTools: create and use a standard shared variable for '*'
add a variable for the string '*' and then use it instead of lots of '*' Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by : Bob Feng <bob.c.feng@intel.com>
This commit is contained in:
@ -64,7 +64,6 @@ T_CHAR_CR = '\r'
|
||||
T_CHAR_TAB = '\t'
|
||||
T_CHAR_DOUBLE_QUOTE = '\"'
|
||||
T_CHAR_SINGLE_QUOTE = '\''
|
||||
T_CHAR_STAR = '*'
|
||||
T_CHAR_BRACE_R = '}'
|
||||
|
||||
SEPARATORS = {TAB_EQUAL_SPLIT, TAB_VALUE_SPLIT, TAB_COMMA_SPLIT, '{', T_CHAR_BRACE_R}
|
||||
@ -533,7 +532,7 @@ class FdfParser:
|
||||
InComment = False
|
||||
HashComment = False
|
||||
# check for */ comment end
|
||||
elif InComment and not DoubleSlashComment and not HashComment and self._CurrentChar() == T_CHAR_STAR and self._NextChar() == TAB_BACK_SLASH:
|
||||
elif InComment and not DoubleSlashComment and not HashComment and self._CurrentChar() == TAB_STAR and self._NextChar() == TAB_BACK_SLASH:
|
||||
self._SetCurrentCharValue(TAB_SPACE_SPLIT)
|
||||
self._GetOneChar()
|
||||
self._SetCurrentCharValue(TAB_SPACE_SPLIT)
|
||||
@ -552,7 +551,7 @@ class FdfParser:
|
||||
InComment = True
|
||||
HashComment = True
|
||||
# check for /* comment start
|
||||
elif self._CurrentChar() == TAB_BACK_SLASH and self._NextChar() == T_CHAR_STAR:
|
||||
elif self._CurrentChar() == TAB_BACK_SLASH and self._NextChar() == TAB_STAR:
|
||||
self._SetCurrentCharValue(TAB_SPACE_SPLIT)
|
||||
self._GetOneChar()
|
||||
self._SetCurrentCharValue(TAB_SPACE_SPLIT)
|
||||
|
@ -653,7 +653,7 @@ class GenFds(object):
|
||||
FileGuidList.append(FileStatementGuid)
|
||||
Name = []
|
||||
FfsPath = os.path.join(GenFdsGlobalVariable.FvDir, 'Ffs')
|
||||
FfsPath = glob(os.path.join(FfsPath, FileStatementGuid) + '*')
|
||||
FfsPath = glob(os.path.join(FfsPath, FileStatementGuid) + TAB_STAR)
|
||||
if not FfsPath:
|
||||
continue
|
||||
if not os.path.exists(FfsPath[0]):
|
||||
|
@ -217,12 +217,12 @@ class GenFdsGlobalVariable:
|
||||
|
||||
if not Inf.IsBinaryModule:
|
||||
for File in Inf.Sources:
|
||||
if File.TagName in {"", "*", GenFdsGlobalVariable.ToolChainTag} and \
|
||||
File.ToolChainFamily in {"", "*", GenFdsGlobalVariable.ToolChainFamily}:
|
||||
if File.TagName in {"", DataType.TAB_STAR, GenFdsGlobalVariable.ToolChainTag} and \
|
||||
File.ToolChainFamily in {"", DataType.TAB_STAR, GenFdsGlobalVariable.ToolChainFamily}:
|
||||
FileList.append((File, DataType.TAB_UNKNOWN_FILE))
|
||||
|
||||
for File in Inf.Binaries:
|
||||
if File.Target in {DataType.TAB_COMMON, '*', GenFdsGlobalVariable.TargetName}:
|
||||
if File.Target in {DataType.TAB_COMMON, DataType.TAB_STAR, GenFdsGlobalVariable.TargetName}:
|
||||
FileList.append((File, File.Type))
|
||||
|
||||
for File, FileType in FileList:
|
||||
@ -893,7 +893,7 @@ def FindExtendTool(KeyStringList, CurrentArchList, NameGuid):
|
||||
for Index in range(2, -1, -1):
|
||||
for Key in list(BuildOption.keys()):
|
||||
List = Key.split('_')
|
||||
if List[Index] == '*':
|
||||
if List[Index] == DataType.TAB_STAR:
|
||||
for String in ToolDb[ToolList[Index]]:
|
||||
if String in [Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]:
|
||||
List[Index] = String
|
||||
|
@ -131,7 +131,7 @@ class Section (SectionClassObject):
|
||||
if File.Type == FileType or (int(FfsInf.PiSpecVersion, 16) >= 0x0001000A \
|
||||
and FileType == 'DXE_DPEX' and File.Type == BINARY_FILE_TYPE_SMM_DEPEX) \
|
||||
or (FileType == BINARY_FILE_TYPE_TE and File.Type == BINARY_FILE_TYPE_PE32):
|
||||
if '*' in FfsInf.TargetOverrideList or File.Target == '*' or File.Target in FfsInf.TargetOverrideList or FfsInf.TargetOverrideList == []:
|
||||
if TAB_STAR in FfsInf.TargetOverrideList or File.Target == TAB_STAR or File.Target in FfsInf.TargetOverrideList or FfsInf.TargetOverrideList == []:
|
||||
FileList.append(FfsInf.PatchEfiFile(File.Path, File.Type))
|
||||
else:
|
||||
GenFdsGlobalVariable.InfLogger ("\nBuild Target \'%s\' of File %s is not in the Scope of %s specified by INF %s in FDF" %(File.Target, File.File, FfsInf.TargetOverrideList, FfsInf.InfFileName))
|
||||
|
Reference in New Issue
Block a user