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
\r
# A list for only scanned folders\r
self.ScanOnlyDirList = []\r
\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
\r
self.ParseConfig()\r
\r
List[1] = GetSplitValueList(List[1], TAB_COMMA_SPLIT)\r
if List[0] == 'BinaryExtList':\r
List[1] = GetSplitValueList(List[1], TAB_COMMA_SPLIT)\r
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
self.__dict__[List[0]] = List[1]\r
\r
def ShowMe(self):\r
if CommentLine.startswith('Copyright'):\r
NoCopyrightFlag = False\r
if CommentLine.find('All rights reserved') == -1:\r
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
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