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

[lintian] 01/01: Warn about scripts using "nodejs" as an interpreter now that nodejs provides /usr/bin/node. (Closes: #873096)



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

lamby pushed a commit to branch master
in repository lintian.

commit 7d0c0732e792cf0a0cadeb583c9878463813e24a
Author: Chris Lamb <lamby@debian.org>
Date:   Thu Aug 24 17:13:35 2017 +0100

    Warn about scripts using "nodejs" as an interpreter now that nodejs provides /usr/bin/node. (Closes: #873096)
---
 checks/scripts.desc                      | 14 ++++++++++++++
 checks/scripts.pm                        |  4 ++++
 data/scripts/interpreters                |  1 -
 debian/changelog                         |  2 ++
 t/tests/scripts-interpreters-nodejs/desc |  1 +
 t/tests/scripts-interpreters-nodejs/tags |  1 +
 6 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/checks/scripts.desc b/checks/scripts.desc
index 7f7664b..923e843 100644
--- a/checks/scripts.desc
+++ b/checks/scripts.desc
@@ -765,3 +765,17 @@ Info: The listed script uses one or more of the binaries in
  .
  In most cases, you will need to add a <tt>Depends</tt> on
  <tt>sensible-utils</tt>.
+
+Tag: script-uses-deprecated-nodejs-location
+Severity: normal
+Certainty: possible
+Info: You used <tt>/usr/bin/nodejs</tt> or <tt>/usr/bin/env nodejs</tt> as an
+ interpreter for a script.
+ .
+ The <tt>/usr/bin/node</tt> binary was previously provided by
+ <tt>ax25-node</tt> and packages were required to use <tt>/usr/bin/nodejs</tt>
+ instead. This was subsequently repealed by the Technical Committee and the
+ <tt>nodejs</tt> now ships the <tt>/usr/bin/node</tt> binary to match the rest
+ of the Node.js ecosystem.
+ .
+ Please update your package to use the <tt>node</tt> variant.
diff --git a/checks/scripts.pm b/checks/scripts.pm
index 7828e85..4a0f2f9 100644
--- a/checks/scripts.pm
+++ b/checks/scripts.pm
@@ -378,6 +378,10 @@ sub run {
             script_tag('interpreter-in-usr-local', $filename,"#!$interpreter");
         } elsif ($interpreter eq '/bin/env') {
             script_tag('script-uses-bin-env', $filename);
+        } elsif ($interpreter eq 'nodejs') {
+            script_tag('script-uses-deprecated-nodejs-location',$filename);
+            # Check whether we have correct dependendies on nodejs regardless.
+            $data = $INTERPRETERS->value('node');
         } elsif ($base =~ /^php/) {
             script_tag('php-script-with-unusual-interpreter',
                 $filename, "$interpreter");
diff --git a/data/scripts/interpreters b/data/scripts/interpreters
index ade5031..4e1156f 100644
--- a/data/scripts/interpreters
+++ b/data/scripts/interpreters
@@ -62,7 +62,6 @@ newlisp        => /usr/bin
 ngraph         => /usr/bin, ngraph-gtk
 nickle         => /usr/bin
 node           => /usr/bin, nodejs
-nodejs         => /usr/bin
 ocamlrun       => /usr/bin, ocaml-base-nox | ocaml-base | ocaml-nox | ocaml
 pagsh          => /usr/bin, openafs-client | heimdal-clients
 parrot         => /usr/bin
diff --git a/debian/changelog b/debian/changelog
index 3be7ef1..9e772a6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -68,6 +68,8 @@ lintian (2.5.53) UNRELEASED; urgency=medium
       maintainer scripts.  (Closes: #872042)
     + [CL] Check for packages using sensible-utils without declaring a
       dependency after its split from debianutils.  (Closes: #872611)
+    + [CL] Warn about scripts using "nodejs" as an interpreter now that nodejs
+      provides /usr/bin/node.  (Closes: #873096)
   * checks/testsuite.{desc,pm}:
     + [CL] Remove recommendations to add a "Testsuite: autopkgtest" field
       to debian/control as it is added when needed by dpkg-source(1)
diff --git a/t/tests/scripts-interpreters-nodejs/desc b/t/tests/scripts-interpreters-nodejs/desc
index 3894d5f..3e45476 100644
--- a/t/tests/scripts-interpreters-nodejs/desc
+++ b/t/tests/scripts-interpreters-nodejs/desc
@@ -3,3 +3,4 @@ Version: 1.0
 Description: Check various NodeJS issues
 Test-For:
  missing-dep-for-interpreter
+ script-uses-deprecated-nodejs-location
diff --git a/t/tests/scripts-interpreters-nodejs/tags b/t/tests/scripts-interpreters-nodejs/tags
index 4194649..6b34252 100644
--- a/t/tests/scripts-interpreters-nodejs/tags
+++ b/t/tests/scripts-interpreters-nodejs/tags
@@ -1,2 +1,3 @@
 E: scripts-interpreters-nodejs: missing-dep-for-interpreter node => nodejs (usr/bin/usr-bin-env-node)
 E: scripts-interpreters-nodejs: missing-dep-for-interpreter nodejs => nodejs (usr/bin/usr-bin-env-nodejs)
+W: scripts-interpreters-nodejs: script-uses-deprecated-nodejs-location usr/bin/usr-bin-env-nodejs

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


Reply to: