Commit b74fdf44 authored by Michael Albinus's avatar Michael Albinus

Add new Tramp connection method "owncloud"

* doc/misc/tramp.texi (all): Use @acronym{GNOME} thoroughly.
(Using GNOME Online Accounts based methods): Rename from
"Using Google Drive".  Add `owncloud'.
(GVFS based methods): Add `owncloud'.

* etc/NEWS: Add Tramp connection method "owncloud".

* lisp/net/tramp-gvfs.el (tramp-gvfs-methods): Add "owncloud".
Remove goa methods if not supported.
(tramp-goa-methods, tramp-goa-service, tramp-goa-path)
(tramp-goa-path-accounts, tramp-goa-interface-documents)
(tramp-goa-interface-printers, tramp-goa-interface-files)
(tramp-goa-interface-contacts, tramp-goa-interface-calendar)
(tramp-goa-interface-oauth2based)
(tramp-goa-interface-account, tramp-goa-identity-regexp)
(tramp-goa-interface-mail, tramp-goa-interface-chat)
(tramp-goa-interface-photos, tramp-goa-path-manager)
(tramp-goa-interface-documents)
(tramp-gvfs-owncloud-default-prefix)
(tramp-gvfs-owncloud-default-prefix-regexp): New defconst.
(tramp-goa-name): New defstruct.
(tramp-gvfs-stringify-dbus-message): Handle all consp messages.
(tramp-dbus-function, tramp-gvfs-get-remote-prefix)
(tramp-get-goa-accounts): New defun.
(with-tramp-dbus-call-method): Use it.
(with-tramp-dbus-get-all-properties): New defmacro.
(tramp-gvfs-url-file-name)
(tramp-gvfs-handler-mounted-unmounted)
(tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec):
Map between "owncloud" and "davs".
(tramp-gvfs-maybe-open-connection): Set "vector" connection property.

* test/lisp/net/tramp-tests.el (tramp-gvfs-handler-askquestion):
Suppress run in tests.
(tramp--test-owncloud-p): New defun.
(tramp-test11-copy-file, tramp-test12-rename-file): Use it.
parent 933d8fc0
......@@ -531,24 +531,33 @@ of the local file name is the share exported by the remote host,
@cindex dav method
@cindex davs method
On systems, which have installed the virtual file system for the Gnome
Desktop (GVFS), its offered methods could be used by @value{tramp}.
Examples are @file{@trampfn{sftp,user@@host,/path/to/file}},
On systems, which have installed the virtual file system for the
@acronym{GNOME} Desktop (GVFS), its offered methods could be used by
@value{tramp}. Examples are
@file{@trampfn{sftp,user@@host,/path/to/file}},
@file{@trampfn{afp,user@@host,/path/to/file}} (accessing Apple's AFP
file system), @file{@trampfn{dav,user@@host,/path/to/file}} and
@file{@trampfn{davs,user@@host,/path/to/file}} (for WebDAV shares).
@anchor{Quick Start Guide: Google Drive}
@section Using Google Drive
@anchor{Quick Start Guide: GNOME Online Accounts based methods}
@section Using @acronym{GNOME} Online Accounts based methods
@cindex @acronym{GNOME} Online Accounts
@cindex method gdrive
@cindex gdrive method
@cindex google drive
@cindex method owncloud
@cindex owncloud method
@cindex nextcloud
Another GVFS-based method allows to access a Google Drive file system.
The file name syntax is here always
@file{@trampfn{gdrive,john.doe@@gmail.com,/path/to/file}}.
@samp{john.doe@@gmail.com} stands here for your Google Drive account.
GVFS-based methods include also @acronym{GNOME} Online Accounts, which
support the @option{Files} service. These are the Google Drive file
system, and the OwnCloud/NextCloud file system. The file name syntax
is here always
@file{@trampfn{gdrive,john.doe@@gmail.com,/path/to/file}}
(@samp{john.doe@@gmail.com} stands here for your Google Drive
account), or @file{@trampfn{owncloud,user@@host#8081,/path/to/file}}
(@samp{8081} stands for the port number) for OwnCloud/NextCloud files.
@anchor{Quick Start Guide: Android}
......@@ -1061,7 +1070,7 @@ numbers are not applicable to Android devices connected through USB@.
@cindex gvfs based methods
@cindex dbus
GVFS is the virtual file system for the Gnome Desktop,
GVFS is the virtual file system for the @acronym{GNOME} Desktop,
@uref{https://en.wikipedia.org/wiki/GVFS}. Remote files on GVFS are
mounted locally through FUSE and @value{tramp} uses this locally
mounted directory internally.
......@@ -1114,6 +1123,18 @@ directory have the same @code{display-name}, such a situation must be avoided.
OBEX is an FTP-like access protocol for cell phones and similar simple
devices. @value{tramp} supports OBEX over Bluetooth.
@item @option{owncloud}
@cindex @acronym{GNOME} Online Accounts
@cindex method owncloud
@cindex owncloud method
@cindex nextcloud
As the name indicates, the method @option{owncloud} allows you to
access OwnCloud or NextCloud hosted files and directories. Like the
@option{gdrive} method, your credentials must be populated in your
@command{Online Accounts} application outside Emacs. The method
supports port numbers.
@item @option{sftp}
@cindex method sftp
@cindex sftp method
......@@ -1135,11 +1156,11 @@ requires the SYNCE-GVFS plugin.
@defopt tramp-gvfs-methods
This user option is a list of external methods for GVFS@. By default,
this list includes @option{afp}, @option{dav}, @option{davs},
@option{gdrive}, @option{obex}, @option{sftp} and @option{synce}.
Other methods to include are @option{ftp}, @option{http},
@option{https} and @option{smb}. These methods are not intended to be
used directly as GVFS based method. Instead, they are added here for
the benefit of @ref{Archive file names}.
@option{gdrive}, @option{obex}, @option{owncloud}, @option{sftp} and
@option{synce}. Other methods to include are @option{ftp},
@option{http}, @option{https} and @option{smb}. These methods are not
intended to be used directly as GVFS based method. Instead, they are
added here for the benefit of @ref{Archive file names}.
@end defopt
......@@ -2928,8 +2949,8 @@ that remote connection.
@value{tramp} offers also transparent access to files inside file
archives. This is possible only on machines which have installed the
virtual file system for the Gnome Desktop (GVFS), @ref{GVFS based
methods}. Internally, file archives are mounted via the GVFS
virtual file system for the @acronym{GNOME} Desktop (GVFS), @ref{GVFS
based methods}. Internally, file archives are mounted via the GVFS
@option{archive} method.
A file archive is a regular file of kind @file{/path/to/dir/file.EXT}.
......
......@@ -159,6 +159,12 @@ To restore the old behavior, use
(add-hook 'eshell-expand-input-functions
#'eshell-expand-history-references)
** Tramp
+++
*** New connection method "owncloud", which allows to access OwnCloud
or NextCloud hosted files and directories.
* New Modes and Packages in Emacs 27.1
......
......@@ -114,8 +114,7 @@ Returns DEFAULT if not set."
(tramp-file-name-hop key) nil)
(let* ((hash (tramp-get-hash-table key))
(value (when (hash-table-p hash) (gethash property hash))))
(if
;; We take the value only if there is any, and
(if ;; We take the value only if there is any, and
;; `remote-file-name-inhibit-cache' indicates that it is still
;; valid. Otherwise, DEFAULT is set.
(and (consp value)
......
This diff is collapsed.
......@@ -58,8 +58,15 @@
(defvar tramp-copy-size-limit)
(defvar tramp-persistency-file-name)
(defvar tramp-remote-process-environment)
;; Suppress nasty messages.
(fset 'shell-command-sentinel 'ignore)
;; Beautify batch mode.
(when noninteractive
;; Suppress nasty messages.
(fset 'shell-command-sentinel 'ignore)
;; We do not want to be interrupted.
(eval-after-load 'tramp-gvfs
'(fset 'tramp-gvfs-handler-askquestion
(lambda (_message _choices) '(t nil 0)))))
;; There is no default value on w32 systems, which could work out of the box.
(defconst tramp-test-temporary-file-directory
......@@ -1941,7 +1948,9 @@ This checks also `file-name-as-directory', `file-name-directory',
;; Copy file to directory.
(unwind-protect
(progn
;; FIXME: This fails on my QNAP server, see
;; /share/Web/owncloud/data/owncloud.log
(unless (tramp--test-owncloud-p)
(write-region "foo" nil source)
(should (file-exists-p source))
(make-directory target)
......@@ -1962,7 +1971,11 @@ This checks also `file-name-as-directory', `file-name-directory',
;; Copy directory to existing directory.
(unwind-protect
(progn
;; FIXME: This fails on my QNAP server, see
;; /share/Web/owncloud/data/owncloud.log
(unless (and (tramp--test-owncloud-p)
(or (not (file-remote-p source))
(not (file-remote-p target))))
(make-directory source)
(should (file-directory-p source))
(write-region "foo" nil (expand-file-name "foo" source))
......@@ -1983,7 +1996,10 @@ This checks also `file-name-as-directory', `file-name-directory',
;; Copy directory/file to non-existing directory.
(unwind-protect
(progn
;; FIXME: This fails on my QNAP server, see
;; /share/Web/owncloud/data/owncloud.log
(unless
(and (tramp--test-owncloud-p) (not (file-remote-p source)))
(make-directory source)
(should (file-directory-p source))
(write-region "foo" nil (expand-file-name "foo" source))
......@@ -2069,7 +2085,9 @@ This checks also `file-name-as-directory', `file-name-directory',
;; Rename directory to existing directory.
(unwind-protect
(progn
;; FIXME: This fails on my QNAP server, see
;; /share/Web/owncloud/data/owncloud.log
(unless (tramp--test-owncloud-p)
(make-directory source)
(should (file-directory-p source))
(write-region "foo" nil (expand-file-name "foo" source))
......@@ -2091,7 +2109,9 @@ This checks also `file-name-as-directory', `file-name-directory',
;; Rename directory/file to non-existing directory.
(unwind-protect
(progn
;; FIXME: This fails on my QNAP server, see
;; /share/Web/owncloud/data/owncloud.log
(unless (tramp--test-owncloud-p)
(make-directory source)
(should (file-directory-p source))
(write-region "foo" nil (expand-file-name "foo" source))
......@@ -4079,6 +4099,11 @@ This does not support external Emacs calls."
(string-equal
"mock" (file-remote-p tramp-test-temporary-file-directory 'method)))
(defun tramp--test-owncloud-p ()
"Check, whether the owncloud method is used."
(string-equal
"owncloud" (file-remote-p tramp-test-temporary-file-directory 'method)))
(defun tramp--test-rsync-p ()
"Check, whether the rsync method is used.
This does not support special file names."
......@@ -4830,6 +4855,8 @@ Since it unloads Tramp, it shall be the last test to run."
;; * Work on skipped tests. Make a comment, when it is impossible.
;; * Fix `tramp-test05-expand-file-name-relative' in `expand-file-name'.
;; * Fix `tramp-test06-directory-file-name' for `ftp'.
;; * Investigate, why `tramp-test11-copy-file' and `tramp-test12-rename-file'
;; do not work properly for `owncloud'.
;; * Fix `tramp-test29-start-file-process' on MS Windows (`process-send-eof'?).
;; * Fix `tramp-test30-interrupt-process', timeout doesn't work reliably.
;; * Fix Bug#16928 in `tramp-test41-asynchronous-requests'.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment