From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RFbk0-0003gV-SR for garchives@archives.gentoo.org; Mon, 17 Oct 2011 01:11:45 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A947B21C06C; Mon, 17 Oct 2011 01:11:34 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 629F621C06C for ; Mon, 17 Oct 2011 01:11:34 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AE4741B4002 for ; Mon, 17 Oct 2011 01:11:33 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id D194680042 for ; Mon, 17 Oct 2011 01:11:32 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <190a8a577934755ff07f9bc58f0b87a65c7f0738.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/repoman/ X-VCS-Repository: proj/portage X-VCS-Files: pym/repoman/utilities.py X-VCS-Directories: pym/repoman/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 190a8a577934755ff07f9bc58f0b87a65c7f0738 Date: Mon, 17 Oct 2011 01:11:32 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: d53895083b6b7aede130c9fe7b1dd731 commit: 190a8a577934755ff07f9bc58f0b87a65c7f0738 Author: Zac Medico gentoo org> AuthorDate: Mon Oct 17 01:11:22 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Oct 17 01:11:22 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D190a8a57 UpdateChangeLog: update copyright year in header This feature got dropped on commit b655137b7b5f87c11a7e742b7ef0e028a1139677. --- pym/repoman/utilities.py | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py index 5b9eaf7..e4fc1a4 100644 --- a/pym/repoman/utilities.py +++ b/pym/repoman/utilities.py @@ -28,6 +28,7 @@ import io from itertools import chain import logging import pwd +import re import sys import time import textwrap @@ -549,6 +550,7 @@ def UpdateChangeLog(pkgdir, category, package, new, r= emoved, changed, msg, prete cl_path =3D os.path.join(pkgdir, 'ChangeLog') clold_lines =3D [] clnew_lines =3D [] + old_header_lines =3D [] header_lines =3D [] =20 try: @@ -583,6 +585,12 @@ def UpdateChangeLog(pkgdir, category, package, new, = removed, changed, msg, prete if not line_strip: break =20 + # update the copyright year + old_header_lines =3D header_lines[:] + if len(header_lines) >=3D 2: + header_lines[1] =3D re.sub(r'^(# Copyright \d\d\d\d)-\d\d\d\d ', + r'\1-%s ' % time.strftime('%Y'), header_lines[1]) + # write new ChangeLog entry clnew_lines.extend(header_lines) date =3D time.strftime('%d %b %Y') @@ -620,9 +628,9 @@ def UpdateChangeLog(pkgdir, category, package, new, r= emoved, changed, msg, prete for line in clold_lines: f.write(line) =20 - # Now prepend header_lines to clold_lines, for use + # Now prepend old_header_lines to clold_lines, for use # in the unified_diff call below. - clold_lines =3D header_lines + clold_lines + clold_lines =3D old_header_lines + clold_lines =20 for line in clold_file: f.write(line)