all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Sebastian Miele <iota@whxvd.name>
Cc: 64278@debbugs.gnu.org
Subject: bug#64278: 29.0.92; tramp-rclone.el seems to be in a defunct state
Date: Sun, 25 Jun 2023 14:55:59 +0200	[thread overview]
Message-ID: <87sfafu2e8.fsf@gmx.de> (raw)
In-Reply-To: <87leg8kxrx.fsf@whxvd.name> (Sebastian Miele's message of "Sun, 25 Jun 2023 05:16:32 +0200")

[-- Attachment #1: Type: text/plain, Size: 2476 bytes --]

Sebastian Miele <iota@whxvd.name> writes:

Hi Sebastian,

Thanks for the report.

I've never tried the memory type of rclone. I have two test entries in
~/.config/rclone/rclone.conf:

--8<---------------cut here---------------start------------->8---
[local_drive]
type = local
nounc = true

[gdrive]
type = drive
scope = drive
...
--8<---------------cut here---------------end--------------->8---

Both work, and they are tested regularly in my regression tests. So I
wouldn't say that tramp-rclone.el is in a defunct state.

> I am using the Tramp built into the most recent emacs-29 from the Emacs
> repository.  Steps to reproduce the first problem:
>
> Augment ~/.config/rclone/rclone.conf with:
>
>   [memory]
>   type = memory
>
> I tried to debug the issue for myself for a while.  The first issue I
> encountered, is that ‘tramp-rclone’ contains a call to
> ‘tramp-call-process’ with a DESTINATION of 0.  ‘tramp-call-process’
> contains
>
>   (tramp-get-buffer-string destination)
>
> which in that case yields an error.  I tried changing "destination" in
> that line into:
>
>   (unless (eq destination 0) destination)

Reproduced here. I've pushed a fix to the emacs-29 branch in git.

Furthermore, there is indeed a problem detecting a mount point for
rclone memory type. The appended patch should fix this.

However, calling "emacs /rclone:memory:" with the rclone.conf entry
given by you.conf results in in an empty directory. No file visible
there, even if I copy something.

I've tried the rclone memory type manually in a shell

--8<---------------cut here---------------start------------->8---
# mount -t fuse.rclone
local_drive:/ on /tmp/tramp.rclone.local_drive type fuse.rclone (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
memory: on /tmp/tramp.rclone.memory type fuse.rclone (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)

# ls -al /tmp/tramp.rclone.memory
total 0
drwxr-xr-x.  1 albinus albinus    0 Jun 25 14:49 .
drwxrwxrwt. 99 root    root    7800 Jun 25 14:49 ..

# rclone copyto ~/tmp memory:

# ls -al /tmp/tramp.rclone.memory
total 0
drwxr-xr-x.  1 albinus albinus    0 Jun 25 14:49 .
drwxrwxrwt. 99 root    root    7800 Jun 25 14:51 ..
--8<---------------cut here---------------end--------------->8---

So I'm a little bit undecided what the memory type of rclone is good
for, and how it works. Do I miss something?

Best regards, Michael.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1363 bytes --]

diff --git a/lisp/net/tramp-fuse.el b/lisp/net/tramp-fuse.el
index e1ad0c2e5d2..c10c715d70e 100644
--- a/lisp/net/tramp-fuse.el
+++ b/lisp/net/tramp-fuse.el
@@ -175,13 +175,24 @@ tramp-fuse-mounted-p
     (or (tramp-get-file-property vec "/" "mounted")
         (let* ((default-directory tramp-compat-temporary-file-directory)
                (command (format "mount -t fuse.%s" (tramp-file-name-method vec)))
-	       (mount (shell-command-to-string command)))
+	       (mount (shell-command-to-string command))
+	       (mount-spec (split-string (tramp-fuse-mount-spec vec) ":" 'omit)))
           (tramp-message vec 6 "%s\n%s" command mount)
+	  ;; The mount-spec contains a trailing local file name part,
+	  ;; which might not be visible, for example with rclone
+	  ;; mounts of type "memory" or "gdrive".  Make it optional.
+	  (setq mount-spec
+		(if (cdr mount-spec)
+		    (tramp-compat-rx
+		     (literal (car mount-spec))
+		     ":" (? (literal (cadr mount-spec))))
+		  (car mount-spec)))
           (tramp-set-file-property
 	   vec "/" "mounted"
            (when (string-match
 	          (tramp-compat-rx
-		   bol (group (literal (tramp-fuse-mount-spec vec))) blank)
+		   bol (group (regexp mount-spec))
+		   " on " (group (+ (not blank))) blank)
 	          mount)
              (match-string 1 mount)))))))


  parent reply	other threads:[~2023-06-25 12:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-25  3:16 bug#64278: 29.0.92; tramp-rclone.el seems to be in a defunct state Sebastian Miele
     [not found] ` <handler.64278.B.168766492610826.ack@debbugs.gnu.org>
2023-06-25  4:13   ` bug#64278: Acknowledgement (29.0.92; tramp-rclone.el seems to be in a defunct state) Sebastian Miele
2023-06-25 12:55 ` Michael Albinus [this message]
2023-06-25 17:45   ` bug#64278: 29.0.92; tramp-rclone.el seems to be in a defunct state Sebastian Miele
2023-06-26 13:55     ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sfafu2e8.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=64278@debbugs.gnu.org \
    --cc=iota@whxvd.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.