commit: 31465138ddc319a98eae71f95b9fb3a07b866f62 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> AuthorDate: Tue Jun 18 11:48:33 2019 +0000 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> CommitDate: Tue Jun 18 18:41:31 2019 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=31465138
repoman: Allow legacy "Gentoo Foundation" copyright before 2019. Bug: https://bugs.gentoo.org/688278 Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org> Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> repoman/lib/repoman/modules/linechecks/gentoo_header/header.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/repoman/lib/repoman/modules/linechecks/gentoo_header/header.py b/repoman/lib/repoman/modules/linechecks/gentoo_header/header.py index f94a8a50b..1f035a97e 100644 --- a/repoman/lib/repoman/modules/linechecks/gentoo_header/header.py +++ b/repoman/lib/repoman/modules/linechecks/gentoo_header/header.py @@ -17,7 +17,8 @@ class EbuildHeader(LineCheck): repoman_check_name = 'ebuild.badheader' - gentoo_copyright = r'^# Copyright ((1999|2\d\d\d)-)?%s Gentoo Authors$' + gentoo_copyright = ( + r'^# Copyright ((1999|2\d\d\d)-)?(?P<year2>%s) (?P<author>.*)$') gentoo_license = ( '# Distributed under the terms' ' of the GNU General Public License v2') @@ -37,7 +38,12 @@ class EbuildHeader(LineCheck): if num > 2: return elif num == 0: - if not self.gentoo_copyright_re.match(line): + match = self.gentoo_copyright_re.match(line) + if match is None: + return self.errors['COPYRIGHT_ERROR'] + if not (match.group('author') == 'Gentoo Authors' or + (int(match.group('year2')) < 2019 and + match.group('author') == 'Gentoo Foundation')): return self.errors['COPYRIGHT_ERROR'] elif num == 1 and line.rstrip('\n') != self.gentoo_license: return self.errors['LICENSE_ERROR']
