From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4AA4F139694 for ; Wed, 1 Mar 2017 18:40:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9EDFC21C039; Wed, 1 Mar 2017 18:40:42 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7D59221C039 for ; Wed, 1 Mar 2017 18:40:42 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6FE7B3416D5 for ; Wed, 1 Mar 2017 18:40:41 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id BC40958EE for ; Wed, 1 Mar 2017 18:40:38 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1488393406.d38405be3e0d22ad106e2e1e1c26dda2e216c402.dolsen@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: repoman/pym/repoman/ X-VCS-Repository: proj/portage X-VCS-Files: repoman/pym/repoman/copyrights.py X-VCS-Directories: repoman/pym/repoman/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: d38405be3e0d22ad106e2e1e1c26dda2e216c402 X-VCS-Branch: master Date: Wed, 1 Mar 2017 18:40:38 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 0c6a2449-244e-494d-81e9-38d10a3f4244 X-Archives-Hash: 3c87811f0067d2d7bdb61645f9f35093 commit: d38405be3e0d22ad106e2e1e1c26dda2e216c402 Author: Ulrich Müller gentoo org> AuthorDate: Wed Mar 1 18:36:46 2017 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Wed Mar 1 18:36:46 2017 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=d38405be repoman: Don't update years in non-Gentoo copyright lines bug 611296 The regular expressions also match the whole line now, so broken date ranges like "1998-2017 - 2000" won't happen any more. For now, "Gentoo Foundation" is hardcoded as copyright holder. If necessary, this can later be moved to repository configuration. X-Gentoo-bug: 611296 X-Gentoo-bug-url: https://bugs.gentoo.org/611296 repoman/pym/repoman/copyrights.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/repoman/pym/repoman/copyrights.py b/repoman/pym/repoman/copyrights.py index 761309af6..7a36ff30d 100644 --- a/repoman/pym/repoman/copyrights.py +++ b/repoman/pym/repoman/copyrights.py @@ -14,8 +14,10 @@ from portage import shutil from portage import util -_copyright_re1 = re.compile(br'^(# Copyright \d\d\d\d)-\d\d\d\d ') -_copyright_re2 = re.compile(br'^(# Copyright )(\d\d\d\d) ') +_copyright_re1 = \ + re.compile(br'^(# Copyright \d\d\d\d)-\d\d\d\d( Gentoo Foundation)$') +_copyright_re2 = \ + re.compile(br'^(# Copyright )(\d\d\d\d)( Gentoo Foundation)$') class _copyright_repl(object): @@ -29,7 +31,7 @@ class _copyright_repl(object): return matchobj.group(0) else: return matchobj.group(1) + matchobj.group(2) + \ - b'-' + self.year + b' ' + b'-' + self.year + matchobj.group(3) def update_copyright_year(year, line): @@ -49,7 +51,7 @@ def update_copyright_year(year, line): year = _unicode_encode(year) line = _unicode_encode(line) - line = _copyright_re1.sub(br'\1-' + year + b' ', line) + line = _copyright_re1.sub(br'\1-' + year + br'\2', line) line = _copyright_re2.sub(_copyright_repl(year), line) if not is_bytes: line = _unicode_decode(line)