all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Sean Devlin <spd@toadstyle.org>
Cc: 68805@debbugs.gnu.org
Subject: bug#68805: 29.2; Tramp: out-of-band copy-file fails when tramp-copy-keep-date is nil
Date: Thu, 01 Feb 2024 14:29:12 +0100	[thread overview]
Message-ID: <87frycgvo7.fsf@gmx.de> (raw)
In-Reply-To: <59B29F53-DEE4-4DDD-BC68-8BB16652633E@toadstyle.org> (Sean Devlin's message of "Mon, 29 Jan 2024 17:26:41 -0500")

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

Sean Devlin <spd@toadstyle.org> writes:

> Hi folks,

Hi Sean,

> I think the issue is due to caching. Before copying, Tramp checks to see
> if the file exists, and it does not. After the transfer, Tramp tries to
> check again because the keep-date argument was set, tramp-copy-keep-date
> is nil or unset, and Tramp wants to set the file time manually. Instead
> of actually doing this file existence check, Tramp instead gets the
> property from cache that was set just prior to the file transfer. It
> then raises a file-missing error.

Thanks for the report and the analysis. It is correct. Could you please
check, whether this patch fixes it:


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

diff --git a/lisp/tramp-sh.el b/lisp/tramp-sh.el
index 1301cd63..50a33cc3 100644
--- a/lisp/tramp-sh.el
+++ b/lisp/tramp-sh.el
@@ -2521,6 +2521,10 @@ The method used must be an out-of-band method."
 	    ;; cached password).
 	    (tramp-cleanup-connection v 'keep-debug 'keep-password))))

+      ;; The cached file properties might be wrong if NEWNAME didn't
+      ;; exist.  Flush them.
+      (tramp-flush-file-properties v (tramp-file-local-name newname))
+
       ;; Handle KEEP-DATE argument.
       (when (and keep-date (not copy-keep-date))
 	(tramp-compat-set-file-times

[-- Attachment #3: Type: text/plain, Size: 44 bytes --]


> Thanks,
>
> Sean

Best regards, Michael.

  reply	other threads:[~2024-02-01 13:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-29 22:26 bug#68805: 29.2; Tramp: out-of-band copy-file fails when tramp-copy-keep-date is nil Sean Devlin
2024-02-01 13:29 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-02-01 13:49   ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-01 15:34     ` Sean Devlin
2024-02-01 16:32       ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-01 16:52         ` Sean Devlin

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=87frycgvo7.fsf@gmx.de \
    --to=bug-gnu-emacs@gnu.org \
    --cc=68805@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    --cc=spd@toadstyle.org \
    /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.