branch: externals/tramp commit 65787fc66892f47cf984973712c8465cc7dadb45 Author: Michael Albinus <michael.albi...@gmx.de> Commit: Michael Albinus <michael.albi...@gmx.de>
Sync with Tramp master --- Makefile | 23 ++- README-GIT | 4 +- test/Makefile | 5 +- test/tramp-tests.el | 393 +++++++++++++++++++++++++++++---------------------- texi/Makefile | 6 +- texi/tramp.texi | 4 + tramp-adb.el | 7 +- tramp-gvfs.el | 2 +- tramp-integration.el | 7 +- tramp-rclone.el | 2 +- tramp-sh.el | 46 +++--- tramp-smb.el | 12 +- tramp-sudoedit.el | 14 +- tramp.el | 25 +++- tramp.info | 107 +++++++------- 15 files changed, 383 insertions(+), 274 deletions(-) diff --git a/Makefile b/Makefile index 9b23a9d..30d250b 100644 --- a/Makefile +++ b/Makefile @@ -19,11 +19,30 @@ EMACS = emacs -Q -batch -L . LISP_FILES = $(wildcard *.el) -.PHONY: all autoloads check info test +.PHONY: all autoloads check info sync test .SUFFIXES: .el -all: autoloads info +all: sync autoloads info + +sync: + cp -p ~/src/tramp/lisp/tramp-adb.el tramp-adb.el + cp -p ~/src/tramp/lisp/tramp-archive.el tramp-archive.el + cp -p ~/src/tramp/lisp/tramp-cache.el tramp-cache.el + cp -p ~/src/tramp/lisp/tramp-cmds.el tramp-cmds.el + cp -p ~/src/tramp/lisp/tramp-compat.el tramp-compat.el + cp -p ~/src/tramp/lisp/tramp-ftp.el tramp-ftp.el + cp -p ~/src/tramp/lisp/tramp-gvfs.el tramp-gvfs.el + cp -p ~/src/tramp/lisp/tramp-integration.el tramp-integration.el + cp -p ~/src/tramp/lisp/tramp-rclone.el tramp-rclone.el + cp -p ~/src/tramp/lisp/tramp-sh.el tramp-sh.el + cp -p ~/src/tramp/lisp/tramp-smb.el tramp-smb.el + cp -p ~/src/tramp/lisp/tramp-sudoedit.el tramp-sudoedit.el + cp -p ~/src/tramp/lisp/tramp-uu.el tramp-uu.el + cp -p ~/src/tramp/lisp/tramp.el tramp.el + cp -p ~/src/tramp/lisp/trampver.el trampver.el + $(MAKE) -C texi sync + $(MAKE) -C test sync autoloads: $(LISP_FILES) $(EMACS) -l autoload \ diff --git a/README-GIT b/README-GIT index 0b9bc6c..5dab910 100644 --- a/README-GIT +++ b/README-GIT @@ -8,5 +8,5 @@ remotes, "origin" and "elpa". They are pulled/pushed like this: # git push elpa externals/tramp These commands do not apply to the local ELPA repository. This uses -"make externals" for a pull; a push for the Tramp part is not -expected. +"git pull; make externals" for a pull; a push for the Tramp part is +not expected. diff --git a/test/Makefile b/test/Makefile index 0f5441e..092f2b4 100644 --- a/test/Makefile +++ b/test/Makefile @@ -28,7 +28,7 @@ TESTS = tramp-tests TRAMP_TEST_ARGS ?= SELECTOR ?= t -.PHONY: all check test clean distclean +.PHONY: all check clean distclean sync test # We want to keep *.elc files. .SECONDARY: @@ -46,6 +46,9 @@ check test: $(TESTS) %.elc: %.el $(EMACS) -l bytecomp -f batch-byte-compile $? +sync: + cp -p ~/src/tramp/test/tramp-tests.el tramp-tests.el + clean: $(RM) $(CLEAN_FILES) diff --git a/test/tramp-tests.el b/test/tramp-tests.el index fd30e9c..5b7d149 100644 --- a/test/tramp-tests.el +++ b/test/tramp-tests.el @@ -176,10 +176,9 @@ properly. BODY shall not contain a timeout." (let ((tramp--test-instrument-test-case-p t)) ,@body) ;; Unwind forms. (when (and (null tramp--test-instrument-test-case-p) (> tramp-verbose 3)) - (with-parsed-tramp-file-name tramp-test-temporary-file-directory nil - (with-current-buffer (tramp-get-connection-buffer v) - (message "%s" (buffer-string))) - (with-current-buffer (tramp-get-debug-buffer v) + (dolist (buf (tramp-list-tramp-buffers)) + (message ";; %s" buf) + (with-current-buffer buf (message "%s" (buffer-string)))))))) (defsubst tramp--test-message (fmt-string &rest arguments) @@ -412,15 +411,26 @@ properly. BODY shall not contain a timeout." (ert-deftest tramp-test02-file-name-dissect () "Check remote file name components." + ;; `user-error' has appeared in Emacs 24.3. + (skip-unless (fboundp 'user-error)) + (let ((tramp-default-method "default-method") (tramp-default-user "default-user") (tramp-default-host "default-host") tramp-default-method-alist tramp-default-user-alist tramp-default-host-alist + ;; Suppress method name check. + (non-essential t) ;; Suppress check for multihops. (tramp-cache-data (make-hash-table :test #'equal)) (tramp-connection-properties '((nil "login-program" t)))) + ;; An unknown method shall raise an error. + (let (non-essential) + (should-error + (expand-file-name "/method:user@host:") + :type 'user-error)) + ;; Expand `tramp-default-user' and `tramp-default-host'. (should (string-equal (file-remote-p "/method::") @@ -527,7 +537,8 @@ properly. BODY shall not contain a timeout." (should (string-equal (file-remote-p "/-:user@host#1234:" 'method) "default-method")) (should (string-equal (file-remote-p "/-:user@host#1234:" 'user) "user")) - (should (string-equal (file-remote-p "/-:user@host#1234:" 'host) "host#1234")) + (should (string-equal + (file-remote-p "/-:user@host#1234:" 'host) "host#1234")) (should (string-equal (file-remote-p "/-:user@host#1234:" 'localname) "")) (should (string-equal (file-remote-p "/-:user@host#1234:" 'hop) nil)) @@ -563,7 +574,8 @@ properly. BODY shall not contain a timeout." (should (string-equal (file-remote-p "/-:1.2.3.4:") (format "/%s:%s@%s:" "default-method" "default-user" "1.2.3.4"))) - (should (string-equal (file-remote-p "/-:1.2.3.4:" 'method) "default-method")) + (should (string-equal + (file-remote-p "/-:1.2.3.4:" 'method) "default-method")) (should (string-equal (file-remote-p "/-:1.2.3.4:" 'user) "default-user")) (should (string-equal (file-remote-p "/-:1.2.3.4:" 'host) "1.2.3.4")) (should (string-equal (file-remote-p "/-:1.2.3.4:" 'localname) "")) @@ -852,11 +864,16 @@ properly. BODY shall not contain a timeout." (ert-deftest tramp-test02-file-name-dissect-simplified () "Check simplified file name components." :tags '(:expensive-test) + ;; `user-error' has appeared in Emacs 24.3. + (skip-unless (fboundp 'user-error)) + (let ((tramp-default-method "default-method") (tramp-default-user "default-user") (tramp-default-host "default-host") tramp-default-user-alist tramp-default-host-alist + ;; Suppress method name check. + (non-essential t) ;; Suppress check for multihops. (tramp-cache-data (make-hash-table :test #'equal)) (tramp-connection-properties '((nil "login-program" t))) @@ -864,6 +881,12 @@ properly. BODY shall not contain a timeout." (unwind-protect (progn (tramp-change-syntax 'simplified) + ;; An unknown default method shall raise an error. + (let (non-essential) + (should-error + (expand-file-name "/user@host:") + :type 'user-error)) + ;; Expand `tramp-default-method' and `tramp-default-user'. (should (string-equal (file-remote-p "/host:") @@ -1175,12 +1198,17 @@ properly. BODY shall not contain a timeout." (ert-deftest tramp-test02-file-name-dissect-separate () "Check separate file name components." :tags '(:expensive-test) + ;; `user-error' has appeared in Emacs 24.3. + (skip-unless (fboundp 'user-error)) + (let ((tramp-default-method "default-method") (tramp-default-user "default-user") (tramp-default-host "default-host") tramp-default-method-alist tramp-default-user-alist tramp-default-host-alist + ;; Suppress method name check. + (non-essential t) ;; Suppress check for multihops. (tramp-cache-data (make-hash-table :test #'equal)) (tramp-connection-properties '((nil "login-program" t))) @@ -1188,6 +1216,12 @@ properly. BODY shall not contain a timeout." (unwind-protect (progn (tramp-change-syntax 'separate) + ;; An unknown method shall raise an error. + (let (non-essential) + (should-error + (expand-file-name "/[method/user@host]") + :type 'user-error)) + ;; Expand `tramp-default-user' and `tramp-default-host'. (should (string-equal (file-remote-p "/[method/]") @@ -1826,24 +1860,30 @@ properly. BODY shall not contain a timeout." (ert-deftest tramp-test03-file-name-defaults () "Check default values for some methods." ;; Default values in tramp-adb.el. - (should (string-equal (file-remote-p "/adb::" 'host) "")) + (when (assoc "adb" tramp-methods) + (should (string-equal (file-remote-p "/adb::" 'host) ""))) ;; Default values in tramp-ftp.el. - (should (string-equal (file-remote-p "/-:ftp.host:" 'method) "ftp")) - (dolist (u '("ftp" "anonymous")) - (should (string-equal (file-remote-p (format "/-:%s@:" u) 'method) "ftp"))) + (when (assoc "ftp" tramp-methods) + (should (string-equal (file-remote-p "/-:ftp.host:" 'method) "ftp")) + (dolist (u '("ftp" "anonymous")) + (should + (string-equal (file-remote-p (format "/-:%s@:" u) 'method) "ftp")))) ;; Default values in tramp-sh.el and tramp-sudoedit.el. - (dolist (h `("127.0.0.1" "[::1]" "localhost" "localhost6" ,(system-name))) - (should - (string-equal (file-remote-p (format "/-:root@%s:" h) 'method) "su"))) - (dolist (m '("su" "sudo" "ksu" "doas" "sudoedit")) - (should (string-equal (file-remote-p (format "/%s::" m) 'user) "root")) - (should - (string-equal (file-remote-p (format "/%s::" m) 'host) (system-name)))) - (dolist (m '("rcp" "remcp" "rsh" "telnet" "krlogin" "fcp" "nc")) - (should - (string-equal (file-remote-p (format "/%s::" m) 'user) (user-login-name)))) + (when (assoc "su" tramp-methods) + (dolist (h `("127.0.0.1" "[::1]" "localhost" "localhost6" ,(system-name))) + (should + (string-equal (file-remote-p (format "/-:root@%s:" h) 'method) "su"))) + (dolist (m '("su" "sudo" "ksu" "doas" "sudoedit")) + (should (string-equal (file-remote-p (format "/%s::" m) 'user) "root")) + (should + (string-equal (file-remote-p (format "/%s::" m) 'host) (system-name)))) + (dolist (m '("rcp" "remcp" "rsh" "telnet" "krlogin" "fcp" "nc")) + (should + (string-equal + (file-remote-p (format "/%s::" m) 'user) (user-login-name))))) ;; Default values in tramp-smb.el. - (should (string-equal (file-remote-p "/smb::" 'user) nil))) + (when (assoc "smb" tramp-methods) + (should (string-equal (file-remote-p "/smb::" 'user) nil)))) ;; The following test is inspired by Bug#30946. (ert-deftest tramp-test03-file-name-host-rules () @@ -1898,121 +1938,129 @@ properly. BODY shall not contain a timeout." (ert-deftest tramp-test04-substitute-in-file-name () "Check `substitute-in-file-name'." - (should (string-equal (substitute-in-file-name "/method:host:///foo") "/foo")) - (should - (string-equal - (substitute-in-file-name "/method:host://foo") "/method:host:/foo")) - (should - (string-equal (substitute-in-file-name "/method:host:/path///foo") "/foo")) - (should - (string-equal - (substitute-in-file-name "/method:host:/path//foo") "/method:host:/foo")) - ;; Quoting local part. - (should - (string-equal - (substitute-in-file-name "/method:host:/:///foo") "/method:host:/:///foo")) - (should - (string-equal - (substitute-in-file-name "/method:host:/://foo") "/method:host:/://foo")) - (should - (string-equal - (substitute-in-file-name "/method:host:/:/path///foo") - "/method:host:/:/path///foo")) - (should - (string-equal - (substitute-in-file-name "/method:host:/:/path//foo") - "/method:host:/:/path//foo")) - - (should - (string-equal (substitute-in-file-name "/method:host://~foo") "/~foo")) - (should - (string-equal - (substitute-in-file-name "/method:host:/~foo") "/method:host:/~foo")) - (should - (string-equal (substitute-in-file-name "/method:host:/path//~foo") "/~foo")) - ;; (substitute-in-file-name "/path/~foo") expands only for a local - ;; user "foo" to "/~foo"". Otherwise, it doesn't expand. - (should - (string-equal - (substitute-in-file-name - "/method:host:/path/~foo") "/method:host:/path/~foo")) - ;; Quoting local part. - (should - (string-equal - (substitute-in-file-name "/method:host:/://~foo") "/method:host:/://~foo")) - (should - (string-equal - (substitute-in-file-name "/method:host:/:/~foo") "/method:host:/:/~foo")) - (should - (string-equal - (substitute-in-file-name - "/method:host:/:/path//~foo") "/method:host:/:/path//~foo")) - (should - (string-equal - (substitute-in-file-name - "/method:host:/:/path/~foo") "/method:host:/:/path/~foo")) + ;; Suppress method name check. + (let ((tramp-methods (cons '("method") tramp-methods))) + (should + (string-equal (substitute-in-file-name "/method:host:///foo") "/foo")) + (should + (string-equal + (substitute-in-file-name "/method:host://foo") "/method:host:/foo")) + (should + (string-equal (substitute-in-file-name "/method:host:/path///foo") "/foo")) + (should + (string-equal + (substitute-in-file-name "/method:host:/path//foo") "/method:host:/foo")) + ;; Quoting local part. + (should + (string-equal + (substitute-in-file-name "/method:host:/:///foo") + "/method:host:/:///foo")) + (should + (string-equal + (substitute-in-file-name "/method:host:/://foo") "/method:host:/://foo")) + (should + (string-equal + (substitute-in-file-name "/method:host:/:/path///foo") + "/method:host:/:/path///foo")) + (should + (string-equal + (substitute-in-file-name "/method:host:/:/path//foo") + "/method:host:/:/path//foo")) - (let (process-environment) + (should + (string-equal (substitute-in-file-name "/method:host://~foo") "/~foo")) (should (string-equal - (substitute-in-file-name "/method:host:/path/$FOO") - "/method:host:/path/$FOO")) - (setenv "FOO" "bla") + (substitute-in-file-name "/method:host:/~foo") "/method:host:/~foo")) (should (string-equal - (substitute-in-file-name "/method:host:/path/$FOO") - "/method:host:/path/bla")) + (substitute-in-file-name "/method:host:/path//~foo") "/~foo")) + ;; (substitute-in-file-name "/path/~foo") expands only for a local + ;; user "foo" to "/~foo"". Otherwise, it doesn't expand. (should (string-equal - (substitute-in-file-name "/method:host:/path/$$FOO") - "/method:host:/path/$FOO")) + (substitute-in-file-name + "/method:host:/path/~foo") "/method:host:/path/~foo")) ;; Quoting local part. (should (string-equal - (substitute-in-file-name "/method:host:/:/path/$FOO") - "/method:host:/:/path/$FOO")) - (setenv "FOO" "bla") + (substitute-in-file-name "/method:host:/://~foo") + "/method:host:/://~foo")) (should (string-equal - (substitute-in-file-name "/method:host:/:/path/$FOO") - "/method:host:/:/path/$FOO")) + (substitute-in-file-name "/method:host:/:/~foo") "/method:host:/:/~foo")) (should (string-equal - (substitute-in-file-name "/method:host:/:/path/$$FOO") - "/method:host:/:/path/$$FOO")))) + (substitute-in-file-name + "/method:host:/:/path//~foo") "/method:host:/:/path//~foo")) + (should + (string-equal + (substitute-in-file-name + "/method:host:/:/path/~foo") "/method:host:/:/path/~foo")) + + (let (process-environment) + (should + (string-equal + (substitute-in-file-name "/method:host:/path/$FOO") + "/method:host:/path/$FOO")) + (setenv "FOO" "bla") + (should + (string-equal + (substitute-in-file-name "/method:host:/path/$FOO") + "/method:host:/path/bla")) + (should + (string-equal + (substitute-in-file-name "/method:host:/path/$$FOO") + "/method:host:/path/$FOO")) + ;; Quoting local part. + (should + (string-equal + (substitute-in-file-name "/method:host:/:/path/$FOO") + "/method:host:/:/path/$FOO")) + (setenv "FOO" "bla") + (should + (string-equal + (substitute-in-file-name "/method:host:/:/path/$FOO") + "/method:host:/:/path/$FOO")) + (should + (string-equal + (substitute-in-file-name "/method:host:/:/path/$$FOO") + "/method:host:/:/path/$$FOO"))))) (ert-deftest tramp-test05-expand-file-name () "Check `expand-file-name'." - (should - (string-equal - (expand-file-name "/method:host:/path/./file") "/method:host:/path/file")) - (should - (string-equal - (expand-file-name "/method:host:/path/../file") "/method:host:/file")) - (should - (string-equal - (expand-file-name "/method:host:/path/.") "/method:host:/path")) - (should - (string-equal - (expand-file-name "/method:host:/path/..") "/method:host:/")) - (should - (string-equal - (expand-file-name "." "/method:host:/path/") "/method:host:/path")) - (should - (string-equal - (expand-file-name "" "/method:host:/path/") "/method:host:/path")) - ;; Quoting local part. - (should - (string-equal - (expand-file-name "/method:host:/:/path/./file") - "/method:host:/:/path/file")) - (should - (string-equal - (expand-file-name "/method:host:/:/path/../file") "/method:host:/:/file")) - (should - (string-equal - (expand-file-name "/method:host:/:/~/path/./file") - "/method:host:/:/~/path/file"))) + ;; Suppress method name check. + (let ((tramp-methods (cons '("method") tramp-methods))) + (should + (string-equal + (expand-file-name "/method:host:/path/./file") "/method:host:/path/file")) + (should + (string-equal + (expand-file-name "/method:host:/path/../file") "/method:host:/file")) + (should + (string-equal + (expand-file-name "/method:host:/path/.") "/method:host:/path")) + (should + (string-equal + (expand-file-name "/method:host:/path/..") "/method:host:/")) + (should + (string-equal + (expand-file-name "." "/method:host:/path/") "/method:host:/path")) + (should + (string-equal + (expand-file-name "" "/method:host:/path/") "/method:host:/path")) + ;; Quoting local part. + (should + (string-equal + (expand-file-name "/method:host:/:/path/./file") + "/method:host:/:/path/file")) + (should + (string-equal + (expand-file-name "/method:host:/:/path/../file") "/method:host:/:/file")) + (should + (string-equal + (expand-file-name "/method:host:/:/~/path/./file") + "/method:host:/:/~/path/file")))) ;; The following test is inspired by Bug#26911 and Bug#34834. They ;; are rather bugs in `expand-file-name', and it fails for all Emacs @@ -2042,48 +2090,51 @@ properly. BODY shall not contain a timeout." "Check `directory-file-name'. This checks also `file-name-as-directory', `file-name-directory', `file-name-nondirectory' and `unhandled-file-name-directory'." - (should - (string-equal - (directory-file-name "/method:host:/path/to/file") - "/method:host:/path/to/file")) - (should - (string-equal - (directory-file-name "/method:host:/path/to/file/") - "/method:host:/path/to/file")) - (should - (string-equal - (directory-file-name "/method:host:/path/to/file//") - "/method:host:/path/to/file")) - (should - (string-equal - (file-name-as-directory "/method:host:/path/to/file") - "/method:host:/path/to/file/")) - (should - (string-equal - (file-name-as-directory "/method:host:/path/to/file/") - "/method:host:/path/to/file/")) - (should - (string-equal - (file-name-directory "/method:host:/path/to/file") - "/method:host:/path/to/")) - (should - (string-equal - (file-name-directory "/method:host:/path/to/file/") - "/method:host:/path/to/file/")) - (should - (string-equal (file-name-directory "/method:host:file") "/method:host:")) - (should - (string-equal - (file-name-directory "/method:host:path/") "/method:host:path/")) - (should - (string-equal - (file-name-directory "/method:host:path/to") "/method:host:path/")) - (should - (string-equal (file-name-nondirectory "/method:host:/path/to/file") "file")) - (should - (string-equal (file-name-nondirectory "/method:host:/path/to/file/") "")) - (should-not - (unhandled-file-name-directory "/method:host:/path/to/file")) + ;; Suppress method name check. + (let ((tramp-methods (cons '("method") tramp-methods))) + (should + (string-equal + (directory-file-name "/method:host:/path/to/file") + "/method:host:/path/to/file")) + (should + (string-equal + (directory-file-name "/method:host:/path/to/file/") + "/method:host:/path/to/file")) + (should + (string-equal + (directory-file-name "/method:host:/path/to/file//") + "/method:host:/path/to/file")) + (should + (string-equal + (file-name-as-directory "/method:host:/path/to/file") + "/method:host:/path/to/file/")) + (should + (string-equal + (file-name-as-directory "/method:host:/path/to/file/") + "/method:host:/path/to/file/")) + (should + (string-equal + (file-name-directory "/method:host:/path/to/file") + "/method:host:/path/to/")) + (should + (string-equal + (file-name-directory "/method:host:/path/to/file/") + "/method:host:/path/to/file/")) + (should + (string-equal (file-name-directory "/method:host:file") "/method:host:")) + (should + (string-equal + (file-name-directory "/method:host:path/") "/method:host:path/")) + (should + (string-equal + (file-name-directory "/method:host:path/to") "/method:host:path/")) + (should + (string-equal + (file-name-nondirectory "/method:host:/path/to/file") "file")) + (should + (string-equal (file-name-nondirectory "/method:host:/path/to/file/") "")) + (should-not + (unhandled-file-name-directory "/method:host:/path/to/file"))) ;; Bug#10085. (when (tramp--test-enabled) ;; Packages like tramp-gvfs.el might be disabled. @@ -3968,7 +4019,6 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." ;; name handlers since Emacs 27. (skip-unless (tramp--test-emacs27-p)) - (tramp--test-instrument-test-case 0 (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil))) (let ((default-directory tramp-test-temporary-file-directory) (tmp-name (tramp--test-make-temp-name nil quoted)) @@ -4097,7 +4147,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." ;; Cleanup. (ignore-errors (delete-process proc)) - (ignore-errors (kill-buffer stderr))))))))) + (ignore-errors (kill-buffer stderr)))))))) (ert-deftest tramp-test31-interrupt-process () "Check `interrupt-process'." @@ -4107,7 +4157,10 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." ;; Since Emacs 26.1. (skip-unless (boundp 'interrupt-process-functions)) - (let ((default-directory tramp-test-temporary-file-directory) + ;; We must use `file-truename' for the temporary directory, in + ;; order to establish the connection prior running an asynchronous + ;; process. + (let ((default-directory (file-truename tramp-test-temporary-file-directory)) kill-buffer-query-functions proc) (unwind-protect (with-temp-buffer @@ -4602,7 +4655,11 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (skip-unless (tramp--test-sh-p)) (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil))) - (let* ((default-directory tramp-test-temporary-file-directory) + ;; We must use `file-truename' for the temporary directory, in + ;; order to establish the connection prior running an asynchronous + ;; process. + (let* ((default-directory + (file-truename tramp-test-temporary-file-directory)) (tmp-name1 (tramp--test-make-temp-name nil quoted)) (tmp-name2 (expand-file-name "foo" tmp-name1)) (tramp-remote-process-environment tramp-remote-process-environment) @@ -5733,7 +5790,9 @@ process sentinels. They shall not disturb each other." (let ((default-directory (expand-file-name temporary-file-directory)) (code (format - "(message \"Tramp loaded: %%s\" (and (file-remote-p %S) t))" + ;; Suppress method name check. + "(let ((non-essential t)) \ + (message \"Tramp loaded: %%s\" (and (file-remote-p %S) t)))" tramp-test-temporary-file-directory))) (should (string-match @@ -5912,9 +5971,9 @@ Since it unloads Tramp, it shall be the last test to run." ;; do not work properly for `nextcloud'. ;; * Fix `tramp-test29-start-file-process' and ;; `tramp-test30-make-process' on MS Windows (`process-send-eof'?). +;; * Implement `tramp-test31-interrupt-process' for `adb'. ;; * Fix Bug#16928 in `tramp-test43-asynchronous-requests'. Looks ;; like it is resolved now. Remove `:unstable' tag? -;; * Implement `tramp-test31-interrupt-process' for `adb'. ;; * Fix `tramp-test44-threads'. (provide 'tramp-tests) diff --git a/texi/Makefile b/texi/Makefile index 82ba664..a5cf8b6 100644 --- a/texi/Makefile +++ b/texi/Makefile @@ -26,10 +26,14 @@ TEXI_FILES = $(wildcard *.texi) CLEAN_FILES = .\\\#* \\\#* .*~ *~ *.aux *.cp *.cps *.diff *.fn *.fns \ *.ky *.log *.pg *.tmp *.toc *.tp *.vr *.vrs -.PHONY: all clean +.PHONY: all clean sync all: ../tramp.info +sync: + cp -p ~/src/tramp/texi/tramp.texi tramp.texi + cp -p ~/src/tramp/texi/trampver.texi trampver.texi + ../tramp.info: $(TEXI_FILES) $(MAKEINFO) --footnote-style=end -o $@ $< diff --git a/texi/tramp.texi b/texi/tramp.texi index b5f93ef..3e66e5d 100644 --- a/texi/tramp.texi +++ b/texi/tramp.texi @@ -308,12 +308,16 @@ behind the scenes when you open a file with @value{tramp}. @node Obtaining @value{tramp} @chapter Obtaining @value{tramp} @cindex obtaining @value{tramp} +@cindex GNU ELPA @value{tramp} is included as part of Emacs (since Emacs 22.1). @value{tramp} is also freely packaged for download on the Internet at @uref{https://ftp.gnu.org/gnu/tramp/}. +@value{tramp} is available as @uref{https://elpa.gnu.org, GNU ELPA} +package. + @value{tramp} development versions are available on Git servers. Development versions contain new and incomplete features. diff --git a/tramp-adb.el b/tramp-adb.el index 008a5ce..9a214c3 100644 --- a/tramp-adb.el +++ b/tramp-adb.el @@ -1294,8 +1294,11 @@ connection if a previous connection has died for some reason." ;; Default settings for connection-local variables. (defconst tramp-adb-connection-local-default-profile - '((shell-file-name . "/system/bin/sh") - (shell-command-switch . "-c")) + ;; `w32-shell-name' is derived from `shell-file-name'. Don't let it + ;; be confused. + (unless (eq system-type 'windows-nt) + '((shell-file-name . "/system/bin/sh") + (shell-command-switch . "-c"))) "Default connection-local variables for remote adb connections.") ;; `connection-local-set-profile-variables' and diff --git a/tramp-gvfs.el b/tramp-gvfs.el index 3810231..17c2e79 100644 --- a/tramp-gvfs.el +++ b/tramp-gvfs.el @@ -1765,7 +1765,7 @@ connection if a previous connection has died for some reason." ;; better solution? (unless (get-buffer-process (tramp-get-connection-buffer vec)) (let ((p (make-network-process - :name (tramp-buffer-name vec) + :name (tramp-get-connection-name vec) :buffer (tramp-get-connection-buffer vec) :server t :host 'local :service t :noquery t))) (process-put p 'vector vec) diff --git a/tramp-integration.el b/tramp-integration.el index 35d2eb3..6e3b027 100644 --- a/tramp-integration.el +++ b/tramp-integration.el @@ -174,8 +174,11 @@ NAME must be equal to `tramp-current-connection'." ;;; Default connection-local variables for Tramp: (defconst tramp-connection-local-default-profile - '((shell-file-name . "/bin/sh") - (shell-command-switch . "-c")) + ;; `w32-shell-name' is derived from `shell-file-name'. Don't let it + ;; be confused. + (unless (eq system-type 'windows-nt) + '((shell-file-name . "/bin/sh") + (shell-command-switch . "-c"))) "Default connection-local variables for remote connections.") ;; `connection-local-set-profile-variables' and diff --git a/tramp-rclone.el b/tramp-rclone.el index 0148116..9e99493 100644 --- a/tramp-rclone.el +++ b/tramp-rclone.el @@ -543,7 +543,7 @@ connection if a previous connection has died for some reason." ;; we create a dummy process. Maybe there is a better solution? (unless (get-buffer-process (tramp-get-connection-buffer vec)) (let ((p (make-network-process - :name (tramp-buffer-name vec) + :name (tramp-get-connection-name vec) :buffer (tramp-get-connection-buffer vec) :server t :host 'local :service t :noquery t))) (process-put p 'vector vec) diff --git a/tramp-sh.el b/tramp-sh.el index 11b1af8..34fda5a 100644 --- a/tramp-sh.el +++ b/tramp-sh.el @@ -1027,11 +1027,13 @@ component is used as the target of the symlink." (with-parsed-tramp-file-name linkname nil ;; If TARGET is a Tramp name, use just the localname component. - (when (and (tramp-tramp-file-p target) - (tramp-file-name-equal-p v (tramp-dissect-file-name target))) - (setq target - (tramp-file-name-localname - (tramp-dissect-file-name (expand-file-name target))))) + ;; Don't check for a proper method. + (let ((non-essential t)) + (when (and (tramp-tramp-file-p target) + (tramp-file-name-equal-p v (tramp-dissect-file-name target))) + (setq target + (tramp-file-name-localname + (tramp-dissect-file-name (expand-file-name target)))))) ;; If TARGET is still remote, quote it. (if (tramp-tramp-file-p target) @@ -4769,8 +4771,8 @@ Does not do anything if a connection is already open, but re-opens the connection if a previous connection has died for some reason." (let ((p (tramp-get-connection-process vec)) (process-name (tramp-get-connection-property vec "process-name" nil)) - (pos (with-current-buffer (tramp-get-connection-buffer vec) (point))) - tmp-process-environment) + (process-environment (copy-sequence process-environment)) + (pos (with-current-buffer (tramp-get-connection-buffer vec) (point)))) ;; If Tramp opens the same connection within a short time frame, ;; there is a problem. We shall signal this. @@ -4835,22 +4837,17 @@ connection if a previous connection has died for some reason." ;; Start new process. (when (and p (processp p)) (delete-process p)) - ;; Use a temporary `process-environment', in order not - ;; to penetrate local processes. - (let ((process-environment (copy-sequence process-environment))) - (setenv "TERM" tramp-terminal-type) - (setenv "LC_ALL" (tramp-get-local-locale vec)) - (if (stringp tramp-histfile-override) - (setenv "HISTFILE" tramp-histfile-override) - (if tramp-histfile-override - (progn - (setenv "HISTFILE") - (setenv "HISTFILESIZE" "0") - (setenv "HISTSIZE" "0")))) - (setenv "PROMPT_COMMAND") - (setenv "PS1" tramp-initial-end-of-output) - (setq tmp-process-environment - (copy-sequence process-environment))) + (setenv "TERM" tramp-terminal-type) + (setenv "LC_ALL" (tramp-get-local-locale vec)) + (if (stringp tramp-histfile-override) + (setenv "HISTFILE" tramp-histfile-override) + (if tramp-histfile-override + (progn + (setenv "HISTFILE") + (setenv "HISTFILESIZE" "0") + (setenv "HISTSIZE" "0")))) + (setenv "PROMPT_COMMAND") + (setenv "PS1" tramp-initial-end-of-output) (unless (stringp tramp-encoding-shell) (tramp-error vec 'file-error "`tramp-encoding-shell' not set")) (let* ((current-host (system-name)) @@ -4867,8 +4864,7 @@ connection if a previous connection has died for some reason." ;; This must be done in order to avoid our file ;; name handler. (p (let ((default-directory - (tramp-compat-temporary-file-directory)) - (process-environment tmp-process-environment)) + (tramp-compat-temporary-file-directory))) (apply #'start-process (tramp-get-connection-name vec) diff --git a/tramp-smb.el b/tramp-smb.el index 9d15c05..84725db 100644 --- a/tramp-smb.el +++ b/tramp-smb.el @@ -1161,11 +1161,13 @@ component is used as the target of the symlink." (with-parsed-tramp-file-name linkname nil ;; If TARGET is a Tramp name, use just the localname component. - (when (and (tramp-tramp-file-p target) - (tramp-file-name-equal-p v (tramp-dissect-file-name target))) - (setq target - (tramp-file-name-localname - (tramp-dissect-file-name (expand-file-name target))))) + ;; Don't check for a proper method. + (let ((non-essential t)) + (when (and (tramp-tramp-file-p target) + (tramp-file-name-equal-p v (tramp-dissect-file-name target))) + (setq target + (tramp-file-name-localname + (tramp-dissect-file-name (expand-file-name target)))))) ;; If TARGET is still remote, quote it. (if (tramp-tramp-file-p target) diff --git a/tramp-sudoedit.el b/tramp-sudoedit.el index 0d9e04d..f056e73 100644 --- a/tramp-sudoedit.el +++ b/tramp-sudoedit.el @@ -607,11 +607,13 @@ component is used as the target of the symlink." (with-parsed-tramp-file-name linkname nil ;; If TARGET is a Tramp name, use just the localname component. - (when (and (tramp-tramp-file-p target) - (tramp-file-name-equal-p v (tramp-dissect-file-name target))) - (setq target - (tramp-file-name-localname - (tramp-dissect-file-name (expand-file-name target))))) + ;; Don't check for a proper method. + (let ((non-essential t)) + (when (and (tramp-tramp-file-p target) + (tramp-file-name-equal-p v (tramp-dissect-file-name target))) + (setq target + (tramp-file-name-localname + (tramp-dissect-file-name (expand-file-name target)))))) ;; If TARGET is still remote, quote it. (if (tramp-tramp-file-p target) @@ -780,7 +782,7 @@ connection if a previous connection has died for some reason." (throw 'non-essential 'non-essential)) (let ((p (make-network-process - :name (tramp-buffer-name vec) + :name (tramp-get-connection-name vec) :buffer (tramp-get-connection-buffer vec) :server t :host 'local :service t :noquery t))) (process-put p 'vector vec) diff --git a/tramp.el b/tramp.el index 58f956f..6a3dc19 100644 --- a/tramp.el +++ b/tramp.el @@ -1435,6 +1435,12 @@ default values are used." (setq v (make-tramp-file-name :method method :user user :domain domain :host host :port port :localname localname :hop hop)) + ;; The method must be known. + (unless (or (tramp-completion-mode-p) + (string-equal method tramp-default-method-marker) + (assoc method tramp-methods)) + (tramp-user-error + v "Method `%s' is not known." method)) ;; Only some methods from tramp-sh.el do support multi-hops. (when (and hop @@ -2188,17 +2194,16 @@ Must be handled by the callers." (if (file-name-absolute-p (nth 0 args)) (nth 0 args) default-directory)) + ;; STRING FILE. + ;; Starting with Emacs 26.1, just the 2nd argument of + ;; `make-symbolic-link' matters. + ((eq operation 'make-symbolic-link) (nth 1 args)) ;; FILE DIRECTORY resp FILE1 FILE2. ((member operation '(add-name-to-file copy-directory copy-file file-equal-p file-in-directory-p file-name-all-completions file-name-completion - ;; Starting with Emacs 26.1, just the 2nd argument of - ;; `make-symbolic-link' matters. For backward - ;; compatibility, we still accept the first argument as - ;; file name to be checked. Handled properly in - ;; `tramp-handle-*-make-symbolic-link'. - file-newer-than-file-p make-symbolic-link rename-file)) + file-newer-than-file-p rename-file)) (cond ((tramp-tramp-file-p (nth 0 args)) (nth 0 args)) ((tramp-tramp-file-p (nth 1 args)) (nth 1 args)) @@ -2306,7 +2311,10 @@ preventing reentrant calls of Tramp.") "Invoke Tramp file name handler. Falls back to normal file name handler if no Tramp file name handler exists. If Emacs is compiled --with-threads, the body is protected by a mutex." - (let ((filename (apply #'tramp-file-name-for-operation operation args))) + (let ((filename (apply #'tramp-file-name-for-operation operation args)) + ;; `file-remote-p' is called for everything, even for symbolic + ;; links which look remote. We don't want to get an error. + (non-essential (or non-essential (eq operation 'file-remote-p)))) (if (tramp-tramp-file-p filename) (save-match-data (setq filename (tramp-replace-environment-variables filename)) @@ -4676,6 +4684,7 @@ It always returns a return code. The Lisp error raised when PROGRAM is nil is trapped also, returning 1. Furthermore, traces are written with verbosity of 6." (let ((default-directory (tramp-compat-temporary-file-directory)) + (process-environment (default-toplevel-value 'process-environment)) (destination (if (eq destination t) (current-buffer) destination)) (vec (or vec (car tramp-current-connection))) output error result) @@ -4709,6 +4718,7 @@ It always returns a return code. The Lisp error raised when PROGRAM is nil is trapped also, returning 1. Furthermore, traces are written with verbosity of 6." (let ((default-directory (tramp-compat-temporary-file-directory)) + (process-environment (default-toplevel-value 'process-environment)) (buffer (if (eq buffer t) (current-buffer) buffer)) result) (tramp-message @@ -4738,6 +4748,7 @@ are written with verbosity of 6." If an error occurs, it returns nil. Traces are written with verbosity of 6." (let ((default-directory (tramp-compat-temporary-file-directory)) + (process-environment (default-toplevel-value 'process-environment)) (vec (or vec (car tramp-current-connection))) result) (if args diff --git a/tramp.info b/tramp.info index dcbbca8..f671985 100644 --- a/tramp.info +++ b/tramp.info @@ -246,6 +246,8 @@ TRAMP is included as part of Emacs (since Emacs 22.1). TRAMP is also freely packaged for download on the Internet at <https://ftp.gnu.org/gnu/tramp/>. + TRAMP is available as GNU ELPA (https://elpa.gnu.org) package. + TRAMP development versions are available on Git servers. Development versions contain new and incomplete features. @@ -4096,6 +4098,7 @@ Concept Index * git method: Customizing Methods. (line 37) * GNOME Online Accounts: Quick Start Guide. (line 104) * GNOME Online Accounts <1>: GVFS based methods. (line 47) +* GNU ELPA: Obtaining TRAMP. (line 6) * google drive: Quick Start Guide. (line 104) * google drive <1>: GVFS based methods. (line 34) * gud.el: Remote processes. (line 208) @@ -4300,58 +4303,58 @@ Tag Table: Node: Top933 Node: Overview5348 Node: Obtaining TRAMP10682 -Node: Quick Start Guide11980 -Ref: Quick Start Guide: File name syntax12757 -Ref: Quick Start Guide: ssh and plink methods13859 -Ref: Quick Start Guide: su, sudo and sg methods14403 -Ref: Quick Start Guide: ssh, plink, su, sudo and sg methods14967 -Ref: Quick Start Guide: sudoedit method15497 -Ref: Quick Start Guide: smb method15908 -Ref: Quick Start Guide: GVFS-based methods16239 -Ref: Quick Start Guide: GNOME Online Accounts based methods16651 -Ref: Quick Start Guide: Android17193 -Ref: Quick Start Guide: rclone method17425 -Node: Configuration17752 -Node: Connection types20224 -Node: Inline methods21638 -Node: External methods26301 -Node: GVFS based methods36820 -Node: Default Method39710 -Node: Default User42727 -Node: Default Host44250 -Node: Multi-hops45382 -Node: Firewalls49574 -Node: Customizing Methods51031 -Node: Customizing Completion53371 -Node: Password handling56861 -Ref: Using an authentication file57331 -Ref: Caching passwords58833 -Node: Connection caching59351 -Node: Predefined connection information60281 -Node: Remote programs62626 -Node: Remote shell setup65547 -Node: Android shell setup73757 -Node: Auto-save and Backup76144 -Node: Windows setup hints79219 -Node: Usage80839 -Node: File name syntax82137 -Node: Change file name syntax84144 -Node: File name completion85575 -Node: Ad-hoc multi-hops88648 -Node: Remote processes90714 -Ref: Running a debugger on a remote host99468 -Node: Cleanup remote connections101438 -Node: Archive file names102886 -Node: Bug Reports107245 -Node: Frequently Asked Questions109627 -Node: Files directories and localnames131908 -Node: Localname deconstruction132344 -Node: External packages132997 -Node: Traces and Profiles135042 -Node: GNU Free Documentation License137011 -Node: Function Index162382 -Node: Variable Index164986 -Node: Concept Index171810 +Node: Quick Start Guide12047 +Ref: Quick Start Guide: File name syntax12824 +Ref: Quick Start Guide: ssh and plink methods13926 +Ref: Quick Start Guide: su, sudo and sg methods14470 +Ref: Quick Start Guide: ssh, plink, su, sudo and sg methods15034 +Ref: Quick Start Guide: sudoedit method15564 +Ref: Quick Start Guide: smb method15975 +Ref: Quick Start Guide: GVFS-based methods16306 +Ref: Quick Start Guide: GNOME Online Accounts based methods16718 +Ref: Quick Start Guide: Android17260 +Ref: Quick Start Guide: rclone method17492 +Node: Configuration17819 +Node: Connection types20291 +Node: Inline methods21705 +Node: External methods26368 +Node: GVFS based methods36887 +Node: Default Method39777 +Node: Default User42794 +Node: Default Host44317 +Node: Multi-hops45449 +Node: Firewalls49641 +Node: Customizing Methods51098 +Node: Customizing Completion53438 +Node: Password handling56928 +Ref: Using an authentication file57398 +Ref: Caching passwords58900 +Node: Connection caching59418 +Node: Predefined connection information60348 +Node: Remote programs62693 +Node: Remote shell setup65614 +Node: Android shell setup73824 +Node: Auto-save and Backup76211 +Node: Windows setup hints79286 +Node: Usage80906 +Node: File name syntax82204 +Node: Change file name syntax84211 +Node: File name completion85642 +Node: Ad-hoc multi-hops88715 +Node: Remote processes90781 +Ref: Running a debugger on a remote host99535 +Node: Cleanup remote connections101505 +Node: Archive file names102953 +Node: Bug Reports107312 +Node: Frequently Asked Questions109694 +Node: Files directories and localnames131975 +Node: Localname deconstruction132411 +Node: External packages133064 +Node: Traces and Profiles135109 +Node: GNU Free Documentation License137078 +Node: Function Index162449 +Node: Variable Index165053 +Node: Concept Index171877 End Tag Table