aboutsummaryrefslogtreecommitdiffstats
path: root/anteater/src
diff options
context:
space:
mode:
authorlhinds <lhinds@redhat.com>2017-07-11 17:36:38 +0100
committerlhinds <lhinds@redhat.com>2017-07-11 17:36:38 +0100
commit41fdcb2323d3b75391e5bdd74497403f58e1a36d (patch)
tree6b36ed4bd697868a4090d0fe2a4c86226a771bec /anteater/src
parent04f323060baa849bfc11a1b616ada91dd029cc17 (diff)
Fix for CCL 4.0 Licenses.
A follow up patch should move the patterns list into yaml Change-Id: Id814d6fc09631d5037f6825f32daca8d74edc118 Signed-off-by: lhinds <lhinds@redhat.com>
Diffstat (limited to 'anteater/src')
-rw-r--r--anteater/src/patch_scan.py6
-rw-r--r--anteater/src/project_scan.py6
2 files changed, 6 insertions, 6 deletions
diff --git a/anteater/src/patch_scan.py b/anteater/src/patch_scan.py
index 0a32f3e..1deb68f 100644
--- a/anteater/src/patch_scan.py
+++ b/anteater/src/patch_scan.py
@@ -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)
diff --git a/anteater/src/project_scan.py b/anteater/src/project_scan.py
index f33ccca..5ac8b10 100644
--- a/anteater/src/project_scan.py
+++ b/anteater/src/project_scan.py
@@ -159,9 +159,9 @@ def licence_check(licence_ext, licence_ignore, project, project_dir):
# 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('Licence string present: %s', full_path)
- 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('Licence string present: %s', full_path)
else:
logger.error('Licence header missing: %s', full_path)