add license checking include directive only in GPL files

This commit is contained in:
Sébastien Loriot
2017-11-12 10:21:35 +01:00
parent 5a356fb40a
commit 49c1357aff
@@ -17,6 +17,12 @@ def add_license_include_in_file(package_name, fname):
if any(re.search("#include\s*<CGAL/license/", line) for line in f):
return # include directive already there
#match only file under a GPL license
with codecs.open(fname, encoding='utf-8') as f:
if not any(re.search("SPDX-License-Identifier:.*[ (]GPL", line) for line in f):
return # include directive already there
# include directive not already there
inserted = False
with codecs.open(fname, encoding='utf-8') as f: