Package: devscripts
Version: 2.14.3
Severity: important
Tags: patch

Hi!

While running with a dpkg-dev fixing #749044, I found out that debchange
is assuming that the emitted space on the first empty line for a
multiline field will always be present (from dpkg-parsechangelog output).
Here's a minimal patch fixing that. (Probably it would make sense to
switch the code to use Dpkg::Changelog::Parse, which should be more
robust.)

I'm pondering adding a versioned Breaks against devscripts to dpkg-dev,
but I'm not sure if that will be too harsh, as I was initially thinking
about uploading it either today or tomorrow, and only debchange breaks.

Thanks,
Guillem
From c71c8e3c6a9394a1db2408b079851025b6a743f5 Mon Sep 17 00:00:00 2001
From: Guillem Jover <[email protected]>
Date: Sat, 31 May 2014 12:47:56 +0200
Subject: [PATCH] debchange: Fix parsing of field's first empty line

Up to now dpkg-parsechangelog has emitted a spurious space on the first
empty line for multiline fields. This will be fixed in dpkg 1.17.10.
---
 scripts/debchange.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/debchange.pl b/scripts/debchange.pl
index 25d305c..91f53f4 100755
--- a/scripts/debchange.pl
+++ b/scripts/debchange.pl
@@ -644,7 +644,7 @@ if (! $opt_create || ($opt_create && $opt_news)) {
     while (<PARSED>) {
 	chomp;
 	if (/^(\S+):\s(.+?)\s*$/) { $changelog{$1}=$2; $last=$1; }
-	elsif (/^(\S+):\s$/) { $changelog{$1}=''; $last=$1; }
+	elsif (/^(\S+):\s?$/) { $changelog{$1}=''; $last=$1; }
 	elsif (/^\s\.$/) { $changelog{$last}.="\n"; }
 	elsif (/^\s(.+)$/) { $changelog{$last}.="$1\n"; }
 	else {
-- 
2.0.0

_______________________________________________
devscripts-devel mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/devscripts-devel

Reply via email to