]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/UPT/Parser/InfAsBuiltProcess.py
BaseTools: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / BaseTools / Source / Python / UPT / Parser / InfAsBuiltProcess.py
index 4eed04c01765d85c1a240423141cec76d7de9788..992b609120f88baa647250c1df013679b61a3462 100644 (file)
@@ -1,15 +1,9 @@
 ## @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
@@ -23,7 +17,7 @@ import Logger.Log as Logger
 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
@@ -46,7 +40,7 @@ def GetLibInstanceInfo(String, WorkSpace, LineNo, CurrentInfFileName):
     FileGuidString = ""\r
     VerString = ""\r
 \r
-    OrignalString = String\r
+    OriginalString = String\r
     String = String.strip()\r
     if not String:\r
         return None, None\r
@@ -78,7 +72,7 @@ def GetLibInstanceInfo(String, WorkSpace, LineNo, CurrentInfFileName):
     #\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
@@ -133,7 +127,7 @@ def GetPackageListInfo(FileNameString, WorkSpace, LineNo):
             continue\r
 \r
         #\r
-        # Found [Packages] section \r
+        # Found [Packages] section\r
         #\r
         if RePackageHeader.match(Line):\r
             PackageHederFlag = True\r
@@ -174,7 +168,7 @@ def GetPackageListInfo(FileNameString, WorkSpace, LineNo):
 \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
@@ -205,7 +199,7 @@ def GetFileLineContent(FileName, WorkSpace, LineNo, OriginalString):
 \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
@@ -247,7 +241,7 @@ def GetGuidVerFormLibInstance(Guid, Version, WorkSpace, CurrentInfFileName):
                 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