summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/AutoGen/InfSectionParser.py
diff options
context:
space:
mode:
authorYonghong Zhu <yonghong.zhu@intel.com>2017-04-13 14:33:05 +0800
committerYonghong Zhu <yonghong.zhu@intel.com>2017-06-24 23:00:08 +0800
commitdfa41b4a483e562f3c739acfbc2d911550f50e47 (patch)
tree727744d9c5d65fb293264759f9f31960d56df838 /BaseTools/Source/Python/AutoGen/InfSectionParser.py
parent78bcd52abb1444c4dec7536d35f1a89dfe7e3625 (diff)
downloadedk2-dfa41b4a483e562f3c739acfbc2d911550f50e47.tar.gz
edk2-dfa41b4a483e562f3c739acfbc2d911550f50e47.tar.bz2
edk2-dfa41b4a483e562f3c739acfbc2d911550f50e47.zip
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>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/InfSectionParser.py')
-rw-r--r--BaseTools/Source/Python/AutoGen/InfSectionParser.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/AutoGen/InfSectionParser.py b/BaseTools/Source/Python/AutoGen/InfSectionParser.py
index 7f78236548..cdc9e5e8a8 100644
--- a/BaseTools/Source/Python/AutoGen/InfSectionParser.py
+++ b/BaseTools/Source/Python/AutoGen/InfSectionParser.py
@@ -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
#