commit: 4220ac560490c485a00fe05e5adc020cc713d3d9
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 30 16:11:44 2018 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Sep 30 20:37:59 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=4220ac56
repoman: normalize newline handling in get_commit_footer
Start with an empty string, and add a newline character at the start
of each sucessive line. This simplifies the logic needed to add a new
line to the footer.
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
repoman/lib/repoman/actions.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/repoman/lib/repoman/actions.py b/repoman/lib/repoman/actions.py
index 9fe5f722e..3cf6f7081 100644
--- a/repoman/lib/repoman/actions.py
+++ b/repoman/lib/repoman/actions.py
@@ -419,7 +419,7 @@ the whole commit message to abort.
portage_version = "Unknown"
# Common part of commit footer
- commit_footer = "\n"
+ commit_footer = ""
for tag, bug in chain(
(('Bug', x) for x in self.options.bug),
(('Closes', x) for x in self.options.closes)):
@@ -439,14 +439,14 @@ the whole commit message to abort.
elif (purl.scheme == 'http' and
purl.netloc in
self.https_bugtrackers):
bug = urlunsplit(('https',) + purl[1:])
- commit_footer += "%s: %s\n" % (tag, bug)
+ commit_footer += "\n%s: %s" % (tag, bug)
if dco_sob:
- commit_footer += "Signed-off-by: %s\n" % (dco_sob, )
+ commit_footer += "\nSigned-off-by: %s" % (dco_sob, )
# Use new footer only for git (see bug #438364).
if self.vcs_settings.vcs in ["git"]:
- commit_footer += "Package-Manager: Portage-%s,
Repoman-%s" % (
+ commit_footer += "\nPackage-Manager: Portage-%s,
Repoman-%s" % (
portage.VERSION,
VERSION)
if report_options:
commit_footer += "\nRepoMan-Options: " + "
".join(report_options)
@@ -458,7 +458,7 @@ the whole commit message to abort.
unameout += platform.processor()
else:
unameout += platform.machine()
- commit_footer += "(Portage version: %s/%s/%s" % \
+ commit_footer += "\n(Portage version: %s/%s/%s" % \
(portage_version, self.vcs_settings.vcs,
unameout)
if report_options:
commit_footer += ", RepoMan options: " + "
".join(report_options)