public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Brian Dolbec" <dolsen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: repoman/pym/repoman/
Date: Wed,  1 Mar 2017 18:40:38 +0000 (UTC)	[thread overview]
Message-ID: <1488393406.d38405be3e0d22ad106e2e1e1c26dda2e216c402.dolsen@gentoo> (raw)

commit:     d38405be3e0d22ad106e2e1e1c26dda2e216c402
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Wed Mar  1 18:36:46 2017 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> 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)


             reply	other threads:[~2017-03-01 18:40 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-01 18:40 Brian Dolbec [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-03-30 17:23 [gentoo-commits] proj/portage:master commit in: repoman/pym/repoman/ Zac Medico
2018-02-27 19:07 Michał Górny
2018-02-27 19:07 Michał Górny
2017-08-06  6:54 Michał Górny
2017-07-18 23:08 Brian Dolbec
2017-03-15 21:56 Brian Dolbec
2017-03-01 19:22 Brian Dolbec
2017-01-14 19:10 Mike Gilbert
2017-01-14 14:23 Mike Gilbert
2017-01-13 17:13 Zac Medico
2017-01-06 17:17 Brian Dolbec
2017-01-06 17:17 Brian Dolbec
2017-01-06 17:17 Brian Dolbec
2016-12-06  3:54 Brian Dolbec
2016-10-11 18:54 Brian Dolbec
2016-09-15 18:46 Brian Dolbec
2016-09-15 18:46 Brian Dolbec
2016-06-30  5:54 Michał Górny
2016-06-28 15:34 Mike Frysinger
2016-06-24  6:38 Zac Medico
2016-05-15 23:51 Brian Dolbec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1488393406.d38405be3e0d22ad106e2e1e1c26dda2e216c402.dolsen@gentoo \
    --to=dolsen@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox