From: Michael Albinus Date: Fri, 26 Aug 2016 13:12:42 +0000 (+0200) Subject: * lisp/net/tramp-sh.el (tramp-get-remote-perl): Perform a basic check. X-Git-Tag: emacs-26.0.90~1692 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4a46232d92e7af257e1bccf2958e3362daa976dc;p=emacs.git * lisp/net/tramp-sh.el (tramp-get-remote-perl): Perform a basic check. (Bug#22478) --- diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index bbc74fcad99..9afa85e8ceb 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -5368,16 +5368,20 @@ Nonexistent directories are removed from spec." (tramp-message vec 5 "Finding a suitable `perl' command") (let ((result (or (tramp-find-executable vec "perl5" (tramp-get-remote-path vec)) - (tramp-find-executable - vec "perl" (tramp-get-remote-path vec))))) + (tramp-find-executable vec "perl" (tramp-get-remote-path vec))))) + ;; Perform a basic check. + (and result + (null (tramp-send-command-and-check + vec (format "%s -e 'print \"Hello\n\";'" result))) + (setq result nil)) ;; We must check also for some Perl modules. (when result (with-tramp-connection-property vec "perl-file-spec" - (tramp-send-command-and-check - vec (format "%s -e 'use File::Spec;'" result))) + (tramp-send-command-and-check + vec (format "%s -e 'use File::Spec;'" result))) (with-tramp-connection-property vec "perl-cwd-realpath" - (tramp-send-command-and-check - vec (format "%s -e 'use Cwd \"realpath\";'" result)))) + (tramp-send-command-and-check + vec (format "%s -e 'use Cwd \"realpath\";'" result)))) result))) (defun tramp-get-remote-stat (vec)