Skip to content

Commit 069a588

Browse files
committed
Preserve proper a year range in copyright statements.
Files that were created in the past year will have the new year appended to the first year number. Ex: `2017` will be updated to `2017-2018`
1 parent 95fa23b commit 069a588

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

VersionManager.py

100755100644
Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"Makefile.am",
9797
"install.sh",
9898
"debian/copyright",
99-
"debian/copyright",
99+
"debian/manpage.xml",
100100
"doc/Command_Index_User.tex",
101101
"doc/Makefile.am",
102102
"doc/GregorioRef.tex",
@@ -327,7 +327,7 @@ def replace_version(version_obj):
327327
result.append(newline)
328328
else:
329329
result.append(line)
330-
with open('CHANGELOG.md','w') as outfile:
330+
with open('CHANGELOG.md', 'w') as outfile:
331331
outfile.write(''.join(result))
332332
sys.exit(0)
333333

@@ -428,20 +428,26 @@ def do_release(version_obj, not_interactive):
428428
def copyright_year():
429429
"Check and update copyright year as needed"
430430
fileyear = linecache.getline(VERSION_FILE, 2).strip()
431+
def year_range(matchobj):
432+
"Check and add a year range to the copyright"
433+
if matchobj.group(1) is not None:
434+
return re.sub(fileyear, CURRENTYEAR, matchobj.group(0))
435+
return re.sub(fileyear, fileyear+'-'+CURRENTYEAR, matchobj.group(0))
436+
431437
if int(fileyear) != int(CURRENTYEAR):
432438
print('Updating copyright year.')
433439
for myfile in COPYRIGHT_FILES:
434440
result = []
435441
with open(myfile, 'r') as infile:
436442
for line in infile:
437443
if re.search(r'[C|c]opyright.*Gregorio Project', line):
438-
result.append(re.sub(fileyear, CURRENTYEAR, line))
444+
result.append(re.sub(r'(\d{4}-)?(\d{4})', year_range, line))
439445
elif re.search(r'[C|c]opyright.*Elie Roux', line):
440-
result.append(re.sub(fileyear, CURRENTYEAR, line))
446+
result.append(re.sub(r'(\d{4}-)?(\d{4})', year_range, line))
441447
elif re.search(r'[C|c]opyright.*Richard Chonak', line):
442-
result.append(re.sub(fileyear, CURRENTYEAR, line))
448+
result.append(re.sub(r'(\d{4}-)?(\d{4})', year_range, line))
443449
elif re.search(r'[C|c]opyright.*Jakub Jelinek', line):
444-
result.append(re.sub(fileyear, CURRENTYEAR, line))
450+
result.append(re.sub(r'(\d{4}-)?(\d{4})', year_range, line))
445451
else:
446452
result.append(line)
447453
with open(myfile, 'w') as outfile:

debian/manpage.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ and docbook-xsl in your Build-Depends control field.
5353
&dhsurname;
5454
</author>
5555
<copyright>
56-
<year>2007</year>
56+
<year>2007-2018</year> <!--Copyright Elie Roux-->
5757
<holder>&dhusername;</holder>
5858
</copyright>
5959
&dhdate;

fonts/greextra.sfd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FontName: greextra
33
FullName: greextra
44
FamilyName: greextra
55
Weight: Extra-Light
6-
Copyright: greciliae font, adapted with fontforge by Elie Roux\nCopyright (C) 2007 Matthew Spencer\nwith Reserved Font Name Caeciliae\n\nThis Font Software is licensed under the SIL Open Font License, Version 1.1.\n\nThis license is available with a FAQ at: http://scripts.sil.org/OFL
6+
Copyright: greextra font, adapted with fontforge by Elie Roux\nCopyright (C) 2007-2018 Matthew Spencer\nwith Reserved Font Name Caeciliae\n\nThis Font Software is licensed under the SIL Open Font License, Version 1.1.\n\nThis license is available with a FAQ at: http://scripts.sil.org/OFL
77
Version: 1.0
88
ItalicAngle: 0
99
UnderlinePosition: -204

0 commit comments

Comments
 (0)