branch: externals/tramp
commit c04cee076dc5ed04abef538cde268d388f9571df
Author: Michael Albinus <[email protected]>
Commit: Michael Albinus <[email protected]>
Tramp ELPA version 2.8.1.1 released
---
README | 6 +++---
test/tramp-tests.el | 59 ++++++++++++++++++++++++++++++++++++++++++++++++----
texi/trampver.texi | 2 +-
tramp-adb.el | 11 +++++-----
tramp-androidsu.el | 10 +++------
tramp-cache.el | 10 +++------
tramp-cmds.el | 5 ++---
tramp-compat.el | 4 ++--
tramp-integration.el | 22 +++++++-------------
tramp-message.el | 6 ++++--
tramp-smb.el | 24 ++++++++++-----------
tramp.el | 26 ++++++++++++-----------
trampver.el | 6 +++---
13 files changed, 114 insertions(+), 77 deletions(-)
diff --git a/README b/README
index 529a204ba0..3c2315dd95 100644
--- a/README
+++ b/README
@@ -32,11 +32,11 @@ Emacs 28 or older
• Remove all byte-compiled Tramp files
- $ rm -f ~/.emacs.d/elpa/tramp-2.8.1/tramp*.elc
+ $ rm -f ~/.emacs.d/elpa/tramp-2.8.1.1/tramp*.elc
• Start Emacs with Tramp's source files
- $ emacs -L ~/.emacs.d/elpa/tramp-2.8.1 -l tramp
+ $ emacs -L ~/.emacs.d/elpa/tramp-2.8.1.1 -l tramp
This should not give you the error.
@@ -50,7 +50,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.8.1 from GNU ELPA:
+installation or upgrading Tramp 2.8.1.1 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 cb8253e66f..bbfe15d2f5 100644
--- a/test/tramp-tests.el
+++ b/test/tramp-tests.el
@@ -2145,6 +2145,7 @@ being the result.")
(ert-deftest tramp-test03-file-name-defaults ()
"Check default values for some methods."
+ :tags '(:expensive-test)
(skip-unless (eq tramp-syntax 'default))
;; Default values in tramp-adb.el.
@@ -2158,9 +2159,8 @@ being the result.")
(string-equal (file-remote-p (format "/-:%s@:" u) 'method) "ftp"))))
;; Default values in tramp-sh.el and tramp-sudoedit.el.
(when (assoc "su" tramp-methods)
- (dolist
- (h `("127.0.0.1" "[::1]" "localhost" "localhost4" "localhost6"
- "ip6-localhost" "ip6-loopback" ,(system-name)))
+ ;; "::1" is used as "[::1]" in remote file names.
+ (dolist (h (cons "[::1]" (delete "::1" tramp-local-host-names)))
(should
(string-equal (file-remote-p (format "/-:root@%s:" h) 'method) "su"))))
(dolist (m '("su" "sudo" "ksu" "doas" "sudoedit"))
@@ -2802,6 +2802,7 @@ This checks also `file-name-as-directory',
`file-name-directory',
;; The following test is inspired by Bug#35497.
(ert-deftest tramp-test10-write-region-file-precious-flag ()
"Check that `file-precious-flag' is respected with Tramp in use."
+ :tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
(skip-unless (tramp--test-sh-p))
@@ -2835,6 +2836,7 @@ This checks also `file-name-as-directory',
`file-name-directory',
;; The following test is inspired by Bug#55166.
(ert-deftest tramp-test10-write-region-other-file-name-handler ()
"Check that another file name handler in VISIT is acknowledged."
+ :tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
(skip-unless (not (tramp--test-ange-ftp-p)))
(skip-unless (executable-find "gzip"))
@@ -3445,6 +3447,7 @@ This tests also `file-directory-p' and
`file-accessible-directory-p'."
;; advice for older Emacs versions, so we check that this has been fixed.
(ert-deftest tramp-test16-file-expand-wildcards ()
"Check `file-expand-wildcards'."
+ :tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
(dolist (quoted (if (tramp--test-expensive-test-p) '(nil t) '(nil)))
@@ -3592,6 +3595,7 @@ This tests also `file-directory-p' and
`file-accessible-directory-p'."
(ert-deftest tramp-test17-dired-with-wildcards ()
"Check `dired' with wildcards."
+ :tags '(:expensive-test)
;; `separate' syntax and IPv6 host name syntax do not work.
(skip-unless
(not (string-match-p (rx "[") ert-remote-temporary-file-directory)))
@@ -3709,6 +3713,7 @@ This tests also `file-directory-p' and
`file-accessible-directory-p'."
;; The following test is inspired by Bug#45691.
(ert-deftest tramp-test17-insert-directory-one-file ()
"Check `insert-directory' inside directory listing."
+ :tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
;; Relative file names in dired are not supported in tramp-crypt.el.
(skip-unless (not (tramp--test-crypt-p)))
@@ -5055,7 +5060,7 @@ This tests also `make-symbolic-link', `file-truename' and
`add-name-to-file'."
(dolist
(elt
(append
- (mapcar #'intern (all-completions "tramp-" obarray #'functionp))
+ (apropos-internal (rx bos "tramp-") #'functionp)
'(completion-file-name-table read-file-name)))
(unless (get elt 'tramp-suppress-trace)
(trace-function-background elt))))
@@ -6499,6 +6504,7 @@ INPUT, if non-nil, is a string sent to the process."
;; This test is inspired by Bug#27009.
(ert-deftest tramp-test33-environment-variables-and-port-numbers ()
"Check that two connections with separate ports are different."
+ :tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
;; We test it only for the mock-up connection; otherwise there might
;; be problems with the used ports.
@@ -6708,6 +6714,7 @@ INPUT, if non-nil, is a string sent to the process."
;; This test is inspired by Bug#33781.
(ert-deftest tramp-test35-remote-path ()
"Check loooong `tramp-remote-path'."
+ :tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
(skip-unless (tramp--test-sh-p))
(skip-unless (not (tramp--test-crypt-p)))
@@ -7135,6 +7142,7 @@ INPUT, if non-nil, is a string sent to the process."
(ert-deftest tramp-test39-make-lock-file-name ()
"Check `make-lock-file-name', `lock-file', `unlock-file' and
`file-locked-p'."
+ :tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
(skip-unless (not (tramp--test-ange-ftp-p)))
@@ -7296,6 +7304,7 @@ INPUT, if non-nil, is a string sent to the process."
(ert-deftest tramp-test39-detect-external-change ()
"Check that an external file modification is reported."
+ :tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
(skip-unless (not (tramp--test-ange-ftp-p)))
@@ -7936,6 +7945,7 @@ This requires restrictions of file name syntax."
(ert-deftest tramp-test42-utf8 ()
"Check UTF8 encoding in file names and file contents."
+ :tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
(skip-unless (not (tramp--test-container-p)))
(skip-unless (not (tramp--test-rsync-p)))
@@ -8006,6 +8016,7 @@ This requires restrictions of file name syntax."
(ert-deftest tramp-test43-file-system-info ()
"Check that `file-system-info' returns proper values."
+ :tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
(when-let* ((fsi (file-system-info ert-remote-temporary-file-directory)))
@@ -8019,6 +8030,7 @@ This requires restrictions of file name syntax."
"Check results of user/group functions.
`file-user-uid', `file-group-gid', and `tramp-get-remote-*'
should all return proper values."
+ :tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
(let ((default-directory ert-remote-temporary-file-directory))
@@ -8247,6 +8259,42 @@ process sentinels. They shall not disturb each other."
;; (tramp--test-deftest-direct-async-process tramp-test45-asynchronous-requests
;; 'unstable)
+;; This test is inspired by Bug#49954 and Bug#60534.
+(ert-deftest tramp-test45-force-remote-file-error ()
+ "Force `remote-file-error'."
+ :tags '(:expensive-test :tramp-asynchronous-processes :unstable)
+ ;; It shall run only if selected explicitly.
+ (skip-unless
+ (eq (ert--stats-selector ert--current-run-stats)
+ (ert-test-name (ert--stats-current-test ert--current-run-stats))))
+ (skip-unless (tramp--test-enabled))
+ (skip-unless (tramp--test-sh-p))
+
+ (let ((default-directory ert-remote-temporary-file-directory)
+ ;; Do not cache Tramp properties.
+ (remote-file-name-inhibit-cache t)
+ (p (start-file-process-shell-command
+ "test" (generate-new-buffer "test" 'inhibit-buffer-hooks)
+ "while true; do echo test; sleep 0.2; done")))
+
+ (set-process-filter
+ p (lambda (&rest _)
+ (message "filter %s" default-directory)
+ (directory-files default-directory)
+ (dired-uncache default-directory)))
+
+ (run-at-time
+ 0 0.2 (lambda ()
+ (message "timer %s" default-directory)
+ (directory-files default-directory)
+ (dired-uncache default-directory)))
+
+ (while t
+ (accept-process-output)
+ (message "main %s" default-directory)
+ (directory-files default-directory)
+ (dired-uncache default-directory))))
+
(ert-deftest tramp-test46-dired-compress-file ()
"Check that Tramp (un)compresses normal files."
(skip-unless (tramp--test-enabled))
@@ -8623,6 +8671,7 @@ process sentinels. They shall not disturb each other."
;; This test is inspired by Bug#78572.
(ert-deftest tramp-test48-session-timeout ()
"Check that Tramp handles a session timeout properly."
+ :tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
(skip-unless (tramp--test-sh-p))
@@ -8703,6 +8752,7 @@ process sentinels. They shall not disturb each other."
(ert-deftest tramp-test49-external-backend-function ()
"Check that Tramp handles external functions for a given backend."
+ :tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
(skip-unless (not (tramp--test-ange-ftp-p)))
@@ -8847,6 +8897,7 @@ process sentinels. They shall not disturb each other."
(ert-deftest tramp-test50-recursive-load ()
"Check that Tramp does not fail due to recursive load."
+ :tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
(let ((default-directory (expand-file-name temporary-file-directory)))
diff --git a/texi/trampver.texi b/texi/trampver.texi
index ed18ab9bf4..7af8e29caf 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.8.1
+@set trampver 2.8.1.1
@set trampurl https://www.gnu.org/software/tramp/
@set tramp-bug-report-address tramp-devel@@gnu.org
@set emacsver 28.1
diff --git a/tramp-adb.el b/tramp-adb.el
index a745633c24..5bcb92536f 100644
--- a/tramp-adb.el
+++ b/tramp-adb.el
@@ -882,8 +882,8 @@ will be used."
;; is deleted. The temporary file will exist
;; until the process is deleted.
(when (bufferp stderr)
+ (tramp-taint-remote-process-buffer stderr)
(ignore-errors
- (tramp-taint-remote-process-buffer stderr)
(with-current-buffer stderr
(insert-file-contents-literally
remote-tmpstderr 'visit)))
@@ -1227,11 +1227,10 @@ connection if a previous connection has died for some
reason."
'tramp-adb-connection-local-default-ps-profile
tramp-adb-connection-local-default-ps-variables)
-(with-eval-after-load 'shell
- (connection-local-set-profiles
- `(:application tramp :protocol ,tramp-adb-method)
- 'tramp-adb-connection-local-default-shell-profile
- 'tramp-adb-connection-local-default-ps-profile))
+(connection-local-set-profiles
+ `(:application tramp :protocol ,tramp-adb-method)
+ 'tramp-adb-connection-local-default-shell-profile
+ 'tramp-adb-connection-local-default-ps-profile)
;; `shell-mode' tries to open remote files like "/adb::~/.history".
;; This fails, because the tilde cannot be expanded. Tell
diff --git a/tramp-androidsu.el b/tramp-androidsu.el
index d3e528e8ce..f15c558765 100644
--- a/tramp-androidsu.el
+++ b/tramp-androidsu.el
@@ -529,13 +529,9 @@ arguments to pass to the OPERATION."
(connection-local-set-profiles
`(:application tramp :protocol ,tramp-androidsu-method)
- 'tramp-androidsu-connection-local-default-profile)
-
-(with-eval-after-load 'shell
- (connection-local-set-profiles
- `(:application tramp :protocol ,tramp-androidsu-method)
- 'tramp-adb-connection-local-default-shell-profile
- 'tramp-adb-connection-local-default-ps-profile))
+ 'tramp-androidsu-connection-local-default-profile
+ 'tramp-adb-connection-local-default-shell-profile
+ 'tramp-adb-connection-local-default-ps-profile)
(add-hook 'tramp-unload-hook
(lambda ()
diff --git a/tramp-cache.el b/tramp-cache.el
index bb9179630c..1fc3fb3aea 100644
--- a/tramp-cache.el
+++ b/tramp-cache.el
@@ -202,11 +202,6 @@ Return DEFAULT if not set."
(set var (1+ val))))
value)))
-(add-hook 'tramp-cache-unload-hook
- (lambda ()
- (dolist (var (all-completions "tramp-cache-get-count-" obarray))
- (unintern var obarray))))
-
;;;###tramp-autoload
(defun tramp-set-file-property (key file property value)
"Set the PROPERTY of FILE to VALUE, in the cache context of KEY.
@@ -229,8 +224,9 @@ Return VALUE."
(add-hook 'tramp-cache-unload-hook
(lambda ()
- (dolist (var (all-completions "tramp-cache-set-count-" obarray))
- (unintern var obarray))))
+ (dolist (var (apropos-internal
+ (rx bos "tramp-cache-" (| "get" "set") "-count-")))
+ (unintern var nil))))
;;;###tramp-autoload
(defun tramp-file-property-p (key file property)
diff --git a/tramp-cmds.el b/tramp-cmds.el
index 84c1c7ea7f..95e1c5ecad 100644
--- a/tramp-cmds.el
+++ b/tramp-cmds.el
@@ -78,8 +78,7 @@ SYNTAX can be one of the symbols `default' (default),
((not (assoc method tramp-methods))))
method))
;; All method enabling functions.
- (mapcar
- #'intern (all-completions "tramp-enable-" obarray #'functionp))))))
+ (apropos-internal (rx bos "tramp-enable-") #'functionp)))))
(when-let* (((not (assoc method tramp-methods)))
(fn (intern (format "tramp-enable-%s-method" method)))
@@ -839,7 +838,7 @@ This is needed if there are compatibility problems."
(and x (boundp x) (not (get x 'tramp-suppress-trace))
(cons x 'tramp-reporter-dump-variable)))
(append
- (mapcar #'intern (all-completions "tramp-" obarray #'boundp))
+ (apropos-internal (rx bos "tramp-") #'boundp)
;; Non-Tramp variables of interest.
'(shell-prompt-pattern
backup-by-copying
diff --git a/tramp-compat.el b/tramp-compat.el
index c9a728e2be..f975457d4d 100644
--- a/tramp-compat.el
+++ b/tramp-compat.el
@@ -229,8 +229,8 @@ value is the default binding of the variable."
(cdr result)
,variable)))))
-(dolist (elt (all-completions "tramp-compat-" obarray #'functionp))
- (function-put (intern elt) 'tramp-suppress-trace t))
+(dolist (elt (apropos-internal (rx bos "tramp-compat-") #'functionp))
+ (function-put elt 'tramp-suppress-trace t))
(add-hook 'tramp-unload-hook
(lambda ()
diff --git a/tramp-integration.el b/tramp-integration.el
index 0183960d7f..83351952c6 100644
--- a/tramp-integration.el
+++ b/tramp-integration.el
@@ -367,10 +367,6 @@ It's value must be a Tramp user option, indexed in the
Tramp manual via
'tramp-connection-local-default-system-profile
tramp-connection-local-default-system-variables)
-(connection-local-set-profiles
- '(:application tramp)
- 'tramp-connection-local-default-system-profile)
-
(defconst tramp-connection-local-default-shell-variables
'((shell-file-name . "/bin/sh")
(shell-command-switch . "-c"))
@@ -380,10 +376,10 @@ It's value must be a Tramp user option, indexed in the
Tramp manual via
'tramp-connection-local-default-shell-profile
tramp-connection-local-default-shell-variables)
-(with-eval-after-load 'shell
- (connection-local-set-profiles
- '(:application tramp)
- 'tramp-connection-local-default-shell-profile))
+(connection-local-set-profiles
+ '(:application tramp)
+ 'tramp-connection-local-default-system-profile
+ 'tramp-connection-local-default-shell-profile)
;; Tested with FreeBSD 12.2.
(defconst tramp-bsd-process-attributes-ps-args
@@ -586,12 +582,10 @@ See `tramp-process-attributes-ps-format'.")
'tramp-connection-local-darwin-ps-profile)
;; ... Add other system types here.
)))
- (connection-local-set-profiles
- `(:application tramp :machine ,(system-name))
- local-profile)
- (connection-local-set-profiles
- '(:application tramp :machine "localhost")
- local-profile))
+ (dolist (local-host tramp-local-host-names)
+ (connection-local-set-profiles
+ `(:application tramp :machine ,local-host)
+ local-profile)))
;; Set connection-local variables for buffers visiting a file.
diff --git a/tramp-message.el b/tramp-message.el
index fe7758bdb0..7b405061ba 100644
--- a/tramp-message.el
+++ b/tramp-message.el
@@ -240,8 +240,10 @@ ARGUMENTS to actually emit the message (if applicable)."
(dolist
(elt
(append
- (mapcar
- #'intern (all-completions "tramp-" obarray #'functionp))
+ (apropos-internal (rx bos "tramp-") #'functionp)
+ (apropos-internal (rx bos "tramp-") #'macrop)
+ (apropos-internal
+ (rx bos "with-" (? "parsed-") "tramp-") #'macrop)
tramp-trace-functions))
(unless (get elt 'tramp-suppress-trace)
(trace-function-background elt (tramp-trace-buffer-name vec)))))
diff --git a/tramp-smb.el b/tramp-smb.el
index 10ab64929e..b87eee0fcc 100644
--- a/tramp-smb.el
+++ b/tramp-smb.el
@@ -2230,10 +2230,6 @@ SHARE will be passed to the call of
`tramp-smb-get-localname'."
'tramp-smb-connection-local-default-system-profile
tramp-smb-connection-local-default-system-variables)
-(connection-local-set-profiles
- `(:application tramp :protocol ,tramp-smb-method)
- 'tramp-smb-connection-local-default-system-profile)
-
;; (defconst tramp-smb-connection-local-bash-variables
;; '((explicit-shell-file-name . "bash")
;; (explicit-bash-args . ("--norc" "--noediting" "-i"))
@@ -2257,12 +2253,6 @@ SHARE will be passed to the call of
`tramp-smb-get-localname'."
'tramp-smb-connection-local-powershell-profile
tramp-smb-connection-local-powershell-variables)
-(defun tramp-smb-shell-prompt ()
- "Set `comint-prompt-regexp' to a proper value."
- ;; Used for remote `shell-mode' buffers.
- (when (tramp-smb-file-name-p default-directory)
- (setq-local comint-prompt-regexp tramp-smb-prompt)))
-
;; (defconst tramp-smb-connection-local-cmd-variables
;; '((explicit-shell-file-name . "cmd")
;; (explicit-cmd-args . ("/Q"))
@@ -2274,10 +2264,18 @@ SHARE will be passed to the call of
`tramp-smb-get-localname'."
;; 'tramp-smb-connection-local-cmd-profile
;; tramp-smb-connection-local-cmd-variables)
+(connection-local-set-profiles
+ `(:application tramp :protocol ,tramp-smb-method)
+ 'tramp-smb-connection-local-default-system-profile
+ 'tramp-smb-connection-local-powershell-profile)
+
+(defun tramp-smb-shell-prompt ()
+ "Set `comint-prompt-regexp' to a proper value."
+ ;; Used for remote `shell-mode' buffers.
+ (when (tramp-smb-file-name-p default-directory)
+ (setq-local comint-prompt-regexp tramp-smb-prompt)))
+
(with-eval-after-load 'shell
- (connection-local-set-profiles
- `(:application tramp :protocol ,tramp-smb-method)
- 'tramp-smb-connection-local-powershell-profile)
(add-hook 'shell-mode-hook
#'tramp-smb-shell-prompt)
(add-hook 'tramp-smb-unload-hook
diff --git a/tramp.el b/tramp.el
index a6be310f04..32026808b4 100644
--- a/tramp.el
+++ b/tramp.el
@@ -7,7 +7,7 @@
;; Maintainer: Michael Albinus <[email protected]>
;; Keywords: comm, processes
;; Package: tramp
-;; Version: 2.8.1
+;; Version: 2.8.1.1
;; Package-Requires: ((emacs "28.1"))
;; Package-Type: multi
;; URL: https://www.gnu.org/software/tramp/
@@ -583,19 +583,21 @@ host runs a restricted shell, it shall be added to this
list, too."
:type '(repeat (regexp :tag "Host regexp"))
:link '(info-link :tag "Tramp manual" "(tramp) Multi-hops"))
+;;;###tramp-autoload
+(defvar tramp-local-host-names
+ (list tramp-system-name "localhost" "127.0.0.1" "::1"
+ ;; Fedora.
+ "localhost4" "localhost6"
+ ;; Ubuntu.
+ "ip6-localhost" "ip6-loopback"
+ ;; OpenSUSE.
+ "ipv6-localhost" "ipv6-loopback")
+ "List of host names which are regarded as local host.")
+
;;;###tramp-autoload
(defcustom tramp-local-host-regexp
- (rx bos
- (| (literal tramp-system-name)
- (| "localhost" "127.0.0.1" "::1"
- ;; Fedora.
- "localhost4" "localhost6"
- ;; Ubuntu.
- "ip6-localhost" "ip6-loopback"
- ;; OpenSUSE.
- "ipv6-localhost" "ipv6-loopback"))
- eos)
- "Host names which are regarded as local host.
+ (rx-to-string `(: bos (| . ,tramp-local-host-names) eos))
+ "Regexp of host names which are regarded as local host.
If the local host runs a chrooted environment, set this to nil."
:version "30.1"
:type '(choice (const :tag "Chrooted environment" nil)
diff --git a/trampver.el b/trampver.el
index f813fe869d..48b7123449 100644
--- a/trampver.el
+++ b/trampver.el
@@ -7,7 +7,7 @@
;; Maintainer: Michael Albinus <[email protected]>
;; Keywords: comm, processes
;; Package: tramp
-;; Version: 2.8.1
+;; Version: 2.8.1.1
;; Package-Requires: ((emacs "28.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.8.1"
+(defconst tramp-version "2.8.1.1"
"This version of Tramp.")
;;;###tramp-autoload
@@ -76,7 +76,7 @@
;; Check for Emacs version.
(let ((x (if (not (string-version-lessp emacs-version "28.1"))
"ok"
- (format "Tramp 2.8.1 is not fit for %s"
+ (format "Tramp 2.8.1.1 is not fit for %s"
(replace-regexp-in-string "\n" "" (emacs-version))))))
(unless (string-equal "ok" x) (error "%s" x)))