diff options
| author | Jürgen Hötzel | 2013-01-07 20:44:48 +0100 |
|---|---|---|
| committer | Michael Albinus | 2013-01-07 20:44:48 +0100 |
| commit | 62bcf6709991d2c5dda92dc931e308f7e040c123 (patch) | |
| tree | 23a6aa72e46ee963fd227b9ac7d02d82b52ad0a8 | |
| parent | 4986fa2175ea41a0ddb051d464293266b3bd7433 (diff) | |
| download | emacs-62bcf6709991d2c5dda92dc931e308f7e040c123.tar.gz emacs-62bcf6709991d2c5dda92dc931e308f7e040c123.zip | |
* 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 5b890a7e0ed..ac7401aba56 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2013-01-07 Jürgen Hötzel <juergen@archlinux.org> | ||
| 2 | |||
| 3 | * net/tramp-adb.el (tramp-do-parse-file-attributes-with-ls): | ||
| 4 | Handle filename correctly, when parsing "source -> target" symlink | ||
| 5 | output. | ||
| 6 | (tramp-adb-handle-set-file-times): New defun. | ||
| 7 | |||
| 1 | 2013-01-07 Stefan Monnier <monnier@iro.umontreal.ca> | 8 | 2013-01-07 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 9 | ||
| 3 | * emacs-lisp/advice.el (ad-activate-advised-definition): Refresh the | 10 | * 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 c6aec52bd07..f5aadd591d6 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el | |||
| @@ -123,7 +123,7 @@ | |||
| 123 | (vc-registered . ignore) ;no vc control files on Android devices | 123 | (vc-registered . ignore) ;no vc control files on Android devices |
| 124 | (write-region . tramp-adb-handle-write-region) | 124 | (write-region . tramp-adb-handle-write-region) |
| 125 | (set-file-modes . tramp-adb-handle-set-file-modes) | 125 | (set-file-modes . tramp-adb-handle-set-file-modes) |
| 126 | (set-file-times . ignore) | 126 | (set-file-times . tramp-adb-handle-set-file-times) |
| 127 | (copy-file . tramp-adb-handle-copy-file) | 127 | (copy-file . tramp-adb-handle-copy-file) |
| 128 | (rename-file . tramp-adb-handle-rename-file) | 128 | (rename-file . tramp-adb-handle-rename-file) |
| 129 | (process-file . tramp-adb-handle-process-file) | 129 | (process-file . tramp-adb-handle-process-file) |
| @@ -311,7 +311,9 @@ pass to the OPERATION." | |||
| 311 | (and is-symlink | 311 | (and is-symlink |
| 312 | (cadr (split-string name "\\( -> \\|\n\\)"))))) | 312 | (cadr (split-string name "\\( -> \\|\n\\)"))))) |
| 313 | (push (list | 313 | (push (list |
| 314 | name | 314 | (if is-symlink |
| 315 | (car (split-string name "\\( -> \\|\n\\)")) | ||
| 316 | name) | ||
| 315 | (or is-dir symlink-target) | 317 | (or is-dir symlink-target) |
| 316 | 1 ;link-count | 318 | 1 ;link-count |
| 317 | ;; no way to handle numeric ids in Androids ash | 319 | ;; no way to handle numeric ids in Androids ash |
| @@ -615,6 +617,19 @@ But handle the case, if the \"test\" command is not available." | |||
| 615 | v (format "chmod %s %s" (tramp-compat-decimal-to-octal mode) localname) | 617 | v (format "chmod %s %s" (tramp-compat-decimal-to-octal mode) localname) |
| 616 | "Error while changing file's mode %s" filename))) | 618 | "Error while changing file's mode %s" filename))) |
| 617 | 619 | ||
| 620 | (defun tramp-adb-handle-set-file-times (filename &optional time) | ||
| 621 | "Like `set-file-times' for Tramp files." | ||
| 622 | (with-parsed-tramp-file-name filename nil | ||
| 623 | (tramp-flush-file-property v localname) | ||
| 624 | (let ((time (if (or (null time) (equal time '(0 0))) | ||
| 625 | (current-time) | ||
| 626 | time))) | ||
| 627 | (tramp-adb-command-exit-status | ||
| 628 | ;; use shell arithmetic because of Emacs integer size limit | ||
| 629 | v (format "touch -t $(( %d * 65536 + %d )) %s" | ||
| 630 | (car time) (cadr time) | ||
| 631 | (tramp-shell-quote-argument localname)))))) | ||
| 632 | |||
| 618 | (defun tramp-adb-handle-copy-file | 633 | (defun tramp-adb-handle-copy-file |
| 619 | (filename newname &optional ok-if-already-exists keep-date | 634 | (filename newname &optional ok-if-already-exists keep-date |
| 620 | preserve-uid-gid preserve-extended-attributes) | 635 | preserve-uid-gid preserve-extended-attributes) |