diff options
author | Jürgen Hötzel <[email protected]> | 2013-01-07 20:44:48 +0100 |
---|---|---|
committer | Michael Albinus <[email protected]> | 2013-01-07 20:44:48 +0100 |
commit | 62bcf6709991d2c5dda92dc931e308f7e040c123 (patch) | |
tree | 23a6aa72e46ee963fd227b9ac7d02d82b52ad0a8 | |
parent | 4986fa2175ea41a0ddb051d464293266b3bd7433 (diff) |
* net/tramp-adb.el (tramp-do-parse-file-attributes-with-ls):
Handle filename correctly, when parsing "source -> target" symlink
output.
(tramp-adb-handle-set-file-times): New defun.
-rw-r--r-- | lisp/ChangeLog | 7 | ||||
-rw-r--r-- | lisp/net/tramp-adb.el | 19 |
2 files changed, 24 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5b890a7e0e..ac7401aba5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2013-01-07 Jürgen Hötzel <[email protected]> + + * net/tramp-adb.el (tramp-do-parse-file-attributes-with-ls): + Handle filename correctly, when parsing "source -> target" symlink + output. + (tramp-adb-handle-set-file-times): New defun. + 2013-01-07 Stefan Monnier <[email protected]> * emacs-lisp/advice.el (ad-activate-advised-definition): Refresh the diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index c6aec52bd0..f5aadd591d 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -123,7 +123,7 @@ (vc-registered . ignore) ;no vc control files on Android devices (write-region . tramp-adb-handle-write-region) (set-file-modes . tramp-adb-handle-set-file-modes) - (set-file-times . ignore) + (set-file-times . tramp-adb-handle-set-file-times) (copy-file . tramp-adb-handle-copy-file) (rename-file . tramp-adb-handle-rename-file) (process-file . tramp-adb-handle-process-file) @@ -311,7 +311,9 @@ pass to the OPERATION." (and is-symlink (cadr (split-string name "\\( -> \\|\n\\)"))))) (push (list - name + (if is-symlink + (car (split-string name "\\( -> \\|\n\\)")) + name) (or is-dir symlink-target) 1 ;link-count ;; no way to handle numeric ids in Androids ash @@ -615,6 +617,19 @@ But handle the case, if the \"test\" command is not available." v (format "chmod %s %s" (tramp-compat-decimal-to-octal mode) localname) "Error while changing file's mode %s" filename))) +(defun tramp-adb-handle-set-file-times (filename &optional time) + "Like `set-file-times' for Tramp files." + (with-parsed-tramp-file-name filename nil + (tramp-flush-file-property v localname) + (let ((time (if (or (null time) (equal time '(0 0))) + (current-time) + time))) + (tramp-adb-command-exit-status + ;; use shell arithmetic because of Emacs integer size limit + v (format "touch -t $(( %d * 65536 + %d )) %s" + (car time) (cadr time) + (tramp-shell-quote-argument localname)))))) + (defun tramp-adb-handle-copy-file (filename newname &optional ok-if-already-exists keep-date preserve-uid-gid preserve-extended-attributes) |