[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#953911: debian-policy: clarify documentation of "Closes: #NNNNNN" changelog syntax



Guillem Jover wrote on Sat, 14 Mar 2020 22:51 +00:00:
> Hi!
> 
> On Sat, 2020-03-14 at 21:49:12 +0000, Daniel Shahaf wrote:
> > Sean Whitton wrote on Sat, 14 Mar 2020 20:39 +00:00:
> > > On Sat 14 Mar 2020 at 08:09PM +00, Daniel Shahaf wrote:
> > > > Daniel Shahaf wrote on Sat, 14 Mar 2020 18:14 +00:00:
> > > >> -   ::
> > > >> -
> > > >> -       /closes:\s*(?:bug)?\#?\s?\d+(?:,\s*(?:bug)?\#?\s?\d+)*/i
> > > >> -
> > > >> +   All of the bug numbers listed must be given on the same physical line
> > > >> +   as the word ``closes:``.
> > > >
> > > > Is this newly-added sentence correct?
> > > >
> > > > Whether it correctly states the semantics of the regexp depends on
> > > > whether the regexp is matched against the changelog entry as a single
> > > > multiline string or line-by-line.  In the former case, the list of bug
> > > > numbers would be allowed to span multiple lines, but in the latter case
> > > > it wouldn't.
> > > >
> > > > Currently, the patch assumes all bug numbers should be on the same line,
> > > > but /usr/share/vim/vim81/syntax/debchangelog.vim allows bug numbers to
> > > > span multiple lines.  I'm guessing the syntax file is right and the patch should
> > > > be changed?
> > > 
> > > In PCREs \s matches the newline character so I believe your text is
> > > incorrect.
> > 
> > I agree that it is probably incorrect, but that doesn't follow from the
> > semantics of /\s/.  Even if /\s/ matched any single byte/character, the
> > semantics would still depend on what haystack the regexp is matched
> > against: the entire changelog entry, or one line thereof at a time.
> 
> It is definitely incorrect. The canonical implementation is currently
> in libdpkg-perl's Dpkg::Changelog::Entry::Debian::find_closes(), where
> the entire changelog entry is passed as a single string, so something
> like this is perfectly fine:
> 
>     Closes:
>       #12345,
>       #67890,
>       #55555
> 

Thanks for the review and the pointer to the source of truth!

> AFAIK, DAK only operates based on the Closes field in the .changes
> file. I'll clarify the regex also in the deb-changelog(5) man page.
> 
> Thanks,
> Guillem

Cheers,

Daniel


Reply to: