Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/
Date: Mon, 01 Feb 2016 07:55:07
Message-Id: 1454313255.a6a50adf336ca98044f0f981fad77efde078daef.zmedico@gentoo
1 commit: a6a50adf336ca98044f0f981fad77efde078daef
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Mon Feb 1 07:47:49 2016 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 1 07:54:15 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=a6a50adf
7
8 repoman/actions.py: fix copyright update (bug 405017)
9
10 The Actions.perform method failed to update copyright for new and
11 changed files with --echangelog=n, so fix it to handle this case.
12
13 X-Gentoo-Bug: 405017
14 X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=405017
15
16 pym/repoman/actions.py | 9 +++++++++
17 pym/repoman/utilities.py | 7 -------
18 2 files changed, 9 insertions(+), 7 deletions(-)
19
20 diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
21 index fbcef6e..1660381 100644
22 --- a/pym/repoman/actions.py
23 +++ b/pym/repoman/actions.py
24 @@ -11,6 +11,7 @@ import signal
25 import subprocess
26 import sys
27 import tempfile
28 +import time
29 from itertools import chain
30
31 from _emerge.UserQuery import UserQuery
32 @@ -26,6 +27,7 @@ from portage.process import find_binary, spawn
33 from portage.util import writemsg_level
34
35 from repoman._subprocess import repoman_getstatusoutput
36 +from repoman.copyrights import update_copyright
37 from repoman.gpg import gpgsign, need_signature
38 from repoman import utilities
39 from repoman.modules.vcs.vcs import vcs_files_to_cps
40 @@ -114,6 +116,13 @@ class Actions(object):
41
42 commitmessage = commitmessage.rstrip()
43
44 + # Update copyright for new and changed files
45 + year = time.strftime('%Y', time.gmtime())
46 + for fn in chain(mynew, mychanged):
47 + if fn.endswith('.diff') or fn.endswith('.patch'):
48 + continue
49 + update_copyright(fn, year, pretend=self.options.pretend)
50 +
51 myupdates, broken_changelog_manifests = self.changelogs(
52 myupdates, mymanifests, myremoved, mychanged, myautoadd,
53 mynew, commitmessage)
54
55 diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py
56 index 47b5aab..8a757dc 100644
57 --- a/pym/repoman/utilities.py
58 +++ b/pym/repoman/utilities.py
59 @@ -395,13 +395,6 @@ def UpdateChangeLog(
60 year = time.strftime('%Y', gmtime)
61 date = time.strftime('%d %b %Y', gmtime)
62
63 - # check modified files and the ChangeLog for copyright updates
64 - # patches and diffs (identified by .patch and .diff) are excluded
65 - for fn in chain(new, changed):
66 - if fn.endswith('.diff') or fn.endswith('.patch'):
67 - continue
68 - update_copyright(os.path.join(pkgdir, fn), year, pretend=pretend)
69 -
70 cl_path = os.path.join(pkgdir, 'ChangeLog')
71 clold_lines = []
72 clnew_lines = []