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

[lintian] 01/01: Include the offending/unknown shebang in the output of various interpreter-related tags. (Closes: #673734)



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

lamby pushed a commit to branch master
in repository lintian.

commit c8f4bc3655dcc30e4e4279225addc4988ab66ae4
Author: Chris Lamb <lamby@debian.org>
Date:   Sat Dec 30 08:53:03 2017 +0000

    Include the offending/unknown shebang in the output of various interpreter-related tags. (Closes: #673734)
---
 checks/scripts.pm                        | 12 +++++++-----
 debian/changelog                         |  3 +++
 t/tests/legacy-scripts/tags              | 16 ++++++++--------
 t/tests/scripts-interpreters-nodejs/tags |  4 ++--
 t/tests/scripts-interpreters/tags        |  4 ++--
 t/tests/scripts-missing-dep/tags         | 10 +++++-----
 6 files changed, 27 insertions(+), 22 deletions(-)

diff --git a/checks/scripts.pm b/checks/scripts.pm
index 57af865..af08ad1 100644
--- a/checks/scripts.pm
+++ b/checks/scripts.pm
@@ -455,9 +455,11 @@ sub run {
             }
             if ($depends && !$all_parsed->implies($depends)) {
                 if ($base =~ /^php/) {
-                    tag 'php-script-but-no-php-cli-dep', $filename;
+                    tag 'php-script-but-no-php-cli-dep', $filename,
+                      "#!$interpreter";
                 } elsif ($base =~ /^(python|ruby|[mg]awk)$/) {
-                    tag("$base-script-but-no-$base-dep", $filename);
+                    tag("$base-script-but-no-$base-dep",
+                        $filename, "#!$interpreter");
                 } elsif ($base eq 'csh' && $filename =~ m,^etc/csh/login\.d/,){
                     # Initialization files for csh.
                 } elsif ($base eq 'fish' && $filename =~ m,^etc/fish\.d/,) {
@@ -473,7 +475,7 @@ sub run {
                     # ABI-versioned virtual packages for erlang
                 } else {
                     tag 'missing-dep-for-interpreter', "$base => $depends",
-                      "($filename)";
+                      "($filename)", "#!$interpreter";
                 }
             }
         } elsif ($VERSIONED_INTERPRETERS->known($base)) {
@@ -490,7 +492,7 @@ sub run {
                     tag "$1-script-but-no-$1-dep", $filename;
                 } else {
                     tag 'missing-dep-for-interpreter', "$base => $depends",
-                      "($filename)";
+                      "($filename)", "#!$interpreter";
                 }
             }
         } else {
@@ -502,7 +504,7 @@ sub run {
                     tag "$1-script-but-no-$1-dep", $filename;
                 } else {
                     tag 'missing-dep-for-interpreter', "$base => $depends",
-                      "($filename)";
+                      "($filename)", "#!$interpreter";
                 }
             }
         }
diff --git a/debian/changelog b/debian/changelog
index 6dd3d68..c04bab5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -30,6 +30,9 @@ lintian (2.5.67) UNRELEASED; urgency=medium
       that use DH_EXTRA_ADDONS. Thanks!  (Closes: #885790)
     + [CL] Update $PYTHON3X_DEPEND to prevent false positives in
       missing-python-build-dependency.  (Closes: #750537)
+  * checks/scripts.pm:
+    + [CL] Include the offending/unknown shebang in the output of various
+      interpreter-relateed tags.  (Closes: #673734)
   * checks/source-copyright.desc:
     + [CL] Also mention that we check for NOTICE.gz files when looking for
       Apache 2.0 packages that do not distribute their accompanying NOTICE
diff --git a/t/tests/legacy-scripts/tags b/t/tests/legacy-scripts/tags
index 1d334e6..7f849b7 100644
--- a/t/tests/legacy-scripts/tags
+++ b/t/tests/legacy-scripts/tags
@@ -11,16 +11,16 @@ E: scripts: init.d-script-does-not-implement-required-option etc/init.d/lsb-brok
 E: scripts: init.d-script-has-duplicate-lsb-section etc/init.d/lsb-broken
 E: scripts: init.d-script-has-unterminated-lsb-section etc/init.d/lsb-broken:15
 E: scripts: init.d-script-needs-depends-on-lsb-base etc/init.d/skeleton (line 35)
-E: scripts: missing-dep-for-interpreter jruby => jruby | jruby1.0 | jruby1.1 | jruby1.2 (usr/bin/jruby-broken)
-E: scripts: missing-dep-for-interpreter lefty => graphviz (usr/bin/lefty-foo)
-E: scripts: missing-dep-for-interpreter python2 => python:any | python-minimal:any (usr/bin/py2foo)
+E: scripts: missing-dep-for-interpreter jruby => jruby | jruby1.0 | jruby1.1 | jruby1.2 (usr/bin/jruby-broken) #!/usr/bin/jruby
+E: scripts: missing-dep-for-interpreter lefty => graphviz (usr/bin/lefty-foo) #!/usr/local/bin/lefty
+E: scripts: missing-dep-for-interpreter python2 => python:any | python-minimal:any (usr/bin/py2foo) #!python2
 E: scripts: package-installs-python-bytecode usr/lib/python2.3/site-packages/test.pyc
-E: scripts: php-script-but-no-php-cli-dep usr/share/scripts/php7.0envfoo
-E: scripts: php-script-but-no-php-cli-dep usr/share/scripts/php7.0foo
-E: scripts: php-script-but-no-php-cli-dep usr/share/scripts/phpenvfoo
-E: scripts: php-script-but-no-php-cli-dep usr/share/scripts/phpfoo
+E: scripts: php-script-but-no-php-cli-dep usr/share/scripts/php7.0envfoo #!php7.0
+E: scripts: php-script-but-no-php-cli-dep usr/share/scripts/php7.0foo #!/usr/bin/php7.0
+E: scripts: php-script-but-no-php-cli-dep usr/share/scripts/phpenvfoo #!php
+E: scripts: php-script-but-no-php-cli-dep usr/share/scripts/phpfoo #!/usr/bin/php
 E: scripts: python-script-but-no-python-dep usr/bin/py2.Xfoo
-E: scripts: python-script-but-no-python-dep usr/bin/pyfoo
+E: scripts: python-script-but-no-python-dep usr/bin/pyfoo #!python
 E: scripts: script-without-interpreter control/prerm
 E: scripts: shell-script-fails-syntax-check usr/bin/sh-broken
 E: scripts: wrong-path-for-interpreter usr/bin/lefty-foo (#!/usr/local/bin/lefty != /usr/bin/lefty)
diff --git a/t/tests/scripts-interpreters-nodejs/tags b/t/tests/scripts-interpreters-nodejs/tags
index bf9b84e..be6ee83 100644
--- a/t/tests/scripts-interpreters-nodejs/tags
+++ b/t/tests/scripts-interpreters-nodejs/tags
@@ -1,4 +1,4 @@
-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)
+E: scripts-interpreters-nodejs: missing-dep-for-interpreter node => nodejs (usr/bin/usr-bin-env-node) #!node
+E: scripts-interpreters-nodejs: missing-dep-for-interpreter nodejs => nodejs (usr/bin/usr-bin-env-nodejs) #!nodejs
 W: scripts-interpreters-nodejs: example-script-uses-deprecated-nodejs-location usr/share/doc/scripts-interpreters-nodejs/examples/usr-bin-env-nodejs
 W: scripts-interpreters-nodejs: script-uses-deprecated-nodejs-location usr/bin/usr-bin-env-nodejs
diff --git a/t/tests/scripts-interpreters/tags b/t/tests/scripts-interpreters/tags
index 1bdb263..342aad2 100644
--- a/t/tests/scripts-interpreters/tags
+++ b/t/tests/scripts-interpreters/tags
@@ -1,6 +1,6 @@
 E: scripts-interpreters: interpreter-in-usr-local usr/bin/usr-local #!/usr/local/bin/special-perl
-E: scripts-interpreters: missing-dep-for-interpreter pike => pike7.6 | pike7.6-core | pike7.8 | pike7.8-core (usr/bin/unversioned-pike)
-E: scripts-interpreters: missing-dep-for-interpreter pike7.6 => pike7.6 | pike7.6-core (usr/bin/versioned-pike)
+E: scripts-interpreters: missing-dep-for-interpreter pike => pike7.6 | pike7.6-core | pike7.8 | pike7.8-core (usr/bin/unversioned-pike) #!/usr/bin/pike
+E: scripts-interpreters: missing-dep-for-interpreter pike7.6 => pike7.6 | pike7.6-core (usr/bin/versioned-pike) #!/usr/bin/pike7.6
 E: scripts-interpreters: script-without-interpreter usr/bin/no-interpreter
 E: scripts-interpreters: shell-script-fails-syntax-check usr/bin/syntax
 E: scripts-interpreters: wrong-path-for-interpreter usr/bin/not-absolute (#!perl != /usr/bin/perl)
diff --git a/t/tests/scripts-missing-dep/tags b/t/tests/scripts-missing-dep/tags
index 6b9773a..30e7081 100644
--- a/t/tests/scripts-missing-dep/tags
+++ b/t/tests/scripts-missing-dep/tags
@@ -1,8 +1,8 @@
-E: scripts-missing-dep: gawk-script-but-no-gawk-dep usr/bin/gawk-script
-E: scripts-missing-dep: mawk-script-but-no-mawk-dep usr/bin/mawk-script
-E: scripts-missing-dep: php-script-but-no-php-cli-dep usr/bin/php-script
-E: scripts-missing-dep: python-script-but-no-python-dep usr/bin/python-script
-E: scripts-missing-dep: ruby-script-but-no-ruby-dep usr/bin/ruby-script
+E: scripts-missing-dep: gawk-script-but-no-gawk-dep usr/bin/gawk-script #!/usr/bin/gawk
+E: scripts-missing-dep: mawk-script-but-no-mawk-dep usr/bin/mawk-script #!/usr/bin/mawk
+E: scripts-missing-dep: php-script-but-no-php-cli-dep usr/bin/php-script #!/usr/bin/php
+E: scripts-missing-dep: python-script-but-no-python-dep usr/bin/python-script #!/usr/bin/python
+E: scripts-missing-dep: ruby-script-but-no-ruby-dep usr/bin/ruby-script #!/usr/bin/ruby
 E: scripts-missing-dep: tclsh-script-but-no-tclsh-dep usr/bin/tclsh-script
 E: scripts-missing-dep: wish-script-but-no-wish-dep usr/bin/wish-script
 W: scripts-missing-dep: maintainer-script-needs-depends-on-adduser postinst

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


Reply to: