summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-10-20 14:26:26 -0700
committerZac Medico <zmedico@gentoo.org>2011-10-20 14:26:26 -0700
commit8dfd8582e31a17c3adda9cba0f41545620289e5a (patch)
tree86ab55aa398928db26c0dbb647804472b4ef6578
parent0a1cbfd526662b0d60ed8dd89127d1b869e3ec6a (diff)
downloadportage-8dfd8582e31a17c3adda9cba0f41545620289e5a.tar.gz
portage-8dfd8582e31a17c3adda9cba0f41545620289e5a.tar.bz2
portage-8dfd8582e31a17c3adda9cba0f41545620289e5a.zip
update_copyright: don't hardcode 1999 start year
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.
-rw-r--r--pym/repoman/utilities.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
index a3fdf12e0..7f7d62acf 100644
--- a/pym/repoman/utilities.py
+++ b/pym/repoman/utilities.py
@@ -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