From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B225E211982CD for ; Mon, 3 Dec 2018 07:19:05 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Dec 2018 07:19:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,310,1539673200"; d="scan'208";a="280517616" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga005.jf.intel.com with ESMTP; 03 Dec 2018 07:19:05 -0800 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 3 Dec 2018 07:19:05 -0800 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.186]) by fmsmsx111.amr.corp.intel.com ([169.254.12.12]) with mapi id 14.03.0415.000; Mon, 3 Dec 2018 07:19:04 -0800 From: "Carsey, Jaben" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" CC: "Gao, Liming" Thread-Topic: [Patch v1 1/1] BaseTools: create and use a standard shared variable for '*' Thread-Index: AQHUirA4+WeiYG7afEOrPU+jyj4qc6VtIV2g Date: Mon, 3 Dec 2018 15:19:03 +0000 Message-ID: References: <9802d13cdae952a1ef3b344b1cbaa2721689ce99.1542382796.git.jaben.carsey@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZWNlYzEzNzUtZWRjYy00ZmE3LWExYTgtODczNmQxYjYyNWFjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiTklkdTdkY1RrRDdHUkxxV0Joek4yWWJSTGdyNTIxZ3hoNlFWTFU3WEFxRERSUnRhR3VJNDFqK1hxNXFnTU9nZCJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.1.200.106] MIME-Version: 1.0 Subject: Re: [Patch v1 1/1] BaseTools: create and use a standard shared variable for '*' X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Dec 2018 15:19:06 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I was trying to change all use of *, without regard to the usage of it. Do you think that mathematical * should not be changed? -Jaben > -----Original Message----- > From: Zhu, Yonghong > Sent: Sunday, December 02, 2018 6:31 PM > To: Carsey, Jaben ; edk2-devel@lists.01.org > Cc: Gao, Liming ; Zhu, Yonghong > > Subject: RE: [Patch v1 1/1] BaseTools: create and use a standard shared > variable for '*' > Importance: High >=20 > Hi Jaben, >=20 > In this patch, it also changed the mathematics multiplicative '*' (used i= n > expression) to TAB_STAR, is it by on purpose? > Eg: > - NonLetterOpLst =3D ['+', '-', '*', '/', '%', '&', '|', '^', '~', '<<= ', '>>', '!', '=3D', '>', '<', > '?', ':'] > + NonLetterOpLst =3D ['+', '-', TAB_STAR, '/', '%', '&', '|', '^', '~'= , '<<', '>>', '!', '=3D', > '>', '<', '?', ':'] >=20 > Best Regards, > Zhu Yonghong >=20 > -----Original Message----- > From: Carsey, Jaben > Sent: Friday, November 16, 2018 11:40 PM > To: edk2-devel@lists.01.org > Cc: Zhu, Yonghong ; Gao, Liming > > Subject: [Patch v1 1/1] BaseTools: create and use a standard shared varia= ble > for '*' >=20 > add a variable for the string '*' and then use it instead of lots of '*' >=20 > Cc: Yonghong Zhu > Cc: Liming Gao > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Jaben Carsey > --- > BaseTools/Source/Python/AutoGen/AutoGen.py | 54 ++++++++++--= - > ------- > BaseTools/Source/Python/AutoGen/BuildEngine.py | 10 ++-- > BaseTools/Source/Python/BPDG/GenVpd.py | 14 ++--- > BaseTools/Source/Python/Common/DataType.py | 1 + > BaseTools/Source/Python/Common/Expression.py | 4 +- > BaseTools/Source/Python/Common/Misc.py | 2 +- > BaseTools/Source/Python/Common/ToolDefClassObject.py | 23 +++++---- > BaseTools/Source/Python/Common/VpdInfoFile.py | 8 +-- > BaseTools/Source/Python/GenFds/FdfParser.py | 5 +- > BaseTools/Source/Python/GenFds/GenFds.py | 2 +- > BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | 8 +-- > BaseTools/Source/Python/GenFds/Section.py | 2 +- > BaseTools/Source/Python/Workspace/DscBuildData.py | 6 +-- > 13 files changed, 70 insertions(+), 69 deletions(-) >=20 > diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py > b/BaseTools/Source/Python/AutoGen/AutoGen.py > index f3560bfc787d..25417c447061 100644 > --- a/BaseTools/Source/Python/AutoGen/AutoGen.py > +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py > @@ -1438,7 +1438,7 @@ class PlatformAutoGen(AutoGen): > PcdValue =3D Sku.DefaultValue > if PcdValue =3D=3D "": > PcdValue =3D Pcd.DefaultValue > - if Sku.VpdOffset !=3D '*': > + if Sku.VpdOffset !=3D TAB_STAR: > if PcdValue.startswith("{"): > Alignment =3D 8 > elif PcdValue.startswith("L"): > @@ -1462,7 +1462,7 @@ class PlatformAutoGen(AutoGen): > VpdFile.Add(Pcd, SkuName, Sku.VpdOffset) > SkuValueMap[PcdValue].append(Sku) > # if the offset of a VPD is *, then it need to b= e fixed up by third > party tool. > - if not NeedProcessVpdMapFile and Sku.VpdOffset = =3D=3D "*": > + if not NeedProcessVpdMapFile and Sku.VpdOffset = =3D=3D > TAB_STAR: > NeedProcessVpdMapFile =3D True > if self.Platform.VpdToolGuid is None or > self.Platform.VpdToolGuid =3D=3D '': > EdkLogger.error("Build", FILE_NOT_FOUND,= \ @@ -1522,7 > +1522,7 @@ class PlatformAutoGen(AutoGen): > PcdValue =3D Sku.DefaultValue > if PcdValue =3D=3D "": > PcdValue =3D DscPcdEntry.DefaultVal= ue > - if Sku.VpdOffset !=3D '*': > + if Sku.VpdOffset !=3D TAB_STAR: > if PcdValue.startswith("{"): > Alignment =3D 8 > elif PcdValue.startswith("L"): > @@ -1545,7 +1545,7 @@ class PlatformAutoGen(AutoGen): > SkuValueMap[PcdValue] =3D [] > VpdFile.Add(DscPcdEntry, SkuName, Sk= u.VpdOffset) > SkuValueMap[PcdValue].append(Sku) > - if not NeedProcessVpdMapFile and Sku.Vpd= Offset =3D=3D "*": > + if not NeedProcessVpdMapFile and Sku.Vpd= Offset =3D=3D > TAB_STAR: > NeedProcessVpdMapFile =3D True > if DscPcdEntry.DatumType =3D=3D TAB_VOID and > PcdValue.startswith("L"): > UnicodePcdArray.add(DscPcdEntry) @@ -157= 3,7 +1573,7 > @@ class PlatformAutoGen(AutoGen): > if os.path.exists(VpdMapFilePath): > VpdFile.Read(VpdMapFilePath) >=20 > - # Fixup "*" offset > + # Fixup TAB_STAR offset > for pcd in VpdSkuMap: > vpdinfo =3D VpdFile.GetVpdInfo(pcd) > if vpdinfo is None: > @@ -2210,15 +2210,15 @@ class PlatformAutoGen(AutoGen): > def CalculatePriorityValue(self, Key): > Target, ToolChain, Arch, CommandType, Attr =3D Key.split('_') > PriorityValue =3D 0x11111 > - if Target =3D=3D "*": > + if Target =3D=3D TAB_STAR: > PriorityValue &=3D 0x01111 > - if ToolChain =3D=3D "*": > + if ToolChain =3D=3D TAB_STAR: > PriorityValue &=3D 0x10111 > - if Arch =3D=3D "*": > + if Arch =3D=3D TAB_STAR: > PriorityValue &=3D 0x11011 > - if CommandType =3D=3D "*": > + if CommandType =3D=3D TAB_STAR: > PriorityValue &=3D 0x11101 > - if Attr =3D=3D "*": > + if Attr =3D=3D TAB_STAR: > PriorityValue &=3D 0x11110 >=20 > return self.PrioList["0x%0.5x" % PriorityValue] @@ -2253,9 +2253= ,9 @@ > class PlatformAutoGen(AutoGen): > if (Key[0] =3D=3D self.BuildRuleFamily and > (ModuleStyle is None or len(Key) < 3 or (len(Key) > 2 an= d Key[2] =3D=3D > ModuleStyle))): > Target, ToolChain, Arch, CommandType, Attr =3D Key[1].sp= lit('_') > - if (Target =3D=3D self.BuildTarget or Target =3D=3D "*")= and\ > - (ToolChain =3D=3D self.ToolChain or ToolChain =3D=3D= "*") and\ > - (Arch =3D=3D self.Arch or Arch =3D=3D "*") and\ > + if (Target =3D=3D self.BuildTarget or Target =3D=3D TAB_= STAR) and\ > + (ToolChain =3D=3D self.ToolChain or ToolChain =3D=3D= TAB_STAR) and\ > + (Arch =3D=3D self.Arch or Arch =3D=3D TAB_STAR) and\ > Options[Key].startswith("=3D"): >=20 > if OverrideList.get(Key[1]) is not None: > @@ -2276,11 +2276,11 @@ class PlatformAutoGen(AutoGen): > # Compare two Key, if one is included by another, ch= oose the > higher priority one > # > Target2, ToolChain2, Arch2, CommandType2, Attr2 =3D > NextKey.split("_") > - if (Target1 =3D=3D Target2 or Target1 =3D=3D "*" or = Target2 =3D=3D "*") and\ > - (ToolChain1 =3D=3D ToolChain2 or ToolChain1 =3D= =3D "*" or ToolChain2 > =3D=3D "*") and\ > - (Arch1 =3D=3D Arch2 or Arch1 =3D=3D "*" or Arch2= =3D=3D "*") and\ > - (CommandType1 =3D=3D CommandType2 or CommandType= 1 =3D=3D "*" > or CommandType2 =3D=3D "*") and\ > - (Attr1 =3D=3D Attr2 or Attr1 =3D=3D "*" or Attr2= =3D=3D "*"): > + if (Target1 =3D=3D Target2 or Target1 =3D=3D TAB_STA= R or Target2 =3D=3D > TAB_STAR) and\ > + (ToolChain1 =3D=3D ToolChain2 or ToolChain1 =3D= =3D TAB_STAR or > ToolChain2 =3D=3D TAB_STAR) and\ > + (Arch1 =3D=3D Arch2 or Arch1 =3D=3D TAB_STAR or = Arch2 =3D=3D TAB_STAR) > and\ > + (CommandType1 =3D=3D CommandType2 or CommandType= 1 =3D=3D > TAB_STAR or CommandType2 =3D=3D TAB_STAR) and\ > + (Attr1 =3D=3D Attr2 or Attr1 =3D=3D TAB_STAR or = Attr2 =3D=3D TAB_STAR): >=20 > if self.CalculatePriorityValue(NowKey) > > self.CalculatePriorityValue(NextKey): > if Options.get((self.BuildRuleFamily, NextKe= y)) is not None: > @@ -2309,9 +2309,9 @@ class PlatformAutoGen(AutoGen): > continue > FamilyMatch =3D True > # expand any wildcard > - if Target =3D=3D "*" or Target =3D=3D self.BuildTarget: > - if Tag =3D=3D "*" or Tag =3D=3D self.ToolChain: > - if Arch =3D=3D "*" or Arch =3D=3D self.Arch: > + if Target =3D=3D TAB_STAR or Target =3D=3D self.BuildTarget: > + if Tag =3D=3D TAB_STAR or Tag =3D=3D self.ToolChain: > + if Arch =3D=3D TAB_STAR or Arch =3D=3D self.Arch: > if Tool not in BuildOptions: > BuildOptions[Tool] =3D {} > if Attr !=3D "FLAGS" or Attr not in BuildOptions= [Tool] or > Options[Key].startswith('=3D'): > @@ -2344,9 +2344,9 @@ class PlatformAutoGen(AutoGen): > continue >=20 > # expand any wildcard > - if Target =3D=3D "*" or Target =3D=3D self.BuildTarget: > - if Tag =3D=3D "*" or Tag =3D=3D self.ToolChain: > - if Arch =3D=3D "*" or Arch =3D=3D self.Arch: > + if Target =3D=3D TAB_STAR or Target =3D=3D self.BuildTarget: > + if Tag =3D=3D TAB_STAR or Tag =3D=3D self.ToolChain: > + if Arch =3D=3D TAB_STAR or Arch =3D=3D self.Arch: > if Tool not in BuildOptions: > BuildOptions[Tool] =3D {} > if Attr !=3D "FLAGS" or Attr not in BuildOptions= [Tool] or > Options[Key].startswith('=3D'): > @@ -2971,8 +2971,8 @@ class ModuleAutoGen(AutoGen): > @cached_property > def SourceFileList(self): > RetVal =3D [] > - ToolChainTagSet =3D {"", "*", self.ToolChain} > - ToolChainFamilySet =3D {"", "*", self.ToolChainFamily, > self.BuildRuleFamily} > + ToolChainTagSet =3D {"", TAB_STAR, self.ToolChain} > + ToolChainFamilySet =3D {"", TAB_STAR, self.ToolChainFamily, > + self.BuildRuleFamily} > for F in self.Module.Sources: > # match tool chain > if F.TagName not in ToolChainTagSet: > @@ -3047,7 +3047,7 @@ class ModuleAutoGen(AutoGen): > def BinaryFileList(self): > RetVal =3D [] > for F in self.Module.Binaries: > - if F.Target not in [TAB_ARCH_COMMON, '*'] and F.Target !=3D > self.BuildTarget: > + if F.Target not in [TAB_ARCH_COMMON, TAB_STAR] and F.Target = !=3D > self.BuildTarget: > continue > RetVal.append(F) > self._ApplyBuildRule(F, F.Type, BinaryFileList=3DRetVal) dif= f --git > a/BaseTools/Source/Python/AutoGen/BuildEngine.py > b/BaseTools/Source/Python/AutoGen/BuildEngine.py > index ac7a6687552c..f9e3ac3a1daf 100644 > --- a/BaseTools/Source/Python/AutoGen/BuildEngine.py > +++ b/BaseTools/Source/Python/AutoGen/BuildEngine.py > @@ -110,7 +110,7 @@ class FileBuildRule: > self.IncListFileMacro =3D self.INC_LIST_MACRO >=20 > self.SourceFileType =3D Type > - # source files listed not in "*" or "?" pattern format > + # source files listed not in TAB_STAR or "?" pattern format > if not ExtraDependency: > self.ExtraSourceFileList =3D [] > else: > @@ -150,12 +150,12 @@ class FileBuildRule: > self.SourceFileExtList =3D set() > for File in Input: > Base, Ext =3D os.path.splitext(File) > - if Base.find("*") >=3D 0: > - # There's "*" in the file name > + if Base.find(TAB_STAR) >=3D 0: > + # There's TAB_STAR in the file name > self.IsMultipleInput =3D True > self.GenFileListMacro =3D True > elif Base.find("?") < 0: > - # There's no "*" and "?" in file name > + # There's no TAB_STAR and "?" in file name > self.ExtraSourceFileList.append(File) > continue > self.SourceFileExtList.add(Ext) @@ -553,7 +553,7 @@ class Bu= ildRule: > # > # @param FileExt The extension of a file > # @param ToolChainFamily The tool chain family name > - # @param BuildVersion The build version number. "*" means = any > rule > + # @param BuildVersion The build version number. TAB_STAR m= eans > any rule > # is applicalbe. > # > # @retval FileType The file type string > diff --git a/BaseTools/Source/Python/BPDG/GenVpd.py > b/BaseTools/Source/Python/BPDG/GenVpd.py > index d7852d29eed0..e5da47f95e63 100644 > --- a/BaseTools/Source/Python/BPDG/GenVpd.py > +++ b/BaseTools/Source/Python/BPDG/GenVpd.py > @@ -21,7 +21,7 @@ import array > import re > from Common.LongFilePathSupport import OpenLongFilePath as open from > struct import * -from Common.DataType import MAX_SIZE_TYPE, > MAX_VAL_TYPE > +from Common.DataType import MAX_SIZE_TYPE, MAX_VAL_TYPE, > TAB_STAR > import Common.EdkLogger as EdkLogger > import Common.BuildToolError as BuildToolError >=20 > @@ -87,7 +87,7 @@ class PcdEntry: > # for both hexadecimal and decimal. > # > def _GenOffsetValue(self): > - if self.PcdOffset !=3D "*" : > + if self.PcdOffset !=3D TAB_STAR: > try: > self.PcdBinOffset =3D int (self.PcdOffset) > except: > @@ -423,7 +423,7 @@ class GenVPD : > Alignment =3D 1 >=20 > PCD.Alignment =3D Alignment > - if PCD.PcdOffset !=3D '*': > + if PCD.PcdOffset !=3D TAB_STAR: > if PCD.PcdOccupySize % Alignment !=3D 0: > if PCD.PcdUnpackValue.startswith("{"): > EdkLogger.warn("BPDG", "The offset value of = PCD %s is not 8- > byte aligned!" %(PCD.PcdCName), File=3Dself.InputFileName) @@ -469,7 > +469,7 @@ class GenVPD : > def FormatFileLine (self) : >=20 > for eachPcd in self.FileLinesList : > - if eachPcd.PcdOffset !=3D '*' : > + if eachPcd.PcdOffset !=3D TAB_STAR : > # Use pcd's Offset value as key, and pcd's Value as valu= e > self.PcdFixedOffsetSizeList.append(eachPcd) > else : > @@ -484,7 +484,7 @@ class GenVPD : > def FixVpdOffset (self): > # At first, the offset should start at 0 > # Sort fixed offset list in order to find out where has free spa= ces for the > pcd's offset > - # value is "*" to insert into. > + # value is TAB_STAR to insert into. >=20 > self.PcdFixedOffsetSizeList.sort(key=3Dlambda x: x.PcdBinOffset) >=20 > @@ -502,7 +502,7 @@ class GenVPD : > self.PcdUnknownOffsetList[index+i -1 ], > self.PcdUnknownOffsetList[index+i] =3D self.PcdUnknownOffsetList[index+i]= , > self.PcdUnknownOffsetList[index+i -1] >=20 > # > - # Process all Offset value are "*" > + # Process all Offset value are TAB_STAR > # > if (len(self.PcdFixedOffsetSizeList) =3D=3D 0) and > (len(self.PcdUnknownOffsetList) !=3D 0) : > # The offset start from 0 > @@ -571,7 +571,7 @@ class GenVPD : > eachUnfixedPcd =3D > self.PcdUnknownOffsetList[countOfUnfixedList] > needFixPcdSize =3D eachUnfixedPcd.PcdOccupy= Size > # Not been fixed > - if eachUnfixedPcd.PcdOffset =3D=3D '*' : > + if eachUnfixedPcd.PcdOffset =3D=3D TAB_STAR : > if LastOffset % eachUnfixedPcd.Alignment != =3D 0: > LastOffset =3D (LastOffset / eachUnfixed= Pcd.Alignment + 1) * > eachUnfixedPcd.Alignment > # The offset un-fixed pcd can write into thi= s free space diff -- > git a/BaseTools/Source/Python/Common/DataType.py > b/BaseTools/Source/Python/Common/DataType.py > index 1d1d22faa40b..6b375712b65e 100644 > --- a/BaseTools/Source/Python/Common/DataType.py > +++ b/BaseTools/Source/Python/Common/DataType.py > @@ -31,6 +31,7 @@ TAB_OPTION_START =3D '<' > TAB_OPTION_END =3D '>' > TAB_SLASH =3D '\\' > TAB_BACK_SLASH =3D '/' > +TAB_STAR =3D '*' > TAB_LINE_BREAK =3D '\n' > TAB_PRINTCHAR_VT =3D '\x0b' > TAB_PRINTCHAR_BS =3D '\b' > diff --git a/BaseTools/Source/Python/Common/Expression.py > b/BaseTools/Source/Python/Common/Expression.py > index a21ab5daa73e..db1310d534fb 100644 > --- a/BaseTools/Source/Python/Common/Expression.py > +++ b/BaseTools/Source/Python/Common/Expression.py > @@ -244,7 +244,7 @@ class ValueExpression(BaseExpression): > 'IN' : 'in' > } >=20 > - NonLetterOpLst =3D ['+', '-', '*', '/', '%', '&', '|', '^', '~', '<<= ', '>>', '!', '=3D', '>', '<', > '?', ':'] > + NonLetterOpLst =3D ['+', '-', TAB_STAR, '/', '%', '&', '|', '^', '~'= , > + '<<', '>>', '!', '=3D', '>', '<', '?', ':'] >=20 >=20 > SymbolPattern =3D re.compile("(" > @@ -498,7 +498,7 @@ class ValueExpression(BaseExpression): >=20 > # A [ * B]* > def _MulExpr(self): > - return self._ExprFuncTemplate(self._UnaryExpr, {"*", "/", "%"}) > + return self._ExprFuncTemplate(self._UnaryExpr, {TAB_STAR, "/", > + "%"}) >=20 > # [!]*A > def _UnaryExpr(self): > diff --git a/BaseTools/Source/Python/Common/Misc.py > b/BaseTools/Source/Python/Common/Misc.py > index 3b8efb2e7179..61ba79241fb6 100644 > --- a/BaseTools/Source/Python/Common/Misc.py > +++ b/BaseTools/Source/Python/Common/Misc.py > @@ -1088,7 +1088,7 @@ class tdict: > _ListType =3D type([]) > _TupleType =3D type(()) > _Wildcard =3D 'COMMON' > - _ValidWildcardList =3D ['COMMON', 'DEFAULT', 'ALL', '*', 'PLATFORM'] > + _ValidWildcardList =3D ['COMMON', 'DEFAULT', 'ALL', TAB_STAR, > + 'PLATFORM'] >=20 > def __init__(self, _Single_=3DFalse, _Level_=3D2): > self._Level_ =3D _Level_ > diff --git a/BaseTools/Source/Python/Common/ToolDefClassObject.py > b/BaseTools/Source/Python/Common/ToolDefClassObject.py > index 05a1ddfbcc89..186d279840c1 100644 > --- a/BaseTools/Source/Python/Common/ToolDefClassObject.py > +++ b/BaseTools/Source/Python/Common/ToolDefClassObject.py > @@ -29,7 +29,8 @@ from Common import GlobalData from > Common.MultipleWorkspace import MultipleWorkspace as mws from > .DataType import TAB_TOD_DEFINES_TARGET, > TAB_TOD_DEFINES_TOOL_CHAIN_TAG,\ > TAB_TOD_DEFINES_TARGET_ARCH, > TAB_TOD_DEFINES_COMMAND_TYPE\ > - , TAB_TOD_DEFINES_FAMILY, > TAB_TOD_DEFINES_BUILDRULEFAMILY > + , TAB_TOD_DEFINES_FAMILY, > TAB_TOD_DEFINES_BUILDRULEFAMILY,\ > + TAB_STAR, TAB_TAT_DEFINES_TOOL_CHAIN_CONF >=20 >=20 > ## > @@ -97,7 +98,7 @@ class ToolDefClassObject(object): > # adding/removing items from the original dict. > for Key in list(self.ToolsDefTxtDictionary.keys()): > List =3D Key.split('_') > - if List[Index] =3D=3D '*': > + if List[Index] =3D=3D TAB_STAR: > for String in self.ToolsDefTxtDatabase[KeyList[Index= ]]: > List[Index] =3D String > NewKey =3D '%s_%s_%s_%s_%s' % tuple(List) @@ -20= 2,20 +203,20 > @@ class ToolDefClassObject(object): > if len(List) !=3D 5: > EdkLogger.verbose("Line %d: Not a valid name of definiti= on: %s" % > ((Index + 1), Name)) > continue > - elif List[4] =3D=3D '*': > + elif List[4] =3D=3D TAB_STAR: > EdkLogger.verbose("Line %d: '*' is not allowed in last f= ield: %s" % > ((Index + 1), Name)) > continue > else: > self.ToolsDefTxtDictionary[Name] =3D Value > - if List[0] !=3D '*': > + if List[0] !=3D TAB_STAR: > self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TARGET] += =3D > [List[0]] > - if List[1] !=3D '*': > + if List[1] !=3D TAB_STAR: > self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TOOL_CHAIN_= TAG] > +=3D [List[1]] > - if List[2] !=3D '*': > + if List[2] !=3D TAB_STAR: > self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_TARGET_ARCH= ] +=3D > [List[2]] > - if List[3] !=3D '*': > + if List[3] !=3D TAB_STAR: > self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_COMMAND_TYP= E] > +=3D [List[3]] > - if List[4] =3D=3D TAB_TOD_DEFINES_FAMILY and List[2] =3D= =3D '*' and List[3] > =3D=3D '*': > + if List[4] =3D=3D TAB_TOD_DEFINES_FAMILY and List[2] =3D= =3D TAB_STAR > and List[3] =3D=3D TAB_STAR: > if TAB_TOD_DEFINES_FAMILY not in self.ToolsDefTxtDat= abase: > self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_FAMILY]= =3D {} > self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_FAMILY]= [List[1]] =3D > Value @@ -226,7 +227,7 @@ class ToolDefClassObject(object): >=20 > self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_BUILDRULEFAMILY][List[1]] =3D > Value > elif self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_FAMILY= ][List[1]] > !=3D Value: > EdkLogger.verbose("Line %d: No override allowed = for the family > of a tool chain: %s" % ((Index + 1), Name)) > - if List[4] =3D=3D TAB_TOD_DEFINES_BUILDRULEFAMILY and Li= st[2] =3D=3D '*' > and List[3] =3D=3D '*': > + if List[4] =3D=3D TAB_TOD_DEFINES_BUILDRULEFAMILY and Li= st[2] =3D=3D > TAB_STAR and List[3] =3D=3D TAB_STAR: > if TAB_TOD_DEFINES_BUILDRULEFAMILY not in > self.ToolsDefTxtDatabase \ > or List[1] not in > self.ToolsDefTxtDatabase[TAB_TOD_DEFINES_FAMILY]: > EdkLogger.verbose("Line %d: The family is not sp= ecified, but > BuildRuleFamily is specified for the tool chain: %s" % ((Index + 1), Name= )) > @@ -270,8 +271,8 @@ class ToolDefClassObject(object): > def ToolDefDict(ConfDir): > Target =3D TargetTxtDict(ConfDir) > ToolDef =3D ToolDefClassObject() > - if DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CONF in > Target.TargetTxtDictionary: > - ToolsDefFile =3D > Target.TargetTxtDictionary[DataType.TAB_TAT_DEFINES_TOOL_CHAIN_CON > F] > + if TAB_TAT_DEFINES_TOOL_CHAIN_CONF in Target.TargetTxtDictionary: > + ToolsDefFile =3D > + Target.TargetTxtDictionary[TAB_TAT_DEFINES_TOOL_CHAIN_CONF] > if ToolsDefFile: > ToolDef.LoadToolDefFile(os.path.normpath(ToolsDefFile)) > else: > diff --git a/BaseTools/Source/Python/Common/VpdInfoFile.py > b/BaseTools/Source/Python/Common/VpdInfoFile.py > index 2fb8e66fe99c..3be0670e36fb 100644 > --- a/BaseTools/Source/Python/Common/VpdInfoFile.py > +++ b/BaseTools/Source/Python/Common/VpdInfoFile.py > @@ -57,7 +57,7 @@ FILE_COMMENT_TEMPLATE =3D \ > # ::=3D "." > # ::=3D C Variable Name of the Token Space GUID > # ::=3D C Variable Name of the PCD > -# ::=3D {"*"} {} > +# ::=3D {TAB_STAR} {} > # ::=3D "0x" (a-fA-F0-9){1,8} > # ::=3D > # ::=3D {} {} {} > {} > @@ -92,7 +92,7 @@ class VpdInfoFile: > if (Vpd is None): > EdkLogger.error("VpdInfoFile", > BuildToolError.ATTRIBUTE_UNKNOWN_ERROR, "Invalid VPD PCD entry.") >=20 > - if not (Offset >=3D 0 or Offset =3D=3D "*"): > + if not (Offset >=3D 0 or Offset =3D=3D TAB_STAR): > EdkLogger.error("VpdInfoFile", BuildToolError.PARAMETER_INVA= LID, > "Invalid offset parameter: %s." % Offset) >=20 > if Vpd.DatumType =3D=3D TAB_VOID: > @@ -186,8 +186,8 @@ class VpdInfoFile: > VpdObjectTokenCName =3D PcdItem[0] > for sku in VpdObject.SkuInfoList: > if VpdObject.TokenSpaceGuidCName =3D=3D TokenSpaceNa= me and > VpdObjectTokenCName =3D=3D PcdTokenName.strip() and sku =3D=3D SkuId: > - if self._VpdArray[VpdObject][sku] =3D=3D "*": > - if Offset =3D=3D "*": > + if self._VpdArray[VpdObject][sku] =3D=3D TAB_STA= R: > + if Offset =3D=3D TAB_STAR: > EdkLogger.error("BPDG", BuildToolError.F= ORMAT_INVALID, > "The offset of %s has not been fixed up by third-party BPDG tool." % > PcdName) > self._VpdArray[VpdObject][sku] =3D Offset > Found =3D True > diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py > b/BaseTools/Source/Python/GenFds/FdfParser.py > index 44cc8f63d07b..cedc4ea0c122 100644 > --- a/BaseTools/Source/Python/GenFds/FdfParser.py > +++ b/BaseTools/Source/Python/GenFds/FdfParser.py > @@ -64,7 +64,6 @@ T_CHAR_CR =3D '\r' > T_CHAR_TAB =3D '\t' > T_CHAR_DOUBLE_QUOTE =3D '\"' > T_CHAR_SINGLE_QUOTE =3D '\'' > -T_CHAR_STAR =3D '*' > T_CHAR_BRACE_R =3D '}' >=20 > SEPARATORS =3D {TAB_EQUAL_SPLIT, TAB_VALUE_SPLIT, > TAB_COMMA_SPLIT, '{', T_CHAR_BRACE_R} @@ -533,7 +532,7 @@ class > FdfParser: > InComment =3D False > HashComment =3D False > # check for */ comment end > - elif InComment and not DoubleSlashComment and not HashCommen= t > and self._CurrentChar() =3D=3D T_CHAR_STAR and self._NextChar() =3D=3D > TAB_BACK_SLASH: > + elif InComment and not DoubleSlashComment and not > HashComment and self._CurrentChar() =3D=3D TAB_STAR and self._NextChar() > =3D=3D TAB_BACK_SLASH: > self._SetCurrentCharValue(TAB_SPACE_SPLIT) > self._GetOneChar() > self._SetCurrentCharValue(TAB_SPACE_SPLIT) > @@ -552,7 +551,7 @@ class FdfParser: > InComment =3D True > HashComment =3D True > # check for /* comment start > - elif self._CurrentChar() =3D=3D TAB_BACK_SLASH and self._Nex= tChar() =3D=3D > T_CHAR_STAR: > + elif self._CurrentChar() =3D=3D TAB_BACK_SLASH and self._Nex= tChar() =3D=3D > 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 0c8091b79841..0513f488fca3 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 =3D [] > FfsPath =3D os.path.join(GenFdsGlobalVariable.Fv= Dir, 'Ffs') > - FfsPath =3D glob(os.path.join(FfsPath, FileState= mentGuid) + '*') > + FfsPath =3D 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 ea61f723a73c..0812c56bdae8 100644 > --- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py > +++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py > @@ -217,12 +217,12 @@ class GenFdsGlobalVariable: >=20 > if not Inf.IsBinaryModule: > for File in Inf.Sources: > - if File.TagName in {"", "*", GenFdsGlobalVariable.ToolCh= ainTag} 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)) >=20 > 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)) >=20 > 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 =3D Key.split('_') > - if List[Index] =3D=3D '*': > + if List[Index] =3D=3D DataType.TAB_STAR: > for String in ToolDb[ToolList[Index]]: > if String in [Arch, GenFdsGlobalVariable.Tar= getName, > GenFdsGlobalVariable.ToolChainTag]: > List[Index] =3D String diff --git > a/BaseTools/Source/Python/GenFds/Section.py > b/BaseTools/Source/Python/GenFds/Section.py > index 19a70009dcce..bab74aedf0b9 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 =3D=3D FileType or (int(FfsInf.PiSpecVe= rsion, 16) >=3D > 0x0001000A \ > and FileType =3D=3D 'DX= E_DPEX' and File.Type =3D=3D > BINARY_FILE_TYPE_SMM_DEPEX) \ > or (FileType =3D=3D BIN= ARY_FILE_TYPE_TE and File.Type > =3D=3D BINARY_FILE_TYPE_PE32): > - if '*' in FfsInf.TargetOverrideList or File.Targ= et =3D=3D '*' or > File.Target in FfsInf.TargetOverrideList or FfsInf.TargetOverrideList =3D= =3D []: > + if TAB_STAR in FfsInf.TargetOverrideList or File= .Target =3D=3D > TAB_STAR or File.Target in FfsInf.TargetOverrideList or > FfsInf.TargetOverrideList =3D=3D []: > FileList.append(FfsInf.PatchEfiFile(File.Pat= h, File.Type)) > else: > GenFdsGlobalVariable.InfLogger ("\nBuild Tar= get \'%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)) diff --git > a/BaseTools/Source/Python/Workspace/DscBuildData.py > b/BaseTools/Source/Python/Workspace/DscBuildData.py > index 11aa63fb263c..22cbbb119a5a 100644 > --- a/BaseTools/Source/Python/Workspace/DscBuildData.py > +++ b/BaseTools/Source/Python/Workspace/DscBuildData.py > @@ -2315,11 +2315,11 @@ class DscBuildData(PlatformBuildClassObject): > continue > if Attr !=3D "FLAGS": > continue > - if Target =3D=3D "*" or Target =3D=3D self._Target: > - if Tag =3D=3D "*" or Tag =3D=3D self._Toolchain: > + if Target =3D=3D TAB_STAR or Target =3D=3D self._Target: > + if Tag =3D=3D TAB_STAR or Tag =3D=3D self._Toolchain: > if 'COMMON' not in BuildOptions: > BuildOptions['COMMON'] =3D set() > - if Arch =3D=3D "*": > + if Arch =3D=3D TAB_STAR: > BuildOptions['COMMON'].add(self.BuildOptions[Opt= ions]) > if Arch in self.SupArchList: > if Arch not in BuildOptions: > -- > 2.16.2.windows.1