Bug#874718: debchange doesn't allow empty changelog entry

Adam D. Barratt adam at adam-barratt.org.uk
Sat Sep 9 23:00:08 UTC 2017


Control: retitle -1 dch "" should not create maintainer header
Control: tags -1 + patch

On Sun, 2017-09-10 at 07:37 +0900, Osamu Aoki wrote:
> control: retitle -1 dch -u "" creates undesired changelog entry
> 
> Hi,
> 
> On Sat, Sep 09, 2017 at 10:22:14AM +0100, Adam D. Barratt wrote:
[...]
On Sat, 2017-09-09 at 15:08 +0900, Osamu Aoki wrote:
> > > If "" is the text to be added to the changelog, debchange skips
> > > making line
> > > with "*".  This seems to intentional design decision of debchange
> > > which I have
> > > no idea why.  (Code logic around it is a bit complicated.  So I
> > > may
> > > be wrong)
> > 
> > [...]
> > > If no objection, I will try to update debchange.
> > 
> > The changelog says why:
> > 
> >     + Allow an explicit empty changelog entry to be passed on the
> > command line
> >       to allow non-interactive changes to the distribution and
> > urgency without
> >       adding a changelog entry (Closes: #442267)
> 
> Thanks for a pointer. 
> 
> > Is what you're looking for a valid changelog stanza that doesn't
> > contain an actual message? If so, would "dch ' '" suffice? (It
> > doesn't
> > add a space after the "*", and I can't remember if that's
> > intentional,
> > but it _does_ produce a changelog that dpkg-parsechangelog is happy
> > with.)
> 
> OK I didn't realize white space trick.  I was using null string.
> So now I know the solution for uupdate but still see issues with
> debchange.
> 
> This null string as argument is supposed to avoid interactive session
> like the case without text while not adding any extra line like space
> as
> text.
> 
>  $ dch -u high ""
> 
> This should simply update urgency.  But it doesn't do so.
[...]
> +  [ Osamu Aoki ]
> +

Right, yes, that looks like a bug indeed. I was about to suggest adding
--nomultimaint to your invocation in order to suppress it, but realised
that won't work - and is even documented as such. :-(

>From a quick test, I think this will work:

diff --git a/scripts/debchange.pl b/scripts/debchange.pl
index b44b9633..444bb399 100755
--- a/scripts/debchange.pl
+++ b/scripts/debchange.pl
@@ -1411,7 +1411,7 @@ if (($opt_r || $opt_a || $merge) && ! $opt_create) {
 
     if (! $opt_r) {
        # Add a multi-maintainer header...
-       if ($multimaint) {
+       if ($multimaint and not $EMPTY_TEXT) {
            # ...unless there already is one for this maintainer.
            if (!defined $maintline) {
                print O "\n  [ $MAINTAINER ]\n";

(an alternative would be having the preceding checks skip the block
that potentially sets $multimaint to 1 if $EMPTY_TEXT is set)

Regards,

Adam



More information about the devscripts-devel mailing list