diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2017-12-20 14:38:14 +0000 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2017-12-20 14:38:14 +0000 |
commit | c60164953dd6a4ee485c42211a3bcf8ee9eba06f (patch) | |
tree | a66408a1ad9423512c4fe53cf89dbacf502592dd /scripts | |
parent | 16905976c82c57fdc98a8988392354597f166a12 (diff) | |
download | YAGE-c60164953dd6a4ee485c42211a3bcf8ee9eba06f.tar.gz YAGE-c60164953dd6a4ee485c42211a3bcf8ee9eba06f.zip |
Fixed license headers
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/add_version_headers | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/scripts/add_version_headers b/scripts/add_version_headers index c3b26566..cf1531b0 100755 --- a/scripts/add_version_headers +++ b/scripts/add_version_headers @@ -40,7 +40,7 @@ header = """/** ---------------------------------------------------------------\ lic_regex = re.compile( - "\/(?:\*|\*\*) -+\n \* ((?:@file: )?[a-z]+\.(?:cpp|h)|\{0\})\n(?: \*[ a-zA-Z0-9_.,\-()<>@]*\n)+ \* -+\n \*/", re.MULTILINE) + "\/(?:\*|\*\*) -+\n \* ((?:@file: )?[a-z0-9]+\.(?:cpp|h)|\{0\})\n(?: \*[ a-zA-Z0-9_.,\-()<>@]*\n)+ \* -+\n \*/\n\n", re.MULTILINE) class HeaderUpdate(object): @@ -77,11 +77,13 @@ class HeaderUpdate(object): src = f.read() f.seek(0) if lic_regex.match(src): - print("Updating {}: ".format( - os.path.basename(filePath)), end="") - src = lic_regex.sub(header.format( + other_src = lic_regex.sub(header.format( os.path.basename(filePath)), src) - print("done") + if other_src != src: + print("Updating {}: ".format( + os.path.basename(filePath)), end="") + src = other_src + print("done") else: print("Adding {}: ".format( os.path.basename(filePath)), end="") |