mirror of https://github.com/acidanthera/audk.git
BaseTools/Upt: Fix several bugs
1. Fix a bug of generating additional EOL in file header. 2. Fix a bug of format error for Defines section. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen <hesheng.chen@intel.com> Reviewed-by: Yingke Liu <yingke.d.liu@Intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16153 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
b15aae9f2e
commit
875cc5bb97
|
@ -344,7 +344,7 @@ def PackageToDec(Package, DistHeader = None):
|
|||
Content += GenHeaderCommentSection(PackageAbstract, \
|
||||
PackageDescription, \
|
||||
PackageCopyright, \
|
||||
PackageLicense)
|
||||
PackageLicense).replace('\r\n', '\n')
|
||||
|
||||
#
|
||||
# Generate Binary header
|
||||
|
|
|
@ -110,7 +110,7 @@ def ModuleToInf(ModuleObject, PackageObject=None, DistHeader=None):
|
|||
Content += GenHeaderCommentSection(ModuleAbstract,
|
||||
ModuleDescription,
|
||||
ModuleCopyright,
|
||||
ModuleLicense)
|
||||
ModuleLicense).replace('\r\n', '\n')
|
||||
|
||||
#
|
||||
# Generate Binary Header
|
||||
|
@ -261,13 +261,18 @@ def GenDefines(ModuleObject):
|
|||
#
|
||||
# generate [Defines] section
|
||||
#
|
||||
LeftOffset = 31
|
||||
Content = ''
|
||||
NewSectionDict = {}
|
||||
|
||||
for UserExtension in ModuleObject.GetUserExtensionList():
|
||||
DefinesDict = UserExtension.GetDefinesDict()
|
||||
if not DefinesDict:
|
||||
continue
|
||||
for Statement in DefinesDict:
|
||||
if Statement.split(DT.TAB_EQUAL_SPLIT) > 1:
|
||||
Statement = (u'%s ' % Statement.split(DT.TAB_EQUAL_SPLIT, 1)[0]).ljust(LeftOffset) \
|
||||
+ u'= %s' % Statement.split(DT.TAB_EQUAL_SPLIT, 1)[1].lstrip()
|
||||
SortedArch = DT.TAB_ARCH_COMMON
|
||||
if Statement.strip().startswith(DT.TAB_INF_DEFINES_CUSTOM_MAKEFILE):
|
||||
pos = Statement.find(DT.TAB_VALUE_SPLIT)
|
||||
|
@ -280,11 +285,7 @@ def GenDefines(ModuleObject):
|
|||
else:
|
||||
NewSectionDict[SortedArch] = [Statement]
|
||||
SpecialStatementList = []
|
||||
#
|
||||
# Add INF_VERSION statement firstly
|
||||
#
|
||||
|
||||
LeftOffset = 31
|
||||
|
||||
# TAB_INF_DEFINES_INF_VERSION
|
||||
Statement = (u'%s ' % DT.TAB_INF_DEFINES_INF_VERSION).ljust(LeftOffset) + u'= %s' % '0x00010017'
|
||||
SpecialStatementList.append(Statement)
|
||||
|
|
Loading…
Reference in New Issue