diff options
author | Jaben Carsey <jaben.carsey@intel.com> | 2018-11-16 23:40:04 +0800 |
---|---|---|
committer | BobCF <bob.c.feng@intel.com> | 2018-12-06 17:11:24 +0800 |
commit | bc39c5cbea30b53c35a32150431bb7ea05a3238d (patch) | |
tree | 78fd7f91b47f437c4f7b78be4ebaa35c50f116d5 /BaseTools/Source/Python/GenFds | |
parent | ea55e37c369ac5b9dc1a6fcc647bd3fa20cb05b1 (diff) | |
download | edk2-bc39c5cbea30b53c35a32150431bb7ea05a3238d.tar.gz edk2-bc39c5cbea30b53c35a32150431bb7ea05a3238d.tar.bz2 edk2-bc39c5cbea30b53c35a32150431bb7ea05a3238d.zip |
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>
Diffstat (limited to 'BaseTools/Source/Python/GenFds')
-rw-r--r-- | BaseTools/Source/Python/GenFds/FdfParser.py | 5 | ||||
-rw-r--r-- | BaseTools/Source/Python/GenFds/GenFds.py | 2 | ||||
-rw-r--r-- | BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | 8 | ||||
-rw-r--r-- | BaseTools/Source/Python/GenFds/Section.py | 2 |
4 files changed, 8 insertions, 9 deletions
diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py index 2fbbad114c..e000228d2f 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -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)
diff --git a/BaseTools/Source/Python/GenFds/GenFds.py b/BaseTools/Source/Python/GenFds/GenFds.py index 0c8091b798..0513f488fc 100644 --- a/BaseTools/Source/Python/GenFds/GenFds.py +++ b/BaseTools/Source/Python/GenFds/GenFds.py @@ -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]):
diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py index ea61f723a7..0812c56bda 100644 --- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py +++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py @@ -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
diff --git a/BaseTools/Source/Python/GenFds/Section.py b/BaseTools/Source/Python/GenFds/Section.py index 19a70009dc..bab74aedf0 100644 --- a/BaseTools/Source/Python/GenFds/Section.py +++ b/BaseTools/Source/Python/GenFds/Section.py @@ -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))
|