BaseTools: Copy "TianoCore" userextensions into As Built Inf

Per build spec to update the tool to copy "TianoCore" userextensions to
As Built INF file.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Yonghong Zhu
2017-04-13 14:33:05 +08:00
parent 78bcd52abb
commit dfa41b4a48
2 changed files with 54 additions and 0 deletions

View File

@ -62,6 +62,24 @@ class InfSectionParser():
SectionData = []
SectionLine = ''
# Get user extension TianoCore data
#
# @return: a list include some dictionary that key is section and value is a list contain all data.
def GetUserExtensionTianoCore(self):
UserExtensionTianoCore = []
if not self._FileSectionDataList:
return UserExtensionTianoCore
for SectionDataDict in self._FileSectionDataList:
for key in SectionDataDict.keys():
if key.lower().startswith("[userextensions") and key.lower().find('.tianocore.') > -1:
SectionLine = key.lstrip(TAB_SECTION_START).rstrip(TAB_SECTION_END)
SubSectionList = [SectionLine]
if str(SectionLine).find(TAB_COMMA_SPLIT) > -1:
SubSectionList = str(SectionLine).split(TAB_COMMA_SPLIT)
for SubSection in SubSectionList:
if SubSection.lower().find('.tianocore.') > -1:
UserExtensionTianoCore.append({SubSection: SectionDataDict[key]})
return UserExtensionTianoCore
# Get depex expresion
#