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

[lintian] 01/02: c/debhelper: The autotools-dev debhelper commands are deprecated



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

nthykier pushed a commit to branch master
in repository lintian.

commit e1ade164a923d529e760f056d47599df5bbf18fb
Author: Niels Thykier <niels@thykier.net>
Date:   Sat Oct 14 12:44:22 2017 +0000

    c/debhelper: The autotools-dev debhelper commands are deprecated
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 checks/debhelper.desc                                 | 19 +++++++++++++++++++
 checks/debhelper.pm                                   | 13 ++++++++++++-
 debian/changelog                                      |  4 ++++
 t/tests/debhelper-autoreconf-build-depends-unrel/desc |  2 ++
 t/tests/debhelper-autoreconf-build-depends-unrel/tags |  1 +
 t/tests/debhelper-deprecated/debian/debian/rules      |  3 +++
 t/tests/debhelper-deprecated/desc                     |  2 +-
 t/tests/debhelper-deprecated/tags                     |  2 ++
 8 files changed, 44 insertions(+), 2 deletions(-)

diff --git a/checks/debhelper.desc b/checks/debhelper.desc
index fc5532a..e10fddd 100644
--- a/checks/debhelper.desc
+++ b/checks/debhelper.desc
@@ -378,3 +378,22 @@ Info: Since compatibility level 10, debhelper enables the <tt>autoreconf</tt>
  .
  It is therefore not necessary to specify build-dependencies on
  <tt>dh-autoreconf</tt> or <tt>autotools-dev</tt> and they can be removed.
+
+Tag: debhelper-tools-from-autotools-dev-are-deprecated
+Severity: minor
+Certainty: certain
+Info: The debhelper tools from autotools-dev has been replaced by the tool
+ <tt>dh_update_autotools_config</tt>, which was available in
+ debhelper (&gt;= 9.20160114)
+ .
+ The <tt>dh_update_autotools_config</tt> is run by default via the <tt>dh</tt>
+ command sequencer.  If you are using <tt>dh</tt>, you can probably just remove
+ the uses of the tooling from autotools-dev without doing any further changes.
+ .
+ If you use the "classic" debhelper style, then please replace all
+ calls to <tt>dh_autotools-dev_updateconfig</tt> with
+ <tt>dh_update_autotools_config</tt>.  The calls to
+ <tt>dh_autotools-dev_restoreconfig</tt> are replaced by
+ <tt>dh_clean</tt>, so they can most likely just be removed without
+ any further changes.
+Ref: #878528
diff --git a/checks/debhelper.pm b/checks/debhelper.pm
index d5a989e..74902e4 100644
--- a/checks/debhelper.pm
+++ b/checks/debhelper.pm
@@ -98,6 +98,11 @@ sub run {
             if ($dhcommand eq 'dh_installmanpages') {
                 tag 'dh_installmanpages-is-obsolete', "line $.";
             }
+            if (   $dhcommand eq 'dh_autotools-dev_restoreconfig'
+                or $dhcommand eq 'dh_autotools-dev_updateconfig') {
+                tag 'debhelper-tools-from-autotools-dev-are-deprecated',
+                  "$dhcommand (line $.)";
+            }
             if ($dhcommand eq 'dh_python3') {
                 $seen_python3_helper = 1;
             }
@@ -138,9 +143,15 @@ sub run {
             while (m/\s--with(?:=|\s+)(['"]?)(\S+)\1/go) {
                 my $addon_list = $2;
                 for my $addon (split(m/,/o, $addon_list)) {
+                    my $orig_addon = $addon;
                     $addon =~ y,-,_,;
-                    my $depends =$dh_addons_manual->value($addon)
+                    my $depends = $dh_addons_manual->value($addon)
                       || $dh_addons->value($addon);
+                    if ($addon eq 'autotools_dev') {
+                        tag
+                          'debhelper-tools-from-autotools-dev-are-deprecated',
+                          "dh ... --with ${orig_addon} (line $.)";
+                    }
                     if (defined $depends) {
                         $missingbdeps_addons{$depends} = $addon;
                     }
diff --git a/debian/changelog b/debian/changelog
index 6d90c57..dc22287 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,10 @@ lintian (2.5.56) UNRELEASED; urgency=medium
   * checks/debconf.desc:
     + [CL] Apply patch from Ville Skyttä <ville.skytta@iki.fi> to update
       the debconf-spec refs.  (Closes: #878449)
+  * checks/debhelper.{desc,pm}:
+    + [NT] Add check for using using the debhelper tooling from the
+      autotools-dev package.  These have been replaced by the changes
+      inside debhelper itself.
   * checks/watch-file.pm:
     + [CL] Include the offending URI in debian-watch-uses-insecure-uri
       output, not the line number.
diff --git a/t/tests/debhelper-autoreconf-build-depends-unrel/desc b/t/tests/debhelper-autoreconf-build-depends-unrel/desc
index c243270..499e631 100644
--- a/t/tests/debhelper-autoreconf-build-depends-unrel/desc
+++ b/t/tests/debhelper-autoreconf-build-depends-unrel/desc
@@ -5,3 +5,5 @@ Test-Depends: debhelper (>= 10)
 Test-Against:
  missing-build-dependency-for-dh_-command
  useless-autoreconf-build-depends
+Test-For:
+ debhelper-tools-from-autotools-dev-are-deprecated
diff --git a/t/tests/debhelper-autoreconf-build-depends-unrel/tags b/t/tests/debhelper-autoreconf-build-depends-unrel/tags
index e69de29..d33205e 100644
--- a/t/tests/debhelper-autoreconf-build-depends-unrel/tags
+++ b/t/tests/debhelper-autoreconf-build-depends-unrel/tags
@@ -0,0 +1 @@
+W: debhelper-autoreconf-build-depends-unrel source: debhelper-tools-from-autotools-dev-are-deprecated dh_autotools-dev_updateconfig (line 8)
diff --git a/t/tests/debhelper-deprecated/debian/debian/rules b/t/tests/debhelper-deprecated/debian/debian/rules
index 4404bec..2f7c75e 100755
--- a/t/tests/debhelper-deprecated/debian/debian/rules
+++ b/t/tests/debhelper-deprecated/debian/debian/rules
@@ -42,4 +42,7 @@ endif
 	dh_md5sums
 	dh_builddeb
 
+somewhere:
+	dh $@ --with autotools-dev
+
 .PHONY: build-arch build-indep build binary binary-arch binary-indep clean
diff --git a/t/tests/debhelper-deprecated/desc b/t/tests/debhelper-deprecated/desc
index cc9096b..1229056 100644
--- a/t/tests/debhelper-deprecated/desc
+++ b/t/tests/debhelper-deprecated/desc
@@ -3,5 +3,5 @@ Version: 1.0
 Description: Test for use of deprecated dh_* commands
 Extra-Build-Depends: python-ply (>= 3.4-1~)
 Test-For:
+ debhelper-tools-from-autotools-dev-are-deprecated
  dh_installmanpages-is-obsolete
-
diff --git a/t/tests/debhelper-deprecated/tags b/t/tests/debhelper-deprecated/tags
index 2298dd6..bbfb3d2 100644
--- a/t/tests/debhelper-deprecated/tags
+++ b/t/tests/debhelper-deprecated/tags
@@ -1 +1,3 @@
+E: debhelper-deprecated source: missing-build-dependency-for-dh-addon autotools_dev => autotools-dev
+W: debhelper-deprecated source: debhelper-tools-from-autotools-dev-are-deprecated dh ... --with autotools-dev (line 46)
 W: debhelper-deprecated source: dh_installmanpages-is-obsolete line 24

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


Reply to: