BaseTools: Clean up source files
1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
@ -31,7 +31,7 @@ from Common.LongFilePathSupport import OpenLongFilePath as open
|
||||
# Version and Copyright
|
||||
__version_number__ = ("0.10" + " " + gBUILD_VERSION)
|
||||
__version__ = "%prog Version " + __version_number__
|
||||
__copyright__ = "Copyright (c) 2007-2017, Intel Corporation. All rights reserved."
|
||||
__copyright__ = "Copyright (c) 2007-2018, Intel Corporation. All rights reserved."
|
||||
|
||||
## Regular expression for matching Line Control directive like "#line xxx"
|
||||
gLineControlDirective = re.compile('^\s*#(?:line)?\s+([0-9]+)\s+"*([^"]*)"')
|
||||
@ -261,7 +261,7 @@ def TrimPreprocessedFile(Source, Target, ConvertHex, TrimLong):
|
||||
#
|
||||
def TrimPreprocessedVfr(Source, Target):
|
||||
CreateDirectory(os.path.dirname(Target))
|
||||
|
||||
|
||||
try:
|
||||
f = open (Source, 'r')
|
||||
except:
|
||||
@ -338,7 +338,7 @@ def DoInclude(Source, Indent='', IncludePathList=[], LocalSearchPath=None):
|
||||
SearchPathList = [LocalSearchPath] + IncludePathList
|
||||
else:
|
||||
SearchPathList = IncludePathList
|
||||
|
||||
|
||||
for IncludePath in SearchPathList:
|
||||
IncludeFile = os.path.join(IncludePath, Source)
|
||||
if os.path.isfile(IncludeFile):
|
||||
@ -349,7 +349,7 @@ def DoInclude(Source, Indent='', IncludePathList=[], LocalSearchPath=None):
|
||||
except:
|
||||
EdkLogger.error("Trim", FILE_OPEN_FAILURE, ExtraData=Source)
|
||||
|
||||
|
||||
|
||||
# avoid A "include" B and B "include" A
|
||||
IncludeFile = os.path.abspath(os.path.normpath(IncludeFile))
|
||||
if IncludeFile in gIncludedAslFile:
|
||||
@ -357,7 +357,7 @@ def DoInclude(Source, Indent='', IncludePathList=[], LocalSearchPath=None):
|
||||
ExtraData= "%s -> %s" % (" -> ".join(gIncludedAslFile), IncludeFile))
|
||||
return []
|
||||
gIncludedAslFile.append(IncludeFile)
|
||||
|
||||
|
||||
for Line in F:
|
||||
LocalSearchPath = None
|
||||
Result = gAslIncludePattern.findall(Line)
|
||||
@ -367,7 +367,7 @@ def DoInclude(Source, Indent='', IncludePathList=[], LocalSearchPath=None):
|
||||
NewFileContent.append("%s%s" % (Indent, Line))
|
||||
continue
|
||||
#
|
||||
# We should first search the local directory if current file are using pattern #include "XXX"
|
||||
# We should first search the local directory if current file are using pattern #include "XXX"
|
||||
#
|
||||
if Result[0][2] == '"':
|
||||
LocalSearchPath = os.path.dirname(IncludeFile)
|
||||
@ -388,20 +388,20 @@ def DoInclude(Source, Indent='', IncludePathList=[], LocalSearchPath=None):
|
||||
#
|
||||
# @param Source File to be trimmed
|
||||
# @param Target File to store the trimmed content
|
||||
# @param IncludePathFile The file to log the external include path
|
||||
# @param IncludePathFile The file to log the external include path
|
||||
#
|
||||
def TrimAslFile(Source, Target, IncludePathFile):
|
||||
CreateDirectory(os.path.dirname(Target))
|
||||
|
||||
|
||||
SourceDir = os.path.dirname(Source)
|
||||
if SourceDir == '':
|
||||
SourceDir = '.'
|
||||
|
||||
|
||||
#
|
||||
# Add source directory as the first search directory
|
||||
#
|
||||
IncludePathList = [SourceDir]
|
||||
|
||||
|
||||
#
|
||||
# If additional include path file is specified, append them all
|
||||
# to the search directory list.
|
||||
@ -672,7 +672,7 @@ def Main():
|
||||
EdkLogger.SetLevel(CommandOptions.LogLevel)
|
||||
except FatalError as X:
|
||||
return 1
|
||||
|
||||
|
||||
try:
|
||||
if CommandOptions.FileType == "Vfr":
|
||||
if CommandOptions.OutputFile is None:
|
||||
|
Reference in New Issue
Block a user