]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/UPT/Parser/InfSectionParser.py
BaseTools/UPT: Update the import statement to use StringUtils
[mirror_edk2.git] / BaseTools / Source / Python / UPT / Parser / InfSectionParser.py
index 879f924c45760073fd9f586ff7fee056becc5a8b..8ba4c3fc0819265a5d11b4abc395322a5ef3051d 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file contained the parser for sections in INF file \r
 #\r
-# Copyright (c) 2011, 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
@@ -21,7 +21,7 @@ InfSectionParser
 from copy import deepcopy\r
 import re\r
 \r
-from Library.String import GetSplitValueList\r
+from Library.StringUtils import GetSplitValueList\r
 from Library.CommentParsing import ParseHeaderCommentSection\r
 from Library.CommentParsing import ParseComment\r
 \r
@@ -239,6 +239,7 @@ class InfSectionParser(InfDefinSectionParser,
         self.InfSmmDepexSection = InfDepexObject()\r
         self.InfBinariesSection = InfBinariesObject()\r
         self.InfHeader = InfHeaderObject()\r
+        self.InfBinaryHeader = InfHeaderObject()\r
         self.InfSpecialCommentSection = InfSpecialCommentObject()\r
 \r
         #\r
@@ -253,8 +254,16 @@ class InfSectionParser(InfDefinSectionParser,
     #\r
     # File Header content parser\r
     #    \r
-    def InfHeaderParser(self, Content, InfHeaderObject2, FileName):\r
-        (Abstract, Description, Copyright, License) = ParseHeaderCommentSection(Content, FileName)\r
+    def InfHeaderParser(self, Content, InfHeaderObject2, FileName, IsBinaryHeader = False):\r
+        if IsBinaryHeader:\r
+            (Abstract, Description, Copyright, License) = ParseHeaderCommentSection(Content, FileName, True)\r
+            if not Abstract or not Description or not Copyright or not License:\r
+                Logger.Error('Parser',\r
+                             FORMAT_INVALID,\r
+                             ST.ERR_INVALID_BINARYHEADER_FORMAT,\r
+                             File=FileName)\r
+        else:\r
+            (Abstract, Description, Copyright, License) = ParseHeaderCommentSection(Content, FileName)\r
         #\r
         # Not process file name now, for later usage.\r
         #\r