Thanks! Makes sense.

Any chance you could add a test case for this under 
tests/patch-file-present-but-not-mentioned-in-series/ ?

On Sat, May 11, 2019 at 02:49:14PM +0000, Dmitry Bogatov wrote:
> 
> Package: lintian-brush
> Severity: wishlist
> Tags: patch
> 
> From dac3dbdaf7505502a860bb365ccd88da1717dc87 Mon Sep 17 00:00:00 2001
> From: Dmitry Bogatov <kact...@debian.org>
> Date: Sat, 11 May 2019 14:46:44 +0000
> Subject: [PATCH] New fixer: patch-file-present-but-not-mentioned-in-series.sh
> 
> Make sure that debian/patches contain only patches, mentioned in series
> file.
> ---
>  fixers/index.desc                                      |  3 +++
>  .../patch-file-present-but-not-mentioned-in-series.sh  | 10 ++++++++++
>  2 files changed, 13 insertions(+)
>  create mode 100755 fixers/patch-file-present-but-not-mentioned-in-series.sh
> 
> diff --git a/fixers/index.desc b/fixers/index.desc
> index 735179f..058889c 100644
> --- a/fixers/index.desc
> +++ b/fixers/index.desc
> @@ -120,6 +120,9 @@ Lintian-Tags:
>    package-uses-deprecated-debhelper-compat-version,
>    package-uses-old-debhelper-compat-version
>  
> +Fix-Script: patch-file-present-but-not-mentioned-in-series.sh
> +Lintian-Tags: patch-file-present-but-not-mentioned-in-series
> +
>  Fix-Script: possible-missing-colon-in-closes.sh
>  Lintian-Tags: possible-missing-colon-in-closes
>  
> diff --git a/fixers/patch-file-present-but-not-mentioned-in-series.sh 
> b/fixers/patch-file-present-but-not-mentioned-in-series.sh
> new file mode 100755
> index 0000000..66ff555
> --- /dev/null
> +++ b/fixers/patch-file-present-but-not-mentioned-in-series.sh
> @@ -0,0 +1,10 @@
> +#!/bin/sh -eu
> +test -r debian/patches/series || exit 0
> +cd debian/patches
> +
> +for f in * ; do
> +     test "${f}" != series || continue
> +     grep -q -- "${f}" series || rm "${f}"
> +done
> +echo "Remove patches missing from debian/patches/series."
> +echo "Fixed-Lintian-Tags: patch-file-present-but-not-mentioned-in-series"

Reply via email to