## @file\r
# This file is used to provide method for process AsBuilt INF file. It will consumed by InfParser\r
#\r
-# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>\r
#\r
-# This program and the accompanying materials are licensed and made available \r
-# under the terms and conditions of the BSD License which accompanies this \r
-# distribution. The full text of the license may be found at \r
-# http://opensource.org/licenses/bsd-license.php\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+# SPDX-License-Identifier: BSD-2-Clause-Patent\r
'''\r
InfAsBuiltProcess\r
'''\r
from Logger import StringTable as ST\r
from Logger import ToolError\r
\r
-from Library.String import GetSplitValueList\r
+from Library.StringUtils import GetSplitValueList\r
from Library.Misc import GetHelpStringByRemoveHashKey\r
from Library.Misc import ValidFile\r
from Library.Misc import ProcessLineExtender\r
FileGuidString = ""\r
VerString = ""\r
\r
- OrignalString = String\r
+ OriginalString = String\r
String = String.strip()\r
if not String:\r
return None, None\r
#\r
# To deal with library instance specified by file name\r
#\r
- FileLinesList = GetFileLineContent(String, WorkSpace, LineNo, OrignalString)\r
+ FileLinesList = GetFileLineContent(String, WorkSpace, LineNo, OriginalString)\r
\r
\r
ReFindFileGuidPattern = re.compile("^\s*FILE_GUID\s*=.*$")\r
continue\r
\r
#\r
- # Found [Packages] section \r
+ # Found [Packages] section\r
#\r
if RePackageHeader.match(Line):\r
PackageHederFlag = True\r
\r
#\r
# Replace with Local section Macro and [Defines] section Macro.\r
- # \r
+ #\r
Line = InfExpandMacro(Line, (FileNameString, Line, LineNo), DefineSectionMacros, PackageSectionMacros, True)\r
\r
Line = GetSplitValueList(Line, "#", 1)[0]\r
\r
try:\r
FullFileName = FullFileName.replace('\\', '/')\r
- Inputfile = open(FullFileName, "rb", 0)\r
+ Inputfile = open(FullFileName, "r")\r
try:\r
FileLinesList = Inputfile.readlines()\r
except BaseException:\r
continue\r
InfFile = InfFile.replace('\\', '/')\r
if InfFile not in GlobalData.gLIBINSTANCEDICT:\r
- InfFileObj = open(InfFile, "rb", 0)\r
+ InfFileObj = open(InfFile, "r")\r
GlobalData.gLIBINSTANCEDICT[InfFile] = InfFileObj\r
else:\r
InfFileObj = GlobalData.gLIBINSTANCEDICT[InfFile]\r