From: Michael Albinus Date: Sat, 12 Oct 2019 10:20:30 +0000 (+0200) Subject: Fix google-drive handling in tramp-gvfs X-Git-Tag: emacs-27.0.90~1134 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=251c215f65d8af010b1b73d171edac179e3b5da5;p=emacs.git Fix google-drive handling in tramp-gvfs * 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. --- diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 1036865e4ec..4843c63cb87 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -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)