summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2018-09-30 12:11:44 -0400
committerMike Gilbert <floppym@gentoo.org>2018-09-30 16:37:59 -0400
commit4220ac560490c485a00fe05e5adc020cc713d3d9 (patch)
treea46eb6e86f73320a7b031dbaff8a2cf0c40b4991
parentecompress: Fix duplicate pre-compressed file warning (diff)
downloadportage-4220ac560490c485a00fe05e5adc020cc713d3d9.tar.gz
portage-4220ac560490c485a00fe05e5adc020cc713d3d9.tar.bz2
portage-4220ac560490c485a00fe05e5adc020cc713d3d9.zip
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@gentoo.org>
-rw-r--r--repoman/lib/repoman/actions.py10
1 files 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)