update_copyright: don't hardcode 1999 start year
authorZac Medico <zmedico@gentoo.org>
Thu, 20 Oct 2011 21:26:26 +0000 (14:26 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 20 Oct 2011 21:26:26 +0000 (14:26 -0700)
We want repoman to be applicable to as many repositories as possible.
If necessary, we can add another layout.conf attribute that configures
the copyright start years for all files.

pym/repoman/utilities.py

index a3fdf12e014c7d6d36f6123cbc4180737227226c..7f7d62acfc13678f835e26c3242ccc833e2eb502 100644 (file)
@@ -548,12 +548,13 @@ def update_copyright(fn_path, year, pretend):
                        new_header.append(line)
                        break
 
-               # these two regexes are taken from
-               # echangelog update_copyright()
+               # These two regexes are taken from echangelog
+               # update_copyright(), except that we don't hardcode
+               # 1999 here (in order to be more generic).
                line = re.sub(r'^(# Copyright \d+) ',
                        r'\1-%s ' % year, line)
-               line = re.sub(r'^(# Copyright) \d\d\d\d-\d\d\d\d',
-                       r'\1 1999-%s' % year, line)
+               line = re.sub(r'^(# Copyright \d\d\d\d)-\d\d\d\d',
+                       r'\1-%s' % year, line)
                new_header.append(line)
 
        difflines = 0