Hi!

On Sat, 2017-03-25 at 19:27:55 -0400, G. Branden Robinson wrote:
> On Sat, Mar 25, 2017 at 03:07:32PM +0100, Guillem Jover wrote:
> > The implementation in dpkg-dev already supports all of this
> > (see man Dpkg::Changelog::Debian), including:
> 
> Section 3 manpages for Perl modules?  Will wonders never cease?  ;-)

I'm not sure if the wonder is becuse there's documentation at all for
those, or because secion is 3 instead of say 3perl. In any case, this
prompted me to check and fix the latter, so I've queued a patch for
1.19.x. :)

> Thanks--I was utterly unaware of this.

No problem!

> > So I guess your request would be to officialize (at least the proper
> > comment markers ‘#’) as supported, in the spec. I'll probably mention
> > this on the debian-policy mailing list, but I guess I should just do
> > it (perhaps all the currently accepted syntax) because if someone wants
> > to code an alternative implementation, they will have to replicate the
> > logic, or it will be unable to parse existing changelogs.
> > 
> > Also because dpkg can always be more lax than policy, and this is the
> > case right here.
> 
> Yes, that's precisely what I'm shooting for.
> 
> I urge you to go ahead and do it; it's obviously not a breaking change.

Ok, what about the attached patch, which I've queued for 1.19.x? I'm
not documenting the ancient formats, because I feel that might induce
people to use them, while this should be IMO pretty much just an
implementation detail.

Thanks,
Guillem
From a77397811e30e74500b79ea4eee4aa8d93a6e5ac Mon Sep 17 00:00:00 2001
From: Guillem Jover <guil...@debian.org>
Date: Sun, 9 Apr 2017 03:51:03 +0200
Subject: [PATCH] man: Document currently accepted syntax for changelogs

The current implementation supports several comment lines, VCS and
editor variable settings which get ignored. In addition, to be able
to handle ancient changelog entries, the parser will detect those and
ignore while preserving them for output.

Closes: #858579
---
 man/deb-changelog.man            | 10 +++++++++-
 scripts/Dpkg/Changelog/Debian.pm |  4 ++--
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/man/deb-changelog.man b/man/deb-changelog.man
index 2a424a4bb..4a058b1bd 100644
--- a/man/deb-changelog.man
+++ b/man/deb-changelog.man
@@ -7,7 +7,7 @@
 .\" Copyright © 2008, 2010 Russ Allbery <r...@debian.org>
 .\" Copyright © 2010 Charles Plessy <ple...@debian.org>
 .\" Copyright © 2014 Bill Allombert <ballo...@debian.org>
-.\" Copyright © 2015 Guillem Jover <guil...@debian.org>
+.\" Copyright © 2015-2017 Guillem Jover <guil...@debian.org>
 .\"
 .\" This is free software; you can redistribute it and/or modify
 .\" it under the terms of the GNU General Public License as published by
@@ -141,6 +141,14 @@ preceded by exactly one space.
 The maintainer details and the date must be separated by exactly two
 spaces.
 .PP
+Any line that consists entirely (i.e. no leading whitespace) of \fB#\fP
+or \fB/* */\fP style comments, CVS keywords, vim variables or emacs local
+variables should be ignored.
+.PP
+Ancient changelog entries with other formats at the end of the file should
+be accepted and preserved on output, but their contents might be otherwise
+ignored and parsing stopped at that point.
+.PP
 The entire changelog must be encoded in UTF-8.
 .SH FILES
 .TP
diff --git a/scripts/Dpkg/Changelog/Debian.pm b/scripts/Dpkg/Changelog/Debian.pm
index 4ed04a943..a63e6eb19 100644
--- a/scripts/Dpkg/Changelog/Debian.pm
+++ b/scripts/Dpkg/Changelog/Debian.pm
@@ -1,7 +1,7 @@
 # Copyright © 1996 Ian Jackson
 # Copyright © 2005 Frank Lichtenheld <fr...@lichtenheld.de>
 # Copyright © 2009 Raphaël Hertzog <hert...@debian.org>
-# Copyright © 2012-2015 Guillem Jover <guil...@debian.org>
+# Copyright © 2012-2017 Guillem Jover <guil...@debian.org>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -28,7 +28,7 @@ Dpkg::Changelog::Debian parses Debian changelogs as described in
 deb-changelog(5).
 
 The parser tries to ignore most cruft like # or /* */ style comments,
-CVS comments, vim variables, emacs local variables and stuff from
+CVS keywords, vim variables, emacs local variables and stuff from
 older changelogs with other formats at the end of the file.
 NOTE: most of these are ignored silently currently, there is no
 parser error issued for them. This should become configurable in the
-- 
2.12.2.715.g7642488e1d

Reply via email to