commit: e9b63ed5c5e9f169c333b1d98613ec574ad946c8 Author: Zac Medico <zmedico <AT> gentoo <DOT> org> AuthorDate: Mon Feb 1 07:47:49 2016 +0000 Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org> CommitDate: Tue Mar 15 18:57:08 2016 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=e9b63ed5
repoman/actions.py: fix copyright update (bug 405017) The Actions.perform method failed to update copyright for new and changed files with --echangelog=n, so fix it to handle this case. X-Gentoo-Bug: 405017 X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=405017 pym/repoman/actions.py | 9 +++++++++ pym/repoman/utilities.py | 7 ------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py index c0cd5cc..643e24c 100644 --- a/pym/repoman/actions.py +++ b/pym/repoman/actions.py @@ -9,6 +9,7 @@ import platform import signal import sys import tempfile +import time from itertools import chain from _emerge.UserQuery import UserQuery @@ -22,6 +23,7 @@ from portage.output import ( from portage.package.ebuild.digestgen import digestgen from portage.util import writemsg_level +from repoman.copyrights import update_copyright from repoman.gpg import gpgsign, need_signature from repoman import utilities from repoman.modules.vcs.vcs import vcs_files_to_cps @@ -111,6 +113,13 @@ class Actions(object): commitmessage = commitmessage.rstrip() + # Update copyright for new and changed files + year = time.strftime('%Y', time.gmtime()) + for fn in chain(mynew, mychanged): + if fn.endswith('.diff') or fn.endswith('.patch'): + continue + update_copyright(fn, year, pretend=self.options.pretend) + myupdates, broken_changelog_manifests = self.changelogs( myupdates, mymanifests, myremoved, mychanged, myautoadd, mynew, commitmessage) diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py index 47b5aab..8a757dc 100644 --- a/pym/repoman/utilities.py +++ b/pym/repoman/utilities.py @@ -395,13 +395,6 @@ def UpdateChangeLog( year = time.strftime('%Y', gmtime) date = time.strftime('%d %b %Y', gmtime) - # check modified files and the ChangeLog for copyright updates - # patches and diffs (identified by .patch and .diff) are excluded - for fn in chain(new, changed): - if fn.endswith('.diff') or fn.endswith('.patch'): - continue - update_copyright(os.path.join(pkgdir, fn), year, pretend=pretend) - cl_path = os.path.join(pkgdir, 'ChangeLog') clold_lines = [] clnew_lines = []