branch: externals/tramp commit 382733d64116368ad50e6fbdb848357e9ce1c72d Author: Michael Albinus <michael.albi...@gmx.de> Commit: Michael Albinus <michael.albi...@gmx.de>
Tramp ELPA version 2.6.1.2 released --- README | 6 +++--- test/tramp-tests.el | 1 + texi/trampver.texi | 2 +- tramp-adb.el | 2 ++ tramp-sh.el | 26 +++++++------------------- tramp-smb.el | 2 ++ tramp-sshfs.el | 4 +++- tramp.el | 36 ++++++++++++++++++++++++------------ trampver.el | 6 +++--- 9 files changed, 46 insertions(+), 39 deletions(-) diff --git a/README b/README index 1e7331ec56..ae059c78fa 100644 --- a/README +++ b/README @@ -22,11 +22,11 @@ installed with, you must recompile the package: • Remove all byte-compiled Tramp files - $ rm -f ~/.emacs.d/elpa/tramp-2.6.1.1a/tramp*.elc + $ rm -f ~/.emacs.d/elpa/tramp-2.6.1.2/tramp*.elc • Start Emacs with Tramp’s source files - $ emacs -L ~/.emacs.d/elpa/tramp-2.6.1.1a -l tramp + $ emacs -L ~/.emacs.d/elpa/tramp-2.6.1.2 -l tramp This should not give you the error. @@ -40,7 +40,7 @@ Mitigation of a bug in Emacs 29.1 ********************************* Due to a bug in Emacs 29.1, you must apply the following change prior -installation or upgrading Tramp 2.6.1.1a from GNU ELPA: +installation or upgrading Tramp 2.6.1.2 from GNU ELPA: (when (string-equal emacs-version "29.1") (with-current-buffer diff --git a/test/tramp-tests.el b/test/tramp-tests.el index c090fec8b2..6021eda8df 100644 --- a/test/tramp-tests.el +++ b/test/tramp-tests.el @@ -7404,6 +7404,7 @@ This requires restrictions of file name syntax." (skip-unless (not (getenv "EMACS_HYDRA_CI"))) ; SLOW ~ 245s (skip-unless (not (tramp--test-rsync-p))) (skip-unless (not (tramp--test-rclone-p))) + (skip-unless (not (or (eq system-type 'darwin) (tramp--test-macos-p)))) ;; Newlines, slashes and backslashes in file names are not ;; supported. So we don't test. And we don't test the tab diff --git a/texi/trampver.texi b/texi/trampver.texi index 7070e2c23a..389afe27d0 100644 --- a/texi/trampver.texi +++ b/texi/trampver.texi @@ -7,7 +7,7 @@ @c In the Tramp GIT, the version number and the bug report address @c are auto-frobbed from configure.ac. -@set trampver 2.6.1.1a +@set trampver 2.6.1.2 @set trampurl https://www.gnu.org/software/tramp/ @set tramp-bug-report-address tramp-devel@@gnu.org @set emacsver 26.1 diff --git a/tramp-adb.el b/tramp-adb.el index 58c9324533..f16c97a235 100644 --- a/tramp-adb.el +++ b/tramp-adb.el @@ -552,6 +552,8 @@ Emacs dired can't find files." (set-file-modes tmpfile (logior (or (file-modes tmpfile) 0) #o0600))) (let (create-lockfiles) (write-region start end tmpfile append 'no-message)) + ;; Now, `last-coding-system-used' has the right value. Remember it. + (setq coding-system-used last-coding-system-used) (with-tramp-progress-reporter v 3 (format-message "Moving tmp file `%s' to `%s'" tmpfile filename) diff --git a/tramp-sh.el b/tramp-sh.el index 9895af9250..5a1e73aab2 100644 --- a/tramp-sh.el +++ b/tramp-sh.el @@ -2825,7 +2825,8 @@ the result will be a local, non-Tramp, file name." (with-parsed-tramp-file-name name nil ;; If connection is not established yet, run the real handler. (if (not (tramp-connectable-p v)) - (tramp-run-real-handler #'expand-file-name (list name)) + (tramp-drop-volume-letter + (tramp-run-real-handler #'expand-file-name (list name))) (unless (tramp-run-real-handler #'file-name-absolute-p (list localname)) (setq localname (concat "~/" localname))) ;; Tilde expansion if necessary. This needs a shell which @@ -3446,15 +3447,6 @@ implementation will be used." (let* ((modes (tramp-default-file-modes filename (and (eq mustbenew 'excl) 'nofollow))) - ;; We use this to save the value of - ;; `last-coding-system-used' after writing the tmp - ;; file. At the end of the function, we set - ;; `last-coding-system-used' to this saved value. This - ;; way, any intermediary coding systems used while - ;; talking to the remote shell or suchlike won't hose - ;; this variable. This approach was snarfed from - ;; ange-ftp.el. - coding-system-used ;; Write region into a tmp file. This isn't really ;; needed if we use an encoding function, but currently ;; we use it always because this makes the logic @@ -3484,11 +3476,11 @@ implementation will be used." ((error quit) (setq tramp-temp-buffer-file-name nil) (delete-file tmpfile) - (signal (car err) (cdr err)))) + (signal (car err) (cdr err))))) - ;; Now, `last-coding-system-used' has the right value. - ;; Remember it. - (setq coding-system-used last-coding-system-used)) + ;; Now, `last-coding-system-used' has the right value. + ;; Remember it. + (setq coding-system-used last-coding-system-used) ;; The permissions of the temporary file should be set. If ;; FILENAME does not exist (eq modes nil) it has been @@ -3618,11 +3610,7 @@ implementation will be used." v 'file-error (concat "Method `%s' should specify both encoding and " "decoding command or an scp program") - method)))) - - ;; Make `last-coding-system-used' have the right value. - (when coding-system-used - (setq last-coding-system-used coding-system-used))))))) + method))))))))) (defvar tramp-vc-registered-file-names nil "List used to collect file names, which are checked during `vc-registered'.") diff --git a/tramp-smb.el b/tramp-smb.el index c50bd5b387..7249fa266a 100644 --- a/tramp-smb.el +++ b/tramp-smb.el @@ -1628,6 +1628,8 @@ VEC or USER, or if there is no home directory, return nil." ;; `set-visited-file-modtime' ourselves later on. (let (create-lockfiles) (write-region start end tmpfile append 'no-message)) + ;; Now, `last-coding-system-used' has the right value. Remember it. + (setq coding-system-used last-coding-system-used) (with-tramp-progress-reporter v 3 (format "Moving tmp file %s to %s" tmpfile filename) diff --git a/tramp-sshfs.el b/tramp-sshfs.el index 0ec2a1e74b..c638d32ec3 100644 --- a/tramp-sshfs.el +++ b/tramp-sshfs.el @@ -379,7 +379,9 @@ arguments to pass to the OPERATION." (tramp-skeleton-write-region start end filename append visit lockname mustbenew (let (create-lockfiles) (write-region - start end (tramp-fuse-local-file-name filename) append 'nomessage)))) + start end (tramp-fuse-local-file-name filename) append 'nomessage)) + ;; Now, `last-coding-system-used' has the right value. Remember it. + (setq coding-system-used last-coding-system-used))) ;; File name conversions. diff --git a/tramp.el b/tramp.el index 9fa698293c..d10f93b34b 100644 --- a/tramp.el +++ b/tramp.el @@ -3719,14 +3719,22 @@ BODY is the backend specific code." ;; VISIT, for example `jka-compr-handler'. We must respect this. ;; See Bug#55166. `(let* ((filename (expand-file-name ,filename)) - (lockname (file-truename (or ,lockname filename))) - (handler (and (stringp ,visit) - (let ((inhibit-file-name-handlers - `(tramp-file-name-handler - tramp-crypt-file-name-handler - . inhibit-file-name-handlers)) - (inhibit-file-name-operation 'write-region)) - (find-file-name-handler ,visit 'write-region))))) + (lockname (file-truename (or ,lockname filename))) + (handler (and (stringp ,visit) + (let ((inhibit-file-name-handlers + `(tramp-file-name-handler + tramp-crypt-file-name-handler + . inhibit-file-name-handlers)) + (inhibit-file-name-operation 'write-region)) + (find-file-name-handler ,visit 'write-region)))) + ;; We use this to save the value of + ;; `last-coding-system-used' after writing the tmp file. At + ;; the end of the function, we set `last-coding-system-used' + ;; to this saved value. This way, any intermediary coding + ;; systems used while talking to the remote shell or + ;; suchlike won't hose this variable. This approach was + ;; snarfed from ange-ftp.el. + coding-system-used) (with-parsed-tramp-file-name filename nil (if handler (progn @@ -3773,8 +3781,6 @@ BODY is the backend specific code." ;; likely that it is needed shortly after `write-region'. (tramp-set-file-property v localname "file-exists-p" t) - ;; We must protect `last-coding-system-used', now we have - ;; set it to its correct value. (let (last-coding-system-used (need-chown t)) ;; Set file modification time. (when (or (eq ,visit t) (stringp ,visit)) @@ -3794,7 +3800,7 @@ BODY is the backend specific code." (tramp-set-file-uid-gid filename uid gid)) ;; Set extended attributes. We ignore possible errors, - ;; because ACL strings could be incompatible. + ;; because ACL strings or SELinux contexts could be incompatible. (when attributes (ignore-errors (set-file-extended-attributes filename attributes))) @@ -3813,7 +3819,11 @@ BODY is the backend specific code." (when (and (null noninteractive) (or (eq ,visit t) (string-or-null-p ,visit))) (tramp-message v 0 "Wrote %s" filename)) - (run-hooks 'tramp-handle-write-region-hook))))))) + (run-hooks 'tramp-handle-write-region-hook)))) + + ;; Make `last-coding-system-used' have the right value. + (when coding-system-used + (setq last-coding-system-used coding-system-used))))) ;;; Common file name handler functions for different backends: @@ -5420,6 +5430,8 @@ of." ;; `set-visited-file-modtime' ourselves later on. (let (create-lockfiles) (write-region start end tmpfile append 'no-message)) + ;; Now, `last-coding-system-used' has the right value. Remember it. + (setq coding-system-used last-coding-system-used) (condition-case nil (rename-file tmpfile filename 'ok-if-already-exists) (error diff --git a/trampver.el b/trampver.el index 5c46b50b5d..289dbf8baa 100644 --- a/trampver.el +++ b/trampver.el @@ -7,7 +7,7 @@ ;; Maintainer: Michael Albinus <michael.albi...@gmx.de> ;; Keywords: comm, processes ;; Package: tramp -;; Version: 2.6.1.1a +;; Version: 2.6.1.2 ;; Package-Requires: ((emacs "26.1")) ;; Package-Type: multi ;; URL: https://www.gnu.org/software/tramp/ @@ -40,7 +40,7 @@ ;; ./configure" to change them. ;;;###tramp-autoload -(defconst tramp-version "2.6.1.1a" +(defconst tramp-version "2.6.1.2" "This version of Tramp.") ;;;###tramp-autoload @@ -78,7 +78,7 @@ ;; Check for Emacs version. (let ((x (if (not (string-version-lessp emacs-version "26.1")) "ok" - (format "Tramp 2.6.1.1a is not fit for %s" + (format "Tramp 2.6.1.2 is not fit for %s" (replace-regexp-in-string "\n" "" (emacs-version)))))) (unless (string-equal "ok" x) (error "%s" x)))