chiark / gitweb /
dgit: Do not introduce duplicate origs in .changes files
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 26 Jun 2018 23:16:29 +0000 (00:16 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 26 Jun 2018 23:59:22 +0000 (00:59 +0100)
commitef0c4cd40f2c8bd50ea252f7de56dae3b64eeced
tree09af9db92887b64ec76243c557fdfa06df8dfa7f
parent047db2064cbc162d8fceff77ec6dd38eab135c6c
dgit: Do not introduce duplicate origs in .changes files

The .dsc and .changes matching code contained roughly
   $fieldbody =~ / \Q$item\E\n/m
but this is wrong when the $fieldbody matches $item in its last line,
and there is no trailing newline (as would be usual).  This code
is obviouslu confused because m affects only ^ $ which don't appear
in the regexp.  Change these to / \Q$item\E$/m which is what ought
to have been, and probably was, intended.

In one case we are trying to delete a line.  In that case we need to
remove the leading newline.  The field body always starts with a
newline so the use of \n rather than ^ is fine.

Closes:#869146.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
dgit