]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix google-drive handling in tramp-gvfs
authorMichael Albinus <michael.albinus@gmx.de>
Sat, 12 Oct 2019 10:20:30 +0000 (12:20 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Sat, 12 Oct 2019 10:20:30 +0000 (12:20 +0200)
* lisp/net/tramp-gvfs.el (tramp-gvfs-file-attributes):
Add "standard::is-volatile".
(tramp-gvfs-get-directory-attributes)
(tramp-gvfs-handle-file-attributes): Handle "gdrive" special.
(tramp-gvfs-send-command): Ignore nil arguments.

lisp/net/tramp-gvfs.el

index 1036865e4ec7959819be373982c01226b16f7f34..4843c63cb87fc47cf05e42235a38a476d22488dd 100644 (file)
@@ -481,6 +481,7 @@ It has been changed in GVFS 1.14.")
     "type"
     "standard::display-name"
     "standard::symlink-target"
+    "standard::is-volatile"
     "unix::nlink"
     "unix::uid"
     "owner::user"
@@ -937,8 +938,9 @@ file names."
        (tramp-message v 5 "directory gvfs attributes: %s" localname)
        ;; Send command.
        (tramp-gvfs-send-command
-        v "gvfs-ls" "-h" "-n" "-a"
-        (string-join tramp-gvfs-file-attributes ",")
+        v "gvfs-ls" "-h"
+        (unless (string-equal (file-remote-p directory 'method) "gdrive") "-n")
+        "-a" (string-join tramp-gvfs-file-attributes ",")
         (tramp-gvfs-url-file-name directory))
        ;; Parse output.
        (with-current-buffer (tramp-get-connection-buffer v)
@@ -1021,7 +1023,12 @@ If FILE-SYSTEM is non-nil, return file system attributes."
       ;; ... directory or symlink
       (setq dirp (if (equal "directory" (cdr (assoc "type" attributes))) t))
       (setq res-symlink-target
-           (cdr (assoc "standard::symlink-target" attributes)))
+           ;; Google-drive creates file blobs and links to them.  We
+           ;; don't want to see them.
+           (and
+            (not
+             (equal (cdr (assoc "standard::is-volatile" attributes)) "TRUE"))
+            (cdr (assoc "standard::symlink-target" attributes))))
       (when (stringp res-symlink-target)
        (setq res-symlink-target
              ;; Parse unibyte codes "\xNN".  We assume they are
@@ -1941,7 +1948,8 @@ is applied, and it returns t if the return code is zero."
           process-environment)))
     (when (tramp-gvfs-gio-tool-p vec)
       ;; Use gio tool.
-      (setq args (cons (cdr (assoc command tramp-gvfs-gio-mapping)) args)
+      (setq args (cons (cdr (assoc command tramp-gvfs-gio-mapping))
+                      (delq nil args))
            command "gio"))
 
     (with-current-buffer (tramp-get-connection-buffer vec)