summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2018-09-18 11:07:55 +0200
committerMichał Górny <mgorny@gentoo.org>2018-09-19 19:18:45 +0200
commit9f089d270503d18ee8800fe97f26c6644f20cac9 (patch)
treef151226a183ae12cc000949c932d1cd57a534d4f
parentrepoman: Allow copyright updates for 'Gentoo Authors' (diff)
downloadportage-9f089d270503d18ee8800fe97f26c6644f20cac9.tar.gz
portage-9f089d270503d18ee8800fe97f26c6644f20cac9.tar.bz2
portage-9f089d270503d18ee8800fe97f26c6644f20cac9.zip
repoman: Automatically convert copyright to 'Gentoo Authors'
Automatically convert 'Gentoo Foundation' copyright to 'Gentoo Authors' when updating the copyright date. Signed-off-by: Michał Górny <mgorny@gentoo.org> Reviewed-by: Zac Medico <zmedico@gentoo.org>
-rw-r--r--repoman/lib/repoman/copyrights.py4
-rw-r--r--repoman/lib/repoman/tests/changelog/test_echangelog.py2
-rw-r--r--repoman/lib/repoman/tests/simple/test_simple.py4
3 files changed, 5 insertions, 5 deletions
diff --git a/repoman/lib/repoman/copyrights.py b/repoman/lib/repoman/copyrights.py
index 25627b3fc..1eaaab660 100644
--- a/repoman/lib/repoman/copyrights.py
+++ b/repoman/lib/repoman/copyrights.py
@@ -31,7 +31,7 @@ class _copyright_repl(object):
return matchobj.group(0)
else:
return matchobj.group(1) + matchobj.group(2) + \
- b'-' + self.year + matchobj.group(3)
+ b'-' + self.year + b' Gentoo Authors'
def update_copyright_year(year, line):
@@ -51,7 +51,7 @@ def update_copyright_year(year, line):
year = _unicode_encode(year)
line = _unicode_encode(line)
- line = _copyright_re1.sub(br'\1-' + year + br'\2', line)
+ line = _copyright_re1.sub(br'\1-' + year + b' Gentoo Authors', line)
line = _copyright_re2.sub(_copyright_repl(year), line)
if not is_bytes:
line = _unicode_decode(line)
diff --git a/repoman/lib/repoman/tests/changelog/test_echangelog.py b/repoman/lib/repoman/tests/changelog/test_echangelog.py
index 1640be268..e5e34f16c 100644
--- a/repoman/lib/repoman/tests/changelog/test_echangelog.py
+++ b/repoman/lib/repoman/tests/changelog/test_echangelog.py
@@ -30,7 +30,7 @@ class RepomanEchangelogTestCase(TestCase):
os.makedirs(self.pkgdir)
self.header_pkg = '# ChangeLog for %s/%s\n' % (self.cat, self.pkg)
- self.header_copyright = '# Copyright 1999-%s Gentoo Foundation; Distributed under the GPL v2\n' % \
+ self.header_copyright = '# Copyright 1999-%s Gentoo Authors; Distributed under the GPL v2\n' % \
time.strftime('%Y', time.gmtime())
self.header_cvs = '# $Header: $\n'
diff --git a/repoman/lib/repoman/tests/simple/test_simple.py b/repoman/lib/repoman/tests/simple/test_simple.py
index 351dde2c7..b0cc43297 100644
--- a/repoman/lib/repoman/tests/simple/test_simple.py
+++ b/repoman/lib/repoman/tests/simple/test_simple.py
@@ -23,12 +23,12 @@ class SimpleRepomanTestCase(TestCase):
(
'2011',
'# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2',
- '# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2',
+ '# Copyright 1999-2011 Gentoo Authors; Distributed under the GPL v2',
),
(
'2011',
'# Copyright 1999 Gentoo Foundation; Distributed under the GPL v2',
- '# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2',
+ '# Copyright 1999-2011 Gentoo Authors; Distributed under the GPL v2',
),
(
'1999',