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

[lintian] 01/01: Add a check for packages that specify "dh --with quilt" but use the "3.0 (quilt)" source format. Thanks to Mattia Rizzolo for the idea. (Closes: #886566)



This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository lintian.

commit 9d331c0d391c2a702e158341cc2d08f89e595968
Author: Chris Lamb <lamby@debian.org>
Date:   Mon Jan 8 22:46:23 2018 +0530

    Add a check for packages that specify "dh --with quilt" but use the "3.0 (quilt)" source format. Thanks to Mattia Rizzolo for the idea. (Closes: #886566)
---
 checks/debhelper.desc                                            | 9 +++++++++
 checks/debhelper.pm                                              | 4 ++++
 debian/changelog                                                 | 4 ++++
 .../debian/debian/rules                                          | 4 ++++
 .../debian/debian/source/format                                  | 1 +
 .../debhelper-dh-quilt-addon-but-quilt-source-format-unrel/desc  | 7 +++++++
 .../debhelper-dh-quilt-addon-but-quilt-source-format-unrel/tags  | 1 +
 .../debian/debian/rules                                          | 4 ++++
 .../debian/debian/source/format                                  | 1 +
 t/tests/debhelper-dh-quilt-addon-but-quilt-source-format/desc    | 6 ++++++
 t/tests/debhelper-dh-quilt-addon-but-quilt-source-format/tags    | 2 ++
 11 files changed, 43 insertions(+)

diff --git a/checks/debhelper.desc b/checks/debhelper.desc
index e10fddd..fb23fd7 100644
--- a/checks/debhelper.desc
+++ b/checks/debhelper.desc
@@ -397,3 +397,12 @@ Info: The debhelper tools from autotools-dev has been replaced by the tool
  <tt>dh_clean</tt>, so they can most likely just be removed without
  any further changes.
 Ref: #878528
+
+Tag: dh-quilt-addon-but-quilt-source-format
+Severity: normal
+Certainty: certain
+Info: The package (for example) <tt>dh $@ --with quilt</tt> in
+ <tt>debian/rules</tt> but is already using the <tt>3.0 (quilt)</tt>
+ source format via the <tt>debian/source/format</tt> file.
+ .
+ Please remove the <tt>--with quilt</tt> argument.
diff --git a/checks/debhelper.pm b/checks/debhelper.pm
index ade91a1..793d399 100644
--- a/checks/debhelper.pm
+++ b/checks/debhelper.pm
@@ -148,6 +148,10 @@ sub run {
                           "dh ... --with ${orig_addon} (line $.)";
                         $uses_autotools_dev_dh = 1;
                     }
+                    tag 'dh-quilt-addon-but-quilt-source-format',
+                      "dh ... --with ${orig_addon}", "(line $.)"
+                      if $addon eq 'quilt'
+                      and $info->field('format', '') eq '3.0 (quilt)';
                     if (defined $depends) {
                         $missingbdeps_addons{$depends} = $addon;
                     }
diff --git a/debian/changelog b/debian/changelog
index aebbe34..6839009 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -15,6 +15,10 @@ lintian (2.5.68) UNRELEASED; urgency=medium
   * checks/debconf.pm:
     + [CL] Don't warn about unknown template type "entropy" when a package
       depends on cdebconf.  (Closes: #677870)
+  * checks/debhelper.{desc,pm}:
+    + [CL] Add a check for packages that specify "dh --with quilt" but use
+      the "3.0 (quilt)" source format. Thanks to Mattia Rizzolo for the
+      idea.  (Closes: #886566)
   * checks/fields.pm:
     + [CL] Warn about orphaned packages that are not maintained in the
       Debian infrastucture.  (Closes: #886057)
diff --git a/t/tests/debhelper-dh-quilt-addon-but-quilt-source-format-unrel/debian/debian/rules b/t/tests/debhelper-dh-quilt-addon-but-quilt-source-format-unrel/debian/debian/rules
new file mode 100755
index 0000000..f6b359a
--- /dev/null
+++ b/t/tests/debhelper-dh-quilt-addon-but-quilt-source-format-unrel/debian/debian/rules
@@ -0,0 +1,4 @@
+#!/usr/bin/make -f
+
+%:
+	dh $@ --with quilt
diff --git a/t/tests/debhelper-dh-quilt-addon-but-quilt-source-format-unrel/debian/debian/source/format b/t/tests/debhelper-dh-quilt-addon-but-quilt-source-format-unrel/debian/debian/source/format
new file mode 100644
index 0000000..89ae9db
--- /dev/null
+++ b/t/tests/debhelper-dh-quilt-addon-but-quilt-source-format-unrel/debian/debian/source/format
@@ -0,0 +1 @@
+3.0 (native)
diff --git a/t/tests/debhelper-dh-quilt-addon-but-quilt-source-format-unrel/desc b/t/tests/debhelper-dh-quilt-addon-but-quilt-source-format-unrel/desc
new file mode 100644
index 0000000..3f46d0f
--- /dev/null
+++ b/t/tests/debhelper-dh-quilt-addon-but-quilt-source-format-unrel/desc
@@ -0,0 +1,7 @@
+Testname: debhelper-dh-quilt-addon-but-quilt-source-format-unrel
+Version: 1.0
+Description: Test for quilt packages that specify dh --with-quilt (false positive)
+Test-For:
+ missing-build-dependency-for-dh-addon
+Test-Against:
+ dh-quilt-addon-but-quilt-source-format
diff --git a/t/tests/debhelper-dh-quilt-addon-but-quilt-source-format-unrel/tags b/t/tests/debhelper-dh-quilt-addon-but-quilt-source-format-unrel/tags
new file mode 100644
index 0000000..c87fe70
--- /dev/null
+++ b/t/tests/debhelper-dh-quilt-addon-but-quilt-source-format-unrel/tags
@@ -0,0 +1 @@
+E: debhelper-dh-quilt-addon-but-quilt-source-format-unrel source: missing-build-dependency-for-dh-addon quilt => quilt
diff --git a/t/tests/debhelper-dh-quilt-addon-but-quilt-source-format/debian/debian/rules b/t/tests/debhelper-dh-quilt-addon-but-quilt-source-format/debian/debian/rules
new file mode 100755
index 0000000..f6b359a
--- /dev/null
+++ b/t/tests/debhelper-dh-quilt-addon-but-quilt-source-format/debian/debian/rules
@@ -0,0 +1,4 @@
+#!/usr/bin/make -f
+
+%:
+	dh $@ --with quilt
diff --git a/t/tests/debhelper-dh-quilt-addon-but-quilt-source-format/debian/debian/source/format b/t/tests/debhelper-dh-quilt-addon-but-quilt-source-format/debian/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/t/tests/debhelper-dh-quilt-addon-but-quilt-source-format/debian/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/t/tests/debhelper-dh-quilt-addon-but-quilt-source-format/desc b/t/tests/debhelper-dh-quilt-addon-but-quilt-source-format/desc
new file mode 100644
index 0000000..fb0c19b
--- /dev/null
+++ b/t/tests/debhelper-dh-quilt-addon-but-quilt-source-format/desc
@@ -0,0 +1,6 @@
+Testname: debhelper-dh-quilt-addon-but-quilt-source-format
+Version: 1.0-1
+Type: non-native
+Description: Test for quilt packages that specify dh --with-quilt
+Test-For:
+ dh-quilt-addon-but-quilt-source-format
diff --git a/t/tests/debhelper-dh-quilt-addon-but-quilt-source-format/tags b/t/tests/debhelper-dh-quilt-addon-but-quilt-source-format/tags
new file mode 100644
index 0000000..727f550
--- /dev/null
+++ b/t/tests/debhelper-dh-quilt-addon-but-quilt-source-format/tags
@@ -0,0 +1,2 @@
+E: debhelper-dh-quilt-addon-but-quilt-source-format source: missing-build-dependency-for-dh-addon quilt => quilt
+W: debhelper-dh-quilt-addon-but-quilt-source-format source: dh-quilt-addon-but-quilt-source-format dh ... --with quilt (line 4)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: