mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-24 14:30:43 -08:00
* lisp/net/tramp-sh.el (tramp-get-remote-touch): Simplify.
This commit is contained in:
parent
6a018a2d7e
commit
964741d40e
1 changed files with 10 additions and 13 deletions
|
|
@ -5880,12 +5880,12 @@ Nonexistent directories are removed from spec."
|
|||
"Determine remote `touch' command."
|
||||
(with-tramp-connection-property vec "touch"
|
||||
(tramp-message vec 5 "Finding a suitable `touch' command")
|
||||
(let ((result (tramp-find-executable
|
||||
vec "touch" (tramp-get-remote-path vec)))
|
||||
(tmpfile (tramp-make-tramp-temp-name vec)))
|
||||
;; Busyboxes do support the "-t" option only when they have been
|
||||
;; built with the DESKTOP config option. Let's check it.
|
||||
(when result
|
||||
(when-let* ((result (tramp-find-executable
|
||||
vec "touch" (tramp-get-remote-path vec)))
|
||||
(tmpfile (tramp-make-tramp-temp-name vec)))
|
||||
(prog1 result
|
||||
;; Busyboxes do support the "-t" option only when they have
|
||||
;; been built with the DESKTOP config option. Let's check it.
|
||||
(tramp-set-connection-property
|
||||
vec "touch-t"
|
||||
(tramp-send-command-and-check
|
||||
|
|
@ -5895,16 +5895,13 @@ Nonexistent directories are removed from spec."
|
|||
result
|
||||
(format-time-string "%Y%m%d%H%M.%S")
|
||||
(tramp-file-local-name tmpfile))))
|
||||
;; The touch command included in busybox (version 1.30.1-6) on
|
||||
;; OpenWrt does not have the option "-h".
|
||||
(tramp-set-connection-property
|
||||
vec "touch-h"
|
||||
(tramp-send-command-and-check
|
||||
vec
|
||||
(format
|
||||
"%s -h %s"
|
||||
result
|
||||
(tramp-file-local-name tmpfile))))
|
||||
(delete-file tmpfile))
|
||||
result)))
|
||||
vec (format "%s -h %s" result (tramp-file-local-name tmpfile))))
|
||||
(delete-file tmpfile)))))
|
||||
|
||||
(defun tramp-get-remote-df (vec)
|
||||
"Determine remote `df' command."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue