aboutsummaryrefslogtreecommitdiffhomepage
path: root/gbp/deb
diff options
context:
space:
mode:
authorKen Dreyer <kdreyer@redhat.com>2017-11-07 09:14:54 +0100
committerGuido Günther <agx@sigxcpu.org>2017-11-07 09:50:27 +0100
commit3d084fdd9fb93e2441238931ff1669ebbd69c86d (patch)
treee005e13019728cb8e13f783154aa9145c308e2ae /gbp/deb
parentd656cbd066fdc39aa74c1e4a8e13d31f25c15f2c (diff)
DebianChangelog: Strip trailing newlines from changes
Python3's message_from_string passes on a trailing newline from dpkg-parsechangelog but the consumer of the output shouldn't need to bother.
Diffstat (limited to 'gbp/deb')
-rw-r--r--gbp/deb/changelog.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/gbp/deb/changelog.py b/gbp/deb/changelog.py
index 33d83c19..b5813693 100644
--- a/gbp/deb/changelog.py
+++ b/gbp/deb/changelog.py
@@ -118,6 +118,12 @@ class ChangeLog(object):
cp['Upstream-Version'], cp['Debian-Version'] = cp['NoEpoch-Version'].rsplit('-', 1)
else:
cp['Debian-Version'] = cp['NoEpoch-Version']
+
+ # py3's email.message_from_string() saves dpkg-parsechangelog's
+ # first newline from the "Changes" field.
+ changes = cp['Changes'].lstrip("\n")
+ del cp['Changes']
+ cp['Changes'] = changes
except TypeError:
raise ParseChangeLogError(output.split('\n')[0])