summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/UPT/Parser/InfParser.py
diff options
context:
space:
mode:
authorHess Chen <hesheng.chen@intel.com>2014-08-26 05:58:02 +0000
committerhchen30 <hchen30@6f19259b-4bc3-4df7-8a09-765794883524>2014-08-26 05:58:02 +0000
commit421ccda3079077dd613308526e02d797f5cc356a (patch)
treeecf0907550f140643cb5ab965fd3b87d837b8ee4 /BaseTools/Source/Python/UPT/Parser/InfParser.py
parentf0aa06e385c41743ac805bed9469aac336a6ec4c (diff)
downloadedk2-421ccda3079077dd613308526e02d797f5cc356a.tar.gz
edk2-421ccda3079077dd613308526e02d797f5cc356a.tar.bz2
edk2-421ccda3079077dd613308526e02d797f5cc356a.zip
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
Diffstat (limited to 'BaseTools/Source/Python/UPT/Parser/InfParser.py')
-rw-r--r--BaseTools/Source/Python/UPT/Parser/InfParser.py46
1 files changed, 23 insertions, 23 deletions
diff --git a/BaseTools/Source/Python/UPT/Parser/InfParser.py b/BaseTools/Source/Python/UPT/Parser/InfParser.py
index 8a41eca0a7..e7bef2e35e 100644
--- a/BaseTools/Source/Python/UPT/Parser/InfParser.py
+++ b/BaseTools/Source/Python/UPT/Parser/InfParser.py
@@ -1,7 +1,7 @@
## @file
# This file contained the parser for INF file
#
-# Copyright (c) 2011 - 2013, 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
@@ -210,7 +210,7 @@ class InfParser(InfSectionParser):
SectionLines.append((Line, LineNo))
HeaderCommentStart = True
continue
-
+
#
# Collect Header content.
#
@@ -227,18 +227,18 @@ class InfParser(InfSectionParser):
HeaderCommentEnd = True
BinaryHeaderCommentStart = False
BinaryHeaderCommentEnd = False
- HeaderCommentStart = False
+ HeaderCommentStart = False
if Line.find(DT.TAB_BINARY_HEADER_COMMENT) > -1:
self.InfHeaderParser(SectionLines, self.InfHeader, self.FileName)
SectionLines = []
else:
SectionLines.append((Line, LineNo))
- #
- # Call Header comment parser.
- #
- self.InfHeaderParser(SectionLines, self.InfHeader, self.FileName)
- SectionLines = []
- continue
+ #
+ # Call Header comment parser.
+ #
+ self.InfHeaderParser(SectionLines, self.InfHeader, self.FileName)
+ SectionLines = []
+ continue
#
# check whether binary header comment section started
@@ -254,9 +254,9 @@ class InfParser(InfSectionParser):
BinaryHeaderStarLineNo = LineNo
SectionLines.append((Line, LineNo))
BinaryHeaderCommentStart = True
- HeaderCommentEnd = True
- continue
-
+ HeaderCommentEnd = True
+ continue
+
#
# check whether there are more than one binary header exist
#
@@ -302,12 +302,12 @@ class InfParser(InfSectionParser):
SectionLines.append((Line, LineNo))
if not LastSectionFalg:
continue
-
+
#
# Encountered a section. start with '[' and end with ']'
#
if (Line.startswith(DT.TAB_SECTION_START) and \
- Line.find(DT.TAB_SECTION_END) > -1) or LastSectionFalg:
+ Line.find(DT.TAB_SECTION_END) > -1) or LastSectionFalg:
HeaderCommentEnd = True
BinaryHeaderCommentEnd = True
@@ -324,13 +324,13 @@ class InfParser(InfSectionParser):
File=self.FullPath,
Line=LineNo,
ExtraData=Line)
-
+
#
# Keep last time section header content for section parser
# usage.
#
self.LastSectionHeaderContent = deepcopy(self.SectionHeaderContent)
-
+
#
# TailComments in section define.
#
@@ -357,11 +357,11 @@ class InfParser(InfSectionParser):
# Compare the new section name with current
#
self.SectionHeaderParser(Line, self.FileName, LineNo)
-
+
self._CheckSectionHeaders(Line, LineNo)
SectionType = _ConvertSecNameToType(self.SectionHeaderContent[0][0])
-
+
if not FirstSectionStartFlag:
CurrentSection = SectionType
FirstSectionStartFlag = True
@@ -370,10 +370,10 @@ class InfParser(InfSectionParser):
else:
SectionLines.append((Line, LineNo))
continue
-
+
if LastSectionFalg:
SectionLines, CurrentSection = self._ProcessLastSection(SectionLines, Line, LineNo, CurrentSection)
-
+
#
# End of section content collect.
# Parser the section content collected previously.
@@ -393,9 +393,9 @@ class InfParser(InfSectionParser):
if HeaderStarLineNo == -1:
Logger.Error("InfParser",
- FORMAT_INVALID,
- ST.ERR_NO_SOURCE_HEADER,
- File=self.FullPath)
+ FORMAT_INVALID,
+ ST.ERR_NO_SOURCE_HEADER,
+ File=self.FullPath)
if BinaryHeaderStarLineNo > -1 and HeaderStarLineNo > -1 and HeaderStarLineNo > BinaryHeaderStarLineNo:
Logger.Error("InfParser",
FORMAT_INVALID,