(read (current-buffer)))
":" 'omit)))
;; The equivalent to `exec-directory'.
- `(,(file-local-name default-directory))))
+ `(,(file-remote-p default-directory 'localname))))
(defun tramp-adb-get-device (vec)
"Return full host name from VEC to be used in shell execution.
(append
(tramp-get-remote-path (tramp-dissect-file-name default-directory))
;; The equivalent to `exec-directory'.
- `(,(file-local-name default-directory))))
+ `(,(file-remote-p default-directory 'localname))))
(defun tramp-sh-handle-file-local-copy (filename)
"Like `file-local-copy' for Tramp files."
(defun tramp-get-ls-command-with (vec option)
"Return OPTION, if the remote `ls' command supports the OPTION option."
- (save-match-data
- (with-tramp-connection-property vec (concat "ls" option)
- (tramp-message vec 5 "Checking, whether `ls %s' works" option)
- ;; Some "ls" versions are sensible wrt the order of arguments,
- ;; they fail when "-al" is after the "--dired" argument (for
- ;; example on FreeBSD).
- (and
- (tramp-send-command-and-check
- vec (format "%s %s -al /dev/null" (tramp-get-ls-command vec) option))
- option))))
+ (with-tramp-connection-property vec (concat "ls" option)
+ (tramp-message vec 5 "Checking, whether `ls %s' works" option)
+ ;; Some "ls" versions are sensible wrt the order of arguments,
+ ;; they fail when "-al" is after the "--dired" argument (for
+ ;; example on FreeBSD). Busybox does not support this kind of
+ ;; options.
+ (and
+ (not
+ (tramp-send-command-and-check
+ vec
+ (format
+ "%s ls --help 2>&1 | grep -iq busybox" (tramp-get-ls-command vec))))
+ (tramp-send-command-and-check
+ vec (format "%s %s -al /dev/null" (tramp-get-ls-command vec) option))
+ option)))
(defun tramp-get-test-command (vec)
"Determine remote `test' command."
(put 'explicit-shell-file-name 'permanent-local nil)
(kill-buffer "*shell*"))))
-;; The function was introduced in Emacs 27.1.
+;; `exec-path' was introduced in Emacs 27.1. `executable-find' has
+;; changed the number of parameters, so we use `apply' for older
+;; Emacsen.
(ert-deftest tramp-test34-exec-path ()
"Check `exec-path' and `executable-find'."
(skip-unless (tramp--test-enabled))
(skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p)))
;; Since Emacs 27.1.
- (skip-unless (boundp 'exec-path))
+ (skip-unless (fboundp 'exec-path))
(let ((tmp-name (tramp--test-make-temp-name))
(default-directory tramp-test-temporary-file-directory))
(should
(string-equal
(car (last (with-no-warnings (exec-path))))
- (file-local-name default-directory)))
+ (file-remote-p default-directory 'localname)))
;; The shell "sh" shall always exist.
- (should (executable-find "sh" 'remote))
+ (should (apply 'executable-find '("sh" remote)))
;; Since the last element in `exec-path' is the current
;; directory, an executable file in that directory will be
;; found.
(should (file-executable-p tmp-name))
(should
(string-equal
- (executable-find (file-name-nondirectory tmp-name) 'remote)
- (file-local-name tmp-name)))
+ (apply
+ 'executable-find `(,(file-name-nondirectory tmp-name) remote))
+ (file-remote-p tmp-name 'localname)))
(should-not
- (executable-find
- (concat (file-name-nondirectory tmp-name) "foo") 'remote)))
+ (apply
+ 'executable-find
+ `(,(concat (file-name-nondirectory tmp-name) "foo") remote))))
;; Cleanup.
(ignore-errors (delete-file tmp-name)))))