This patch is going to:

1.	Add a recovery mode for UPT failure
2.	Add UNI file support
3.	Add binary file header support
4.	Add support for PCD error message
5.	Add support for replace
6.	Format generated INF/DEC files
7.	Update dependency check
8.	Other minor fixes


Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: Gao, Liming <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15896 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Hess Chen
2014-08-26 05:58:02 +00:00
committed by hchen30
parent f0aa06e385
commit 421ccda307
56 changed files with 5945 additions and 1710 deletions

View File

@@ -2,7 +2,7 @@
# This file is used to define class objects of INF file [Binaries] section.
# It will consumed by InfParser.
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this
@@ -99,6 +99,7 @@ class InfBianryCommonItem(InfBianryItem, CurrentLine):
self.CommonType = ''
self.TagName = ''
self.Family = ''
self.GuidValue = ''
InfBianryItem.__init__(self)
CurrentLine.__init__(self)
@@ -116,6 +117,11 @@ class InfBianryCommonItem(InfBianryItem, CurrentLine):
self.Family = Family
def GetFamily(self):
return self.Family
def SetGuidValue(self, GuidValue):
self.GuidValue = GuidValue
def GetGuidValue(self):
return self.GuidValue
##
#
@@ -150,7 +156,7 @@ class InfBinariesObject(InfSectionCommonDef):
if len(VerContent) < 2:
Logger.Error("InfParser",
ToolError.FORMAT_INVALID,
ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID % (VerContent[0]),
ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID % (VerContent[0], 2),
File=VerCurrentLine.GetFileName(),
Line=VerCurrentLine.GetLineNo(),
ExtraData=VerCurrentLine.GetLineString())
@@ -291,18 +297,29 @@ class InfBinariesObject(InfSectionCommonDef):
CurrentLineOfItem = Item[2]
GlobalData.gINF_CURRENT_LINE = CurrentLineOfItem
InfBianryCommonItemObj = None
if len(ItemContent) < 2:
if ItemContent[0] == 'SUBTYPE_GUID':
if len(ItemContent) < 3:
Logger.Error("InfParser",
ToolError.FORMAT_INVALID,
ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID % (ItemContent[0], 3),
File=CurrentLineOfItem.GetFileName(),
Line=CurrentLineOfItem.GetLineNo(),
ExtraData=CurrentLineOfItem.GetLineString())
return False
else:
if len(ItemContent) < 2:
Logger.Error("InfParser",
ToolError.FORMAT_INVALID,
ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID % (ItemContent[0], 2),
File=CurrentLineOfItem.GetFileName(),
Line=CurrentLineOfItem.GetLineNo(),
ExtraData=CurrentLineOfItem.GetLineString())
return False
if len(ItemContent) > 7:
Logger.Error("InfParser",
ToolError.FORMAT_INVALID,
ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID % (ItemContent[0]),
File=CurrentLineOfItem.GetFileName(),
Line=CurrentLineOfItem.GetLineNo(),
ExtraData=CurrentLineOfItem.GetLineString())
return False
if len(ItemContent) > 6:
Logger.Error("InfParser",
ToolError.FORMAT_INVALID,
ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID_MAX % (ItemContent[0], 6),
ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID_MAX % (ItemContent[0], 7),
File=CurrentLineOfItem.GetFileName(),
Line=CurrentLineOfItem.GetLineNo(),
ExtraData=CurrentLineOfItem.GetLineString())
@@ -318,7 +335,7 @@ class InfBinariesObject(InfSectionCommonDef):
BinaryFileType = ItemContent[0].strip()
if BinaryFileType == 'RAW' or BinaryFileType == 'ACPI' or BinaryFileType == 'ASL':
BinaryFileType = 'BIN'
if BinaryFileType not in DT.BINARY_FILE_TYPE_LIST:
Logger.Error("InfParser",
ToolError.FORMAT_INVALID,
@@ -342,44 +359,64 @@ class InfBinariesObject(InfSectionCommonDef):
InfBianryCommonItemObj.SetType(BinaryFileType)
InfBianryCommonItemObj.SetCommonType(ItemContent[0])
FileName = ''
if BinaryFileType == 'FREEFORM':
InfBianryCommonItemObj.SetGuidValue(ItemContent[1])
if len(ItemContent) >= 3:
FileName = ItemContent[2]
else:
Logger.Error("InfParser",
ToolError.FORMAT_INVALID,
ST.ERR_INF_PARSER_BINARY_ITEM_FILENAME_NOT_EXIST,
File=CurrentLineOfItem.GetFileName(),
Line=CurrentLineOfItem.GetLineNo(),
ExtraData=CurrentLineOfItem.GetLineString())
else:
FileName = ItemContent[1]
#
# Verify File exist or not
#
FullFileName = os.path.normpath(os.path.realpath(os.path.join(GlobalData.gINF_MODULE_DIR,
ItemContent[1])))
if not (ValidFile(FullFileName) or ValidFile(ItemContent[1])):
FileName)))
if not (ValidFile(FullFileName) or ValidFile(FileName)):
Logger.Error("InfParser",
ToolError.FORMAT_INVALID,
ST.ERR_INF_PARSER_BINARY_ITEM_FILE_NOT_EXIST % (ItemContent[1]),
ST.ERR_INF_PARSER_BINARY_ITEM_FILE_NOT_EXIST % (FileName),
File=CurrentLineOfItem.GetFileName(),
Line=CurrentLineOfItem.GetLineNo(),
ExtraData=CurrentLineOfItem.GetLineString())
#
# Validate file exist/format.
#
if IsValidPath(ItemContent[1], GlobalData.gINF_MODULE_DIR):
if IsValidPath(FileName, GlobalData.gINF_MODULE_DIR):
IsValidFileFlag = True
else:
Logger.Error("InfParser",
ToolError.FORMAT_INVALID,
ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_INVALID % (ItemContent[1]),
ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_INVALID % (FileName),
File=CurrentLineOfItem.GetFileName(),
Line=CurrentLineOfItem.GetLineNo(),
ExtraData=CurrentLineOfItem.GetLineString())
return False
if IsValidFileFlag:
ItemContent[0] = ConvPathFromAbsToRel(ItemContent[0], GlobalData.gINF_MODULE_DIR)
InfBianryCommonItemObj.SetFileName(ItemContent[1])
InfBianryCommonItemObj.SetFileName(FileName)
if len(ItemContent) >= 3:
#
# Add Target information
#
InfBianryCommonItemObj.SetTarget(ItemContent[2])
if BinaryFileType != 'FREEFORM':
InfBianryCommonItemObj.SetTarget(ItemContent[2])
if len(ItemContent) >= 4:
#
# Add Family information
#
InfBianryCommonItemObj.SetFamily(ItemContent[3])
if BinaryFileType != 'FREEFORM':
InfBianryCommonItemObj.SetFamily(ItemContent[3])
else:
InfBianryCommonItemObj.SetTarget(ItemContent[3])
if len(ItemContent) >= 5:
#
# TagName entries are build system specific. If there
@@ -388,28 +425,62 @@ class InfBinariesObject(InfSectionCommonDef):
# system specific content cannot be distributed using
# the UDP
#
if ItemContent[4].strip() != '':
Logger.Error("InfParser",
ToolError.FORMAT_INVALID,
ST.ERR_INF_PARSER_TAGNAME_NOT_PERMITTED % (ItemContent[4]),
File=CurrentLineOfItem.GetFileName(),
Line=CurrentLineOfItem.GetLineNo(),
ExtraData=CurrentLineOfItem.GetLineString())
if len(ItemContent) == 6:
if BinaryFileType != 'FREEFORM':
if ItemContent[4].strip() != '':
Logger.Error("InfParser",
ToolError.FORMAT_INVALID,
ST.ERR_INF_PARSER_TAGNAME_NOT_PERMITTED % (ItemContent[4]),
File=CurrentLineOfItem.GetFileName(),
Line=CurrentLineOfItem.GetLineNo(),
ExtraData=CurrentLineOfItem.GetLineString())
else:
InfBianryCommonItemObj.SetFamily(ItemContent[4])
if len(ItemContent) >= 6:
#
# Add FeatureFlagExp
#
if ItemContent[5].strip() == '':
if BinaryFileType != 'FREEFORM':
if ItemContent[5].strip() == '':
Logger.Error("InfParser",
ToolError.FORMAT_INVALID,
ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_MISSING,
File=CurrentLineOfItem.GetFileName(),
Line=CurrentLineOfItem.GetLineNo(),
ExtraData=CurrentLineOfItem.GetLineString())
#
# Validate Feature Flag Express
#
FeatureFlagRtv = IsValidFeatureFlagExp(ItemContent[5].strip())
if not FeatureFlagRtv[0]:
Logger.Error("InfParser",
ToolError.FORMAT_INVALID,
ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INVLID % (FeatureFlagRtv[1]),
File=CurrentLineOfItem.GetFileName(),
Line=CurrentLineOfItem.GetLineNo(),
ExtraData=CurrentLineOfItem.GetLineString())
InfBianryCommonItemObj.SetFeatureFlagExp(ItemContent[5])
else:
if ItemContent[5].strip() != '':
Logger.Error("InfParser",
ToolError.FORMAT_INVALID,
ST.ERR_INF_PARSER_TAGNAME_NOT_PERMITTED % (ItemContent[5]),
File=CurrentLineOfItem.GetFileName(),
Line=CurrentLineOfItem.GetLineNo(),
ExtraData=CurrentLineOfItem.GetLineString())
if len(ItemContent) == 7:
if ItemContent[6].strip() == '':
Logger.Error("InfParser",
ToolError.FORMAT_INVALID,
ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_MISSING,
File=CurrentLineOfItem.GetFileName(),
Line=CurrentLineOfItem.GetLineNo(),
ExtraData=CurrentLineOfItem.GetLineString())
ToolError.FORMAT_INVALID,
ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_MISSING,
File=CurrentLineOfItem.GetFileName(),
Line=CurrentLineOfItem.GetLineNo(),
ExtraData=CurrentLineOfItem.GetLineString())
#
# Validate Feature Flag Express
#
FeatureFlagRtv = IsValidFeatureFlagExp(ItemContent[5].strip())
FeatureFlagRtv = IsValidFeatureFlagExp(ItemContent[6].strip())
if not FeatureFlagRtv[0]:
Logger.Error("InfParser",
ToolError.FORMAT_INVALID,
@@ -417,7 +488,7 @@ class InfBinariesObject(InfSectionCommonDef):
File=CurrentLineOfItem.GetFileName(),
Line=CurrentLineOfItem.GetLineNo(),
ExtraData=CurrentLineOfItem.GetLineString())
InfBianryCommonItemObj.SetFeatureFlagExp(ItemContent[5])
InfBianryCommonItemObj.SetFeatureFlagExp(ItemContent[6])
InfBianryCommonItemObj.SetSupArchList(__SupArchList)
@@ -489,7 +560,7 @@ class InfBinariesObject(InfSectionCommonDef):
if len(UiContent) < 2:
Logger.Error("InfParser",
ToolError.FORMAT_INVALID,
ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID % (UiContent[0]),
ST.ERR_INF_PARSER_BINARY_ITEM_FORMAT_INVALID % (UiContent[0], 2),
File=UiCurrentLine.GetFileName(),
Line=UiCurrentLine.GetLineNo(),
ExtraData=UiCurrentLine.GetLineString())

View File

@@ -2,7 +2,7 @@
# This file is used to define class objects of INF file [BuildOptions] section.
# It will consumed by InfParser.
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this
@@ -84,8 +84,8 @@ class InfBuildOptionsObject(InfSectionCommonDef):
if len(BuildOptCont) >= 1:
InfBuildOptionItemObj = InfBuildOptionItem()
InfBuildOptionItemObj.SetAsBuildList(BuildOptCont)
InfBuildOptionItemObj.SetSupArchList(ArchList)
self.BuildOptions.append(InfBuildOptionItemObj)
return True

View File

@@ -2,7 +2,7 @@
# This file is used to define class objects of [Defines] section for INF file.
# It will consumed by InfParser
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this
@@ -27,6 +27,7 @@ from Library.String import GetSplitValueList
from Library.Misc import CheckGuidRegFormat
from Library.Misc import Sdict
from Library.Misc import ConvPathFromAbsToRel
from Library.Misc import ValidateUNIFilePath
from Library.ExpressionValidate import IsValidFeatureFlagExp
from Library.ParserValidate import IsValidWord
from Library.ParserValidate import IsValidInfMoudleType
@@ -185,6 +186,7 @@ class InfDefSection(InfDefSectionOptionRomInfo):
self.BaseName = None
self.FileGuid = None
self.ModuleType = None
self.ModuleUniFileName = None
self.InfVersion = None
self.EdkReleaseVersion = None
self.UefiSpecificationVersion = None
@@ -216,8 +218,7 @@ class InfDefSection(InfDefSectionOptionRomInfo):
if self.BaseName != None:
ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND%(DT.TAB_INF_DEFINES_BASE_NAME),
LineInfo=self.CurrentLine)
return False
return False
if not (BaseName == '' or BaseName == None):
if IsValidWord(BaseName) and not BaseName.startswith("_"):
self.BaseName = InfDefMember()
@@ -301,6 +302,23 @@ class InfDefSection(InfDefSectionOptionRomInfo):
def GetModuleType(self):
return self.ModuleType
## SetModuleUniFileName
#
# @param ModuleUniFileName: ModuleUniFileName
#
def SetModuleUniFileName(self, ModuleUniFileName, Comments):
if Comments:
pass
if self.ModuleUniFileName != None:
ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_MORE_THAN_ONE_FOUND%(DT.TAB_INF_DEFINES_MODULE_UNI_FILE),
LineInfo=self.CurrentLine)
self.ModuleUniFileName = ModuleUniFileName
## GetModuleType
#
def GetModuleUniFileName(self):
return self.ModuleUniFileName
## SetInfVersion
#
# @param InfVersion: InfVersion
@@ -520,10 +538,8 @@ class InfDefSection(InfDefSectionOptionRomInfo):
# It can be a list
#
ValueList = []
TokenList = GetSplitValueList(EntryPoint, DT.TAB_VALUE_SPLIT)
ValueList[0:len(TokenList)] = TokenList
InfDefineEntryPointItemObj = InfDefineEntryPointItem()
if not IsValidCVariableName(ValueList[0]):
ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%\
@@ -542,13 +558,11 @@ class InfDefSection(InfDefSectionOptionRomInfo):
if not FeatureFlagRtv[0]:
ErrorInInf(ST.ERR_INF_PARSER_FEATURE_FLAG_EXP_SYNTAX_INVLID%\
(FeatureFlagRtv[1]),
LineInfo=self.CurrentLine)
LineInfo=self.CurrentLine)
InfDefineEntryPointItemObj.SetFeatureFlagExp(ValueList[1])
if len(ValueList) > 2:
ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(EntryPoint),
LineInfo=self.CurrentLine)
InfDefineEntryPointItemObj.Comments = Comments
self.EntryPoint.append(InfDefineEntryPointItemObj)
@@ -563,10 +577,8 @@ class InfDefSection(InfDefSectionOptionRomInfo):
# It can be a list
#
ValueList = []
TokenList = GetSplitValueList(UnloadImages, DT.TAB_VALUE_SPLIT)
ValueList[0:len(TokenList)] = TokenList
InfDefineUnloadImageItemObj = InfDefineUnloadImageItem()
if not IsValidCVariableName(ValueList[0]):
ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(ValueList[0]),
@@ -588,7 +600,6 @@ class InfDefSection(InfDefSectionOptionRomInfo):
if len(ValueList) > 2:
ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(UnloadImages),
LineInfo=self.CurrentLine)
InfDefineUnloadImageItemObj.Comments = Comments
self.UnloadImages.append(InfDefineUnloadImageItemObj)
@@ -603,10 +614,8 @@ class InfDefSection(InfDefSectionOptionRomInfo):
# It can be a list
#
ValueList = []
TokenList = GetSplitValueList(Constructor, DT.TAB_VALUE_SPLIT)
ValueList[0:len(TokenList)] = TokenList
InfDefineConstructorItemObj = InfDefineConstructorItem()
if not IsValidCVariableName(ValueList[0]):
ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(ValueList[0]),
@@ -638,7 +647,6 @@ class InfDefSection(InfDefSectionOptionRomInfo):
if len(ValueList) > 3:
ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(Constructor),
LineInfo=self.CurrentLine)
InfDefineConstructorItemObj.Comments = Comments
self.Constructor.append(InfDefineConstructorItemObj)
@@ -653,10 +661,8 @@ class InfDefSection(InfDefSectionOptionRomInfo):
# It can be a list and only 1 set to TRUE
#
ValueList = []
TokenList = GetSplitValueList(Destructor, DT.TAB_VALUE_SPLIT)
ValueList[0:len(TokenList)] = TokenList
InfDefineDestructorItemObj = InfDefineDestructorItem()
if not IsValidCVariableName(ValueList[0]):
ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(ValueList[0]),
@@ -715,8 +721,6 @@ class InfDefSection(InfDefSectionOptionRomInfo):
def GetShadow(self):
return self.Shadow
#
# <Family> ::= {"MSFT"} {"GCC"}
# <CustomMake> ::= [<Family> "|"] <Filename>
@@ -788,8 +792,7 @@ class InfDefSection(InfDefSectionOptionRomInfo):
else:
ErrorInInf(ST.ERR_INF_PARSER_DEFINE_FROMAT_INVALID%(Name),
LineInfo=self.CurrentLine)
return False
return False
return True
def GetSpecification(self):
@@ -860,6 +863,7 @@ gFUNCTION_MAPPING_FOR_DEFINE_SECTION = {
#
# Optional Fields
#
DT.TAB_INF_DEFINES_MODULE_UNI_FILE : InfDefSection.SetModuleUniFileName,
DT.TAB_INF_DEFINES_EDK_RELEASE_VERSION : InfDefSection.SetEdkReleaseVersion,
DT.TAB_INF_DEFINES_UEFI_SPECIFICATION_VERSION : InfDefSection.SetUefiSpecificationVersion,
DT.TAB_INF_DEFINES_PI_SPECIFICATION_VERSION : InfDefSection.SetPiSpecificationVersion,
@@ -891,7 +895,6 @@ class InfDefMember():
self.Name = Name
self.Value = Value
self.CurrentLine = CurrentLine()
def GetName(self):
return self.Name
def SetName(self, Name):
@@ -914,8 +917,7 @@ class InfDefObject(InfSectionCommonDef):
#
HasFoundInfVersionFalg = False
LineInfo = ['', -1, '']
ArchListString = ' '.join(Arch)
ArchListString = ' '.join(Arch)
#
# Parse Define items.
#
@@ -923,6 +925,15 @@ class InfDefObject(InfSectionCommonDef):
ProcessFunc = None
Name = InfDefMemberObj.GetName()
Value = InfDefMemberObj.GetValue()
if Name == DT.TAB_INF_DEFINES_MODULE_UNI_FILE:
ValidateUNIFilePath(Value)
Value = os.path.join(os.path.dirname(InfDefMemberObj.CurrentLine.FileName), Value)
if not os.path.isfile(Value) or not os.path.exists(Value):
LineInfo[0] = InfDefMemberObj.CurrentLine.GetFileName()
LineInfo[1] = InfDefMemberObj.CurrentLine.GetLineNo()
LineInfo[2] = InfDefMemberObj.CurrentLine.GetLineString()
ErrorInInf(ST.ERR_INF_PARSER_FILE_NOT_EXIST_OR_NAME_INVALID%(Name),
LineInfo=LineInfo)
InfLineCommentObj = InfLineCommentObject()
InfLineCommentObj.SetHeaderComments(InfDefMemberObj.Comments.GetHeaderComments())
InfLineCommentObj.SetTailComments(InfDefMemberObj.Comments.GetTailComments())
@@ -932,7 +943,6 @@ class InfDefObject(InfSectionCommonDef):
RaiseError=True)
if Name == DT.TAB_INF_DEFINES_INF_VERSION:
HasFoundInfVersionFalg = True
if not (Name == '' or Name == None):
#
# Process "SPEC" Keyword definition.
@@ -953,8 +963,7 @@ class InfDefObject(InfSectionCommonDef):
#
if Name not in gFUNCTION_MAPPING_FOR_DEFINE_SECTION.keys():
ErrorInInf(ST.ERR_INF_PARSER_DEFINE_SECTION_KEYWORD_INVALID%(Name),
LineInfo=LineInfo)
LineInfo=LineInfo)
else:
ProcessFunc = gFUNCTION_MAPPING_FOR_DEFINE_SECTION[Name]
if (ProcessFunc != None):
@@ -980,7 +989,6 @@ class InfDefObject(InfSectionCommonDef):
if (ProcessFunc != None):
ProcessFunc(DefineList, Value, InfLineCommentObj)
self.Defines[ArchListString] = DefineList
#
# After set, check whether INF_VERSION defined.
#

View File

@@ -2,7 +2,7 @@
# This file is used to define class objects of INF file [Guids] section.
# It will consumed by InfParser.
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this
@@ -156,7 +156,6 @@ def ParseGuidComment(CommentsList, InfGuidItemObj):
#
if CommentItemUsage == CommentItemGuidType == PreUsage == PreGuidType == DT.ITEM_UNDEFINED:
CommentItemHelpText = PreHelpText + DT.END_OF_LINE + CommentItemHelpText
PreHelpText = CommentItemHelpText
if BlockFlag == 4:
@@ -164,6 +163,8 @@ def ParseGuidComment(CommentsList, InfGuidItemObj):
CommentItemIns.SetUsageItem(CommentItemUsage)
CommentItemIns.SetGuidTypeItem(CommentItemGuidType)
CommentItemIns.SetVariableNameItem(CommentItemVarString)
if CommentItemHelpText == '' or CommentItemHelpText.endswith(DT.END_OF_LINE):
CommentItemHelpText = CommentItemHelpText.strip(DT.END_OF_LINE)
CommentItemIns.SetHelpStringItem(CommentItemHelpText)
CommentInsList.append(CommentItemIns)
@@ -180,7 +181,7 @@ def ParseGuidComment(CommentsList, InfGuidItemObj):
CommentItemIns.SetUsageItem(DT.ITEM_UNDEFINED)
CommentItemIns.SetGuidTypeItem(DT.ITEM_UNDEFINED)
if PreHelpText == '' or PreHelpText.endswith(DT.END_OF_LINE):
PreHelpText += DT.END_OF_LINE
PreHelpText = PreHelpText.strip(DT.END_OF_LINE)
CommentItemIns.SetHelpStringItem(PreHelpText)
CommentInsList.append(CommentItemIns)
#
@@ -190,6 +191,8 @@ def ParseGuidComment(CommentsList, InfGuidItemObj):
CommentItemIns.SetUsageItem(CommentItemUsage)
CommentItemIns.SetGuidTypeItem(CommentItemGuidType)
CommentItemIns.SetVariableNameItem(CommentItemVarString)
if CommentItemHelpText == '' or CommentItemHelpText.endswith(DT.END_OF_LINE):
CommentItemHelpText = CommentItemHelpText.strip(DT.END_OF_LINE)
CommentItemIns.SetHelpStringItem(CommentItemHelpText)
CommentInsList.append(CommentItemIns)

View File

@@ -2,7 +2,7 @@
# This file is used to define class objects of INF file [LibraryClasses] section.
# It will consumed by InfParser.
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this
@@ -236,6 +236,7 @@ class InfLibraryClassObject():
#
LibItemObj.SetFileGuid(LibItem[0])
LibItemObj.SetVersion(LibItem[1])
LibItemObj.SetSupArchList(__SupArchList)
if self.LibraryClasses.has_key((LibItemObj)):
LibraryList = self.LibraryClasses[LibItemObj]

File diff suppressed because it is too large Load Diff