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

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



Sean Whitton wrote on Sat, 14 Mar 2020 20:39 +00:00:
> Hello,
> 
> 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.

Here's a revision of the patch incorporating the feedback so far:

[[[
diff --git a/policy/ch-source.rst b/policy/ch-source.rst
index 1d870d9..1c71525 100644
--- a/policy/ch-source.rst
+++ b/policy/ch-source.rst
@@ -151,9 +151,9 @@ used here to separate groups of changes, if desired.
 If this upload resolves bugs recorded in the Bug Tracking System (BTS),
 they may be automatically closed on the inclusion of this package into
 the Debian archive by including the string: ``closes:  Bug#nnnnn`` in
-the change details.  [#]_ This information is conveyed via the
-``Closes`` field in the ``.changes`` file (see
-:ref:`s-f-Closes`).
+the change details, where ``#nnnnn`` is the bug number.  [#]_ This
+information is conveyed via the ``Closes`` field in the ``.changes``
+file (see :ref:`s-f-Closes`).
 
 The maintainer name and email address used in the changelog should be
 the details of the person who prepared this release of the package. They
@@ -860,10 +860,19 @@ should not exist a file ``debian/patches/foo.series`` for any ``foo``.
 
        /closes:\s*(?:bug)?\#?\s?\d+(?:,\s*(?:bug)?\#?\s?\d+)*/i
 
-   Then all of the bug numbers listed will be closed by the archive
+   That is: The string should consist of the word ``closes:`` followed by
+   a comma-separated list of bug numbers. Bug numbers may be preceded by
+   the word ``bug`` and/or a ``#`` sign, as in
+   ``Closes: 42, bug#43, #44, bug 45``.
+   
+   The list of bug numbers may span multiple lines.
+
+   All of the bug numbers listed will be closed by the archive
    maintenance software (``dak``) using the version of the changelog
    entry.
 
+   The words ``closes:`` and ``bug`` are not case sensitive.
+
 .. [#]
    In the case of a sponsored upload, the uploader signs the files, but
    the changelog maintainer name and address are those of the person who
]]]

Cheers,

Daniel


Reply to: