]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/UPT/Xml/XmlParser.py
This patch is going to:
[mirror_edk2.git] / BaseTools / Source / Python / UPT / Xml / XmlParser.py
index 5a2f0dc70571603a22f019ab975bd08e8c5c3030..58959081d0ab2cadd38eb081cde102ecba0efdd1 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to parse a xml file of .PKG file\r
 #\r
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2011 - 2014, 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
@@ -38,7 +38,6 @@ from Logger.StringTable import ERR_XML_INVALID_EXTERN_SUPARCHLIST
 from Logger.StringTable import ERR_XML_INVALID_EXTERN_SUPMODLIST\r
 from Logger.StringTable import ERR_XML_INVALID_EXTERN_SUPMODLIST_NOT_LIB\r
 from Logger.StringTable import ERR_FILE_NAME_INVALIDE\r
-from Logger.StringTable import ERR_XML_INVALID_BINARY_FILE_TYPE\r
 from Logger.ToolError import PARSER_ERROR\r
 from Logger.ToolError import FORMAT_INVALID\r
 \r
@@ -78,12 +77,25 @@ class DistributionPackageXml(object):
                 DpHeader = self.DistP.Header\r
                 XmlTreeLevel = ['DistributionPackage', 'DistributionHeader']\r
                 CheckDict = Sdict()\r
+                if DpHeader.GetAbstract():\r
+                    DPAbstract = DpHeader.GetAbstract()[0][1]\r
+                else:\r
+                    DPAbstract = ''\r
+                if DpHeader.GetCopyright():\r
+                    DPCopyright = DpHeader.GetCopyright()[0][1]\r
+                else:\r
+                    DPCopyright = ''\r
+                if DpHeader.GetLicense():\r
+                    DPLicense = DpHeader.GetLicense()[0][1]\r
+                else:\r
+                    DPLicense = ''\r
+                \r
                 CheckDict['Name'] = DpHeader.GetName()\r
                 CheckDict['GUID'] = DpHeader.GetGuid()\r
                 CheckDict['Version'] = DpHeader.GetVersion()\r
-                CheckDict['Copyright'] = DpHeader.GetCopyright()\r
-                CheckDict['License'] = DpHeader.GetLicense()\r
-                CheckDict['Abstract'] = DpHeader.GetAbstract()\r
+                CheckDict['Copyright'] = DPCopyright\r
+                CheckDict['License'] = DPLicense\r
+                CheckDict['Abstract'] = DPAbstract\r
                 CheckDict['Vendor'] = DpHeader.GetVendor()\r
                 CheckDict['Date'] = DpHeader.GetDate()\r
                 CheckDict['XmlSpecification'] = DpHeader.GetXmlSpecification()\r
@@ -610,11 +622,6 @@ def ValidateMS2(Module, TopXmlTreeLevel):
         if Item and len(Item.FileNamList) > 0 and Item.FileNamList[0].FileType == 'FREEFORM':\r
             Item.FileNamList[0].FileType = 'SUBTYPE_GUID'\r
             Module.GetBinaryFileList()[ItemCount] = Item\r
-        if Item and len(Item.FileNamList) > 0 and Item.FileNamList[0].FileType == 'DISPOSABLE':\r
-            Logger.Error('\nUPT',\r
-                 PARSER_ERROR,\r
-                 ERR_XML_INVALID_BINARY_FILE_TYPE % ('DISPOSABLE'),\r
-                 RaiseError=True)           \r
 \r
 ## ValidateMS3\r
 #\r
@@ -697,8 +704,7 @@ def ValidateMS3(Module, TopXmlTreeLevel):
             for PcdExItem in AsBuilt.PcdExValueList:\r
                 CheckDict = {'TokenSpaceGuidValue':PcdExItem.TokenSpaceGuidValue,\r
                              'Token':PcdExItem.Token,\r
-                             'DatumType':PcdExItem.DatumType,\r
-                             'Value':PcdExItem.DefaultValue}\r
+                             'DatumType':PcdExItem.DatumType}\r
                 XmlTreeLevel = TopXmlTreeLevel + ['BinaryFiles', 'BinaryFile', 'AsBuilt', 'PcdExValue']\r
                 IsRequiredItemListNull(CheckDict, XmlTreeLevel)\r
                 #\r