summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2016-08-26 15:12:42 +0200
committerMichael Albinus <michael.albinus@gmx.de>2016-08-26 15:12:42 +0200
commit4a46232d92e7af257e1bccf2958e3362daa976dc (patch)
tree6bee36659f1ed45702c2b4d146af8cf0949081ff
parentb39c0b31f0328da8b1a87226d5cfd7d46af62c0f (diff)
* lisp/net/tramp-sh.el (tramp-get-remote-perl): Perform a basic check.
(Bug#22478)
-rw-r--r--lisp/net/tramp-sh.el16
1 files changed, 10 insertions, 6 deletions
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index bbc74fcad9..9afa85e8ce 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)