1 |
commit: 4220ac560490c485a00fe05e5adc020cc713d3d9 |
2 |
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Sep 30 16:11:44 2018 +0000 |
4 |
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Sep 30 20:37:59 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=4220ac56 |
7 |
|
8 |
repoman: normalize newline handling in get_commit_footer |
9 |
|
10 |
Start with an empty string, and add a newline character at the start |
11 |
of each sucessive line. This simplifies the logic needed to add a new |
12 |
line to the footer. |
13 |
|
14 |
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org> |
15 |
|
16 |
repoman/lib/repoman/actions.py | 10 +++++----- |
17 |
1 file changed, 5 insertions(+), 5 deletions(-) |
18 |
|
19 |
diff --git a/repoman/lib/repoman/actions.py b/repoman/lib/repoman/actions.py |
20 |
index 9fe5f722e..3cf6f7081 100644 |
21 |
--- a/repoman/lib/repoman/actions.py |
22 |
+++ b/repoman/lib/repoman/actions.py |
23 |
@@ -419,7 +419,7 @@ the whole commit message to abort. |
24 |
portage_version = "Unknown" |
25 |
|
26 |
# Common part of commit footer |
27 |
- commit_footer = "\n" |
28 |
+ commit_footer = "" |
29 |
for tag, bug in chain( |
30 |
(('Bug', x) for x in self.options.bug), |
31 |
(('Closes', x) for x in self.options.closes)): |
32 |
@@ -439,14 +439,14 @@ the whole commit message to abort. |
33 |
elif (purl.scheme == 'http' and |
34 |
purl.netloc in self.https_bugtrackers): |
35 |
bug = urlunsplit(('https',) + purl[1:]) |
36 |
- commit_footer += "%s: %s\n" % (tag, bug) |
37 |
+ commit_footer += "\n%s: %s" % (tag, bug) |
38 |
|
39 |
if dco_sob: |
40 |
- commit_footer += "Signed-off-by: %s\n" % (dco_sob, ) |
41 |
+ commit_footer += "\nSigned-off-by: %s" % (dco_sob, ) |
42 |
|
43 |
# Use new footer only for git (see bug #438364). |
44 |
if self.vcs_settings.vcs in ["git"]: |
45 |
- commit_footer += "Package-Manager: Portage-%s, Repoman-%s" % ( |
46 |
+ commit_footer += "\nPackage-Manager: Portage-%s, Repoman-%s" % ( |
47 |
portage.VERSION, VERSION) |
48 |
if report_options: |
49 |
commit_footer += "\nRepoMan-Options: " + " ".join(report_options) |
50 |
@@ -458,7 +458,7 @@ the whole commit message to abort. |
51 |
unameout += platform.processor() |
52 |
else: |
53 |
unameout += platform.machine() |
54 |
- commit_footer += "(Portage version: %s/%s/%s" % \ |
55 |
+ commit_footer += "\n(Portage version: %s/%s/%s" % \ |
56 |
(portage_version, self.vcs_settings.vcs, unameout) |
57 |
if report_options: |
58 |
commit_footer += ", RepoMan options: " + " ".join(report_options) |