]> git.eshelyaron.com Git - emacs.git/commitdiff
* net/tramp-adb.el (tramp-do-parse-file-attributes-with-ls):
authorJürgen Hötzel <juergen@archlinux.org>
Mon, 7 Jan 2013 19:44:48 +0000 (20:44 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Mon, 7 Jan 2013 19:44:48 +0000 (20:44 +0100)
Handle filename correctly, when parsing "source -> target" symlink
output.
(tramp-adb-handle-set-file-times): New defun.

lisp/ChangeLog
lisp/net/tramp-adb.el

index 5b890a7e0ed6cb3a22a078b3a12bf6d381e9fd3b..ac7401aba563b0284cce91b31eafefa8395a633f 100644 (file)
@@ -1,3 +1,10 @@
+2013-01-07  Jürgen Hötzel  <juergen@archlinux.org>
+
+       * 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  <monnier@iro.umontreal.ca>
 
        * emacs-lisp/advice.el (ad-activate-advised-definition): Refresh the
index c6aec52bd0745f7acf0deb57dabfd1b670cd2992..f5aadd591d66b2a65ee1e39c0d3b47c95b40b183 100644 (file)
     (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)