]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/build/BuildReport.py
ShellPkg: Fix EFI_SHELL_DYNAMIC_COMMAND_PROTOCOL_GUID to match UEFI Shell 2.1 spec
[mirror_edk2.git] / BaseTools / Source / Python / build / BuildReport.py
index d5ea3bd3e5fa077dc9c2e7eb7e98b480f43dfbcf..945ee1b573e406ad9960946d7e331ed3ac836546 100644 (file)
@@ -4,7 +4,7 @@
 # This module contains the functionality to generate build report after\r
 # build all target completes successfully.\r
 #\r
-# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
@@ -72,6 +72,9 @@ gGlueLibEntryPoint = re.compile(r"__EDKII_GLUE_MODULE_ENTRY_POINT__\s*=\s*(\w+)"
 ## Tags for MaxLength of line in report\r
 gLineMaxLength = 120\r
 \r
+## Tags for end of line in report\r
+gEndOfLine = "\r\n"\r
+\r
 ## Tags for section start, end and separator\r
 gSectionStart = ">" + "=" * (gLineMaxLength-2) + "<"\r
 gSectionEnd = "<" + "=" * (gLineMaxLength-2) + ">" + "\n"\r
@@ -91,9 +94,9 @@ gPcdTypeMap = {
   'Dynamic'          : ('DYN',    'Dynamic'),\r
   'DynamicHii'       : ('DYNHII', 'Dynamic'),\r
   'DynamicVpd'       : ('DYNVPD', 'Dynamic'),\r
-  'DynamicEx'        : ('DEX',    'Dynamic'),\r
-  'DynamicExHii'     : ('DEXHII', 'Dynamic'),\r
-  'DynamicExVpd'     : ('DEXVPD', 'Dynamic'),\r
+  'DynamicEx'        : ('DEX',    'DynamicEx'),\r
+  'DynamicExHii'     : ('DEXHII', 'DynamicEx'),\r
+  'DynamicExVpd'     : ('DEXVPD', 'DynamicEx'),\r
   }\r
 \r
 ## The look up table to map module type to driver type\r
@@ -128,7 +131,7 @@ gOpCodeList = ["BEFORE", "AFTER", "PUSH", "AND", "OR", "NOT", "TRUE", "FALSE", "
 def FileWrite(File, String, Wrapper=False):\r
     if Wrapper:\r
         String = textwrap.fill(String, 120)\r
-    File.write(String + "\r\n")\r
+    File.write(String + gEndOfLine)\r
 \r
 ##\r
 # Find all the header file that the module source directly includes.\r
@@ -203,6 +206,8 @@ def FileLinesSplit(Content=None, MaxLength=None):
             NewContentList.append(Line)\r
     for NewLine in NewContentList:\r
         NewContent += NewLine + TAB_LINE_BREAK\r
+    \r
+    NewContent = NewContent.replace(TAB_LINE_BREAK, gEndOfLine).replace('\r\r\n', gEndOfLine)\r
     return NewContent\r
     \r
     \r
@@ -254,7 +259,7 @@ class DepexParser(object):
             Statement = gOpCodeList[struct.unpack("B", OpCode)[0]]\r
             if Statement in ["BEFORE", "AFTER", "PUSH"]:\r
                 GuidValue = "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X" % \\r
-                            struct.unpack("LHHBBBBBBBB", DepexFile.read(16))\r
+                            struct.unpack("=LHHBBBBBBBB", DepexFile.read(16))\r
                 GuidString = self._GuidDb.get(GuidValue, GuidValue)\r
                 Statement = "%s %s" % (Statement, GuidString)\r
             DepexStatement.append(Statement)\r
@@ -694,7 +699,8 @@ class PcdReport(object):
         # Collect PCDs defined in DSC common section\r
         #\r
         self.DscPcdDefault = {}\r
-        for Platform in Wa.BuildDatabase.WorkspaceDb.PlatformList:\r
+        for Arch in Wa.ArchList:\r
+            Platform = Wa.BuildDatabase[Wa.MetaFile, Arch, Wa.BuildTarget, Wa.ToolChain]\r
             for (TokenCName, TokenSpaceGuidCName) in Platform.Pcds:\r
                 DscDefaultValue = Platform.Pcds[(TokenCName, TokenSpaceGuidCName)].DefaultValue\r
                 if DscDefaultValue:\r