Control: reassign -1 dh-golang Control: tags -1 patch On dom, gen 12, 2014 at 10:56:13 +0100, Michael Stapelberg wrote: > control: reassign -1 libparse-debcontrol-perl > > Hi Sergio, > > Sergio Schvezov <sergius...@gmail.com> writes: > > Dear Maintainer, > > Adding comments to debian/control break dh_golang > > > > dh_golang -O--buildsystem=golang -O--fail-missing > > Parse error: invalid key/value stansa at line 13 of data ("# This > > is a comment"). > > make: *** [binary] Error 255 > > > > From > > http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-controlsyntax > > > > "Lines starting with # without any preceding whitespace are comments > > lines that are only permitted in source package control files > > (debian/control). These comment lines are ignored, even between two > > continuation lines. They do not end logical lines." > This seems to be a deficiency in the Parse::DebControl Perl package.
This is not true. Parse::DebControl supports stripping comments just fine, but it doesn't do it by default. From the documentation: > stripComments - Remove all commented lines in standard #comment format. > Literal #'s are represented by ##. For instance > > Hello there #this is a comment > Hello there, I like ##CCCCCC as a grey. > > The first is a comment, the second is a literal "#". I attached a patch that makes dh_golang enable this option. I'm also reassigning this bug back to dh-golang. > I have a note in the dh-golang source stating that we might want to switch > to Dpkg::Control::Info I think this would be an even better solution, since Parse::DebControl appears to be abandoned upstream and that Dpkg::Control comes directly from the dpkg developers. Cheers P.S. I'm planning to do an NMU fixing both this bug and #721496, but the patch for the latter makes me a bit uncomfortable considering that it adds a new user-facing option, so I'd prefer if you commented on it first (or, if you want to do the upload yourself that would be even better).
From d5bf504efdb5b433145ab0de76557d2c8b3e5ece Mon Sep 17 00:00:00 2001 From: Alessandro Ghedini <alessan...@ghedini.me> Date: Mon, 28 Jul 2014 17:20:56 +0200 Subject: [PATCH] Enable debian/control comment stripping Closes: #734785 --- script/dh_golang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/dh_golang b/script/dh_golang index 6f248ad..57dbc59 100755 --- a/script/dh_golang +++ b/script/dh_golang @@ -43,7 +43,7 @@ my $built_using; # TODO: switch to Dpkg::Control::Info, maybe? my $control_parser = Parse::DebControl->new(); -my $control_data = $control_parser->parse_file('./debian/control'); +my $control_data = $control_parser->parse_file('./debian/control', { stripComments => 1 }); my $source_data = $control_data->[0]; if (!defined($source_data)) { error('Could not parse ./debian/control'); -- 2.0.1
signature.asc
Description: Digital signature