[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 61e96789dd: Activate direct asynchronous processes for Tramp cont
From: |
Michael Albinus |
Subject: |
master 61e96789dd: Activate direct asynchronous processes for Tramp container methods |
Date: |
Mon, 21 Nov 2022 08:50:09 -0500 (EST) |
branch: master
commit 61e96789ddb1fe81520c3b1cc6c7ff43da5bc26f
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>
Activate direct asynchronous processes for Tramp container methods
* doc/misc/tramp.texi (Remote processes): Mention also
tramp-container.el.
* lisp/emacs-lisp/ert-x.el (ert-remote-temporary-file-directory):
Add `tramp-direct-async' to "mock" method.
* lisp/net/tramp-container.el
(tramp-methods) <docker, podman, kubernetes>: Add `tramp-direct-async'.
* lisp/net/tramp.el (tramp-methods): Adapt docstring.
(tramp-handle-make-process): Handle `tramp-direct-async'.
* test/lisp/net/tramp-tests.el (tramp-methods) <mock>:
Add `tramp-direct-async'.
---
doc/misc/tramp.texi | 5 +++--
lisp/emacs-lisp/ert-x.el | 1 +
lisp/net/tramp-container.el | 3 +++
lisp/net/tramp.el | 14 +++++++++++---
test/lisp/net/tramp-tests.el | 7 ++++---
5 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index 19f82b2447..403c0daa67 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -4253,8 +4253,9 @@ Furthermore, this approach has the following limitations:
@itemize
@item
-It works only for connection methods defined in @file{tramp-adb.el},
-@file{tramp-sh.el} and @file{tramp-sshfs.el}.
+It works only for some connection methods defined in
+@file{tramp-adb.el}, @file{tramp-container.el}, @file{tramp-sh.el} and
+@file{tramp-sshfs.el}.
@item
It does not support interactive user authentication. With
diff --git a/lisp/emacs-lisp/ert-x.el b/lisp/emacs-lisp/ert-x.el
index a891f068a7..49f2a1d696 100644
--- a/lisp/emacs-lisp/ert-x.el
+++ b/lisp/emacs-lisp/ert-x.el
@@ -560,6 +560,7 @@ The same keyword arguments are supported as in
'("mock"
(tramp-login-program "sh")
(tramp-login-args (("-i")))
+ (tramp-direct-async ("-c"))
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell-args ("-c"))
(tramp-connection-timeout 10)))
diff --git a/lisp/net/tramp-container.el b/lisp/net/tramp-container.el
index 328625b776..7b94253226 100644
--- a/lisp/net/tramp-container.el
+++ b/lisp/net/tramp-container.el
@@ -163,6 +163,7 @@ see its function help for a description of the format."
("-u" "%u")
("%h")
("%l")))
+ (tramp-direct-async (,tramp-default-remote-shell "-c"))
(tramp-remote-shell ,tramp-default-remote-shell)
(tramp-remote-shell-login ("-l"))
(tramp-remote-shell-args ("-i" "-c"))))
@@ -174,6 +175,7 @@ see its function help for a description of the format."
("-u" "%u")
("%h")
("%l")))
+ (tramp-direct-async (,tramp-default-remote-shell "-c"))
(tramp-remote-shell ,tramp-default-remote-shell)
(tramp-remote-shell-login ("-l"))
(tramp-remote-shell-args ("-i" "-c"))))
@@ -186,6 +188,7 @@ see its function help for a description of the format."
("--")
("%l")))
(tramp-config-check tramp-kubernetes--current-context-data)
+ (tramp-direct-async (,tramp-default-remote-shell "-c"))
(tramp-remote-shell ,tramp-default-remote-shell)
(tramp-remote-shell-login ("-l"))
(tramp-remote-shell-args ("-i" "-c"))))
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index b08bc63e8a..e9f30bea7b 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -278,8 +278,9 @@ pair of the form (KEY VALUE). The following KEYs are
defined:
* `tramp-direct-async'
Whether the method supports direct asynchronous processes.
- Until now, just \"ssh\"-based, \"sshfs\"-based and
- \"adb\"-based methods do.
+ Until now, just \"ssh\"-based, \"sshfs\"-based, \"adb\"-based
+ and container methods do. If it is a list of strings, they
+ are used to construct the remote command.
* `tramp-config-check'
A function to be called with one argument, VEC. It should
@@ -4804,7 +4805,14 @@ substitution. SPEC-LIST is a list of char/value pairs
used for
(command
(append
`("cd" ,(tramp-shell-quote-argument localname) "&&" "(" "env")
- env `(,command ")"))))
+ env `(,command ")")))
+ ;; Add remote shell if needed.
+ (command
+ (if (consp (tramp-get-method-parameter v 'tramp-direct-async))
+ (append
+ (tramp-get-method-parameter v 'tramp-direct-async)
+ `(,(mapconcat #'identity command " ")))
+ command)))
;; Check for `tramp-sh-file-name-handler', because something
;; is different between tramp-sh.el, and tramp-adb.el or
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 46fef558bf..a5bae46a58 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -140,10 +140,11 @@ A resource file is in the resource directory as per
((eq system-type 'windows-nt) null-device)
(t (add-to-list
'tramp-methods
- '("mock"
- (tramp-login-program "sh")
+ `("mock"
+ (tramp-login-program ,tramp-default-remote-shell)
(tramp-login-args (("-i")))
- (tramp-remote-shell "/bin/sh")
+ (tramp-direct-async ("-c"))
+ (tramp-remote-shell ,tramp-default-remote-shell)
(tramp-remote-shell-args ("-c"))
(tramp-connection-timeout 10)))
(add-to-list
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 61e96789dd: Activate direct asynchronous processes for Tramp container methods,
Michael Albinus <=