aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2016-01-31 23:47:49 -0800
committerBrian Dolbec <dolsen@gentoo.org>2016-03-15 11:57:08 -0700
commite9b63ed5c5e9f169c333b1d98613ec574ad946c8 (patch)
tree8182ea6eaa18dd33acc34c9c7022ac06a0cbb014
parentrepoman/modules.scan/metadata/unused.py: Add docstrings (diff)
downloadportage-e9b63ed5c5e9f169c333b1d98613ec574ad946c8.tar.gz
portage-e9b63ed5c5e9f169c333b1d98613ec574ad946c8.tar.bz2
portage-e9b63ed5c5e9f169c333b1d98613ec574ad946c8.zip
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
-rw-r--r--pym/repoman/actions.py9
-rw-r--r--pym/repoman/utilities.py7
2 files changed, 9 insertions, 7 deletions
diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
index c0cd5cc93..643e24cb2 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 47b5aabcb..8a757dc85 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 = []