emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r111436: * net/tramp-adb.el (tramp-do


From: Michael Albinus
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r111436: * net/tramp-adb.el (tramp-do-parse-file-attributes-with-ls):
Date: Mon, 07 Jan 2013 20:44:48 +0100
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111436
author: Jürgen Hötzel <address@hidden>
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Mon 2013-01-07 20:44:48 +0100
message:
  * 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.
modified:
  lisp/ChangeLog
  lisp/net/tramp-adb.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-01-07 18:03:01 +0000
+++ b/lisp/ChangeLog    2013-01-07 19:44:48 +0000
@@ -1,3 +1,10 @@
+2013-01-07  Jürgen Hötzel  <address@hidden>
+
+       * 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  <address@hidden>
 
        * emacs-lisp/advice.el (ad-activate-advised-definition): Refresh the

=== modified file 'lisp/net/tramp-adb.el'
--- a/lisp/net/tramp-adb.el     2013-01-07 09:25:34 +0000
+++ b/lisp/net/tramp-adb.el     2013-01-07 19:44:48 +0000
@@ -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 @@
                (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 @@
      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)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]