Revision: 16153
          http://sourceforge.net/p/edk2/code/16153
Author:   hchen30
Date:     2014-09-22 07:06:12 +0000 (Mon, 22 Sep 2014)
Log Message:
-----------
BaseTools/Upt: Fix several bugs

1. Fix a bug of generating additional EOL in file header.
2. Fix a bug of format error for Defines section.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <[email protected]>
Reviewed-by: Yingke Liu <[email protected]>

Modified Paths:
--------------
    trunk/edk2/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py
    trunk/edk2/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py

Modified: trunk/edk2/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py
===================================================================
--- trunk/edk2/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py    
2014-09-22 05:54:41 UTC (rev 16152)
+++ trunk/edk2/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py    
2014-09-22 07:06:12 UTC (rev 16153)
@@ -344,7 +344,7 @@
     Content += GenHeaderCommentSection(PackageAbstract, \
                                        PackageDescription, \
                                        PackageCopyright, \
-                                       PackageLicense)
+                                       PackageLicense).replace('\r\n', '\n')
 
     #
     # Generate Binary header 

Modified: trunk/edk2/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py
===================================================================
--- trunk/edk2/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py    
2014-09-22 05:54:41 UTC (rev 16152)
+++ trunk/edk2/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py    
2014-09-22 07:06:12 UTC (rev 16153)
@@ -110,7 +110,7 @@
     Content += GenHeaderCommentSection(ModuleAbstract,
                                        ModuleDescription,
                                        ModuleCopyright,
-                                       ModuleLicense)
+                                       ModuleLicense).replace('\r\n', '\n')
 
     #
     # Generate Binary Header 
@@ -261,13 +261,18 @@
     #
     # generate [Defines] section
     #
+    LeftOffset = 31
     Content = ''
     NewSectionDict = {}
+
     for UserExtension in ModuleObject.GetUserExtensionList():
         DefinesDict = UserExtension.GetDefinesDict()
         if not DefinesDict:
             continue
         for Statement in DefinesDict:
+            if Statement.split(DT.TAB_EQUAL_SPLIT) > 1:
+                Statement = (u'%s ' % Statement.split(DT.TAB_EQUAL_SPLIT, 
1)[0]).ljust(LeftOffset) \
+                             + u'= %s' % Statement.split(DT.TAB_EQUAL_SPLIT, 
1)[1].lstrip()
             SortedArch = DT.TAB_ARCH_COMMON
             if 
Statement.strip().startswith(DT.TAB_INF_DEFINES_CUSTOM_MAKEFILE):
                 pos = Statement.find(DT.TAB_VALUE_SPLIT)
@@ -280,11 +285,7 @@
             else:
                 NewSectionDict[SortedArch] = [Statement]
     SpecialStatementList = []
-    #
-    # Add INF_VERSION statement firstly
-    #
-    
-    LeftOffset = 31
+
     # TAB_INF_DEFINES_INF_VERSION
     Statement = (u'%s ' % DT.TAB_INF_DEFINES_INF_VERSION).ljust(LeftOffset) + 
u'= %s' % '0x00010017'
     SpecialStatementList.append(Statement)


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to