Merge "Update Invoke Tasks and use Twine for upload"
[releng-anteater.git] / anteater / src / patch_scan.py
index fffb246..1deb68f 100644 (file)
@@ -18,7 +18,7 @@
 
 from __future__ import division, print_function, absolute_import
 from binaryornot.check import is_binary
-import anteater.utils.anteater_logger as antlog
+import logging
 import hashlib
 import six.moves.configparser
 import sys
@@ -26,7 +26,7 @@ import re
 
 from . import get_lists
 
-logger = antlog.Logger(__name__).getLogger()
+logger = logging.getLogger(__name__)
 config = six.moves.configparser.RawConfigParser()
 config.read('anteater.conf')
 reports_dir = config.get('config', 'reports_dir')
@@ -147,9 +147,9 @@ def licence_check(project, licence_ext,
         # Note: Hardcoded use of 'copyright' & 'spdx' is the result
         # of a decision made at 2017 plugfest to limit searches to
         # just these two strings.
-        if re.search("copyright", content, re.IGNORECASE):
-            logger.info('Contains needed Licence string: %s', patch_file)
-        elif re.search("spdx", content, re.IGNORECASE):
+        patterns = ['copyright', 'spdx',
+                    'http://creativecommons.org/licenses/by/4.0']
+        if any(i in content.lower() for i in patterns):
             logger.info('Contains needed Licence string: %s', patch_file)
         else:
             logger.error('Licence header missing in file: %s', patch_file)