]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/Ecc: Fix a bug when checking copyright format
authorHess Chen <hesheng.chen@intel.com>
Thu, 2 Jul 2015 06:05:26 +0000 (06:05 +0000)
committerhchen30 <hchen30@Edk2>
Thu, 2 Jul 2015 06:05:26 +0000 (06:05 +0000)
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 <hesheng.chen@intel.com>
Reviewed-by: YangX Li <yangx.li@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17801 6f19259b-4bc3-4df7-8a09-765794883524

BaseTools/Source/Python/Ecc/Configuration.py
BaseTools/Source/Python/Ecc/c.py

index da53f5f6f8ca88573d384477db28d17881ca0faa..5262b685a52e5f48ec5ebe8df5f2d14361089d3e 100644 (file)
@@ -274,6 +274,9 @@ class Configuration(object):
         \r
         # A list for only scanned folders\r
         self.ScanOnlyDirList = []\r
+        \r
+        # A list for Copyright format\r
+        self.Copyright = []\r
 \r
         self.ParseConfig()\r
 \r
@@ -302,6 +305,8 @@ class Configuration(object):
                     List[1] = GetSplitValueList(List[1], TAB_COMMA_SPLIT)\r
                 if List[0] == 'BinaryExtList':\r
                     List[1] = GetSplitValueList(List[1], TAB_COMMA_SPLIT)\r
+                if List[0] == 'Copyright':\r
+                    List[1] = GetSplitValueList(List[1], TAB_COMMA_SPLIT)\r
                 self.__dict__[List[0]] = List[1]\r
 \r
     def ShowMe(self):\r
index 1e89f117285ca506e510354f81e9f59418699f26..a7eefa1e07a446503b6af14f203095ec74934cf8 100644 (file)
@@ -2364,7 +2364,10 @@ def CheckFileHeaderDoxygenComments(FullFileName):
             if CommentLine.startswith('Copyright'):\r
                 NoCopyrightFlag = False\r
                 if CommentLine.find('All rights reserved') == -1:\r
-                    PrintErrorMsg(ERROR_HEADER_CHECK_FILE, '""All rights reserved"" announcement should be following the ""Copyright"" at the same line', FileTable, ID)\r
+                    for Copyright in EccGlobalData.gConfig.Copyright:\r
+                        if CommentLine.find(Copyright) > -1:\r
+                            PrintErrorMsg(ERROR_HEADER_CHECK_FILE, '""All rights reserved"" announcement should be following the ""Copyright"" at the same line', FileTable, ID)\r
+                            break\r
                 if CommentLine.endswith('<BR>') == -1:\r
                     PrintErrorMsg(ERROR_HEADER_CHECK_FILE, 'The ""<BR>"" at the end of the Copyright line is required', FileTable, ID)\r
                 if NextLineIndex < len(CommentStrList) and CommentStrList[NextLineIndex].strip().startswith('Copyright') == False and CommentStrList[NextLineIndex].strip():\r