Revision: 17801
          http://sourceforge.net/p/edk2/code/17801
Author:   hchen30
Date:     2015-07-02 06:05:26 +0000 (Thu, 02 Jul 2015)
Log Message:
-----------
BaseTools/Ecc: Fix a bug when checking copyright format

Fix a bug to only checking the copyright listed in config.ini file.

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

Modified Paths:
--------------
    trunk/edk2/BaseTools/Source/Python/Ecc/Configuration.py
    trunk/edk2/BaseTools/Source/Python/Ecc/c.py

Modified: trunk/edk2/BaseTools/Source/Python/Ecc/Configuration.py
===================================================================
--- trunk/edk2/BaseTools/Source/Python/Ecc/Configuration.py     2015-07-02 
06:02:42 UTC (rev 17800)
+++ trunk/edk2/BaseTools/Source/Python/Ecc/Configuration.py     2015-07-02 
06:05:26 UTC (rev 17801)
@@ -274,6 +274,9 @@
         
         # A list for only scanned folders
         self.ScanOnlyDirList = []
+        
+        # A list for Copyright format
+        self.Copyright = []
 
         self.ParseConfig()
 
@@ -302,6 +305,8 @@
                     List[1] = GetSplitValueList(List[1], TAB_COMMA_SPLIT)
                 if List[0] == 'BinaryExtList':
                     List[1] = GetSplitValueList(List[1], TAB_COMMA_SPLIT)
+                if List[0] == 'Copyright':
+                    List[1] = GetSplitValueList(List[1], TAB_COMMA_SPLIT)
                 self.__dict__[List[0]] = List[1]
 
     def ShowMe(self):

Modified: trunk/edk2/BaseTools/Source/Python/Ecc/c.py
===================================================================
--- trunk/edk2/BaseTools/Source/Python/Ecc/c.py 2015-07-02 06:02:42 UTC (rev 
17800)
+++ trunk/edk2/BaseTools/Source/Python/Ecc/c.py 2015-07-02 06:05:26 UTC (rev 
17801)
@@ -2364,7 +2364,10 @@
             if CommentLine.startswith('Copyright'):
                 NoCopyrightFlag = False
                 if CommentLine.find('All rights reserved') == -1:
-                    PrintErrorMsg(ERROR_HEADER_CHECK_FILE, '""All rights 
reserved"" announcement should be following the ""Copyright"" at the same 
line', FileTable, ID)
+                    for Copyright in EccGlobalData.gConfig.Copyright:
+                        if CommentLine.find(Copyright) > -1:
+                            PrintErrorMsg(ERROR_HEADER_CHECK_FILE, '""All 
rights reserved"" announcement should be following the ""Copyright"" at the 
same line', FileTable, ID)
+                            break
                 if CommentLine.endswith('<BR>') == -1:
                     PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'The ""<BR>"" at 
the end of the Copyright line is required', FileTable, ID)
                 if NextLineIndex < len(CommentStrList) and 
CommentStrList[NextLineIndex].strip().startswith('Copyright') == False and 
CommentStrList[NextLineIndex].strip():


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to