[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r111861: * net/tramp.el (tramp-method
From: |
Michael Albinus |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r111861: * net/tramp.el (tramp-methods): Fix docstring. |
Date: |
Sat, 23 Feb 2013 13:40:14 +0100 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 111861
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Sat 2013-02-23 13:40:14 +0100
message:
* net/tramp.el (tramp-methods): Fix docstring.
(tramp-ssh-controlmaster-options): Rename it from
`tramp-ssh-controlmaster-template'. Return a string.
(tramp-default-method): Adapt check for
`tramp-ssh-controlmaster-options'.
* net/tramp-sh.el (tramp-methods): Replace
`tramp-ssh-controlmaster-template' by "%c".
(tramp-do-copy-or-rename-file-out-of-band)
(tramp-maybe-open-connection): Use it in format spec. Ensure,
that it is applied for the first hop only.
modified:
lisp/ChangeLog
lisp/net/tramp-sh.el
lisp/net/tramp.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2013-02-22 17:13:05 +0000
+++ b/lisp/ChangeLog 2013-02-23 12:40:14 +0000
@@ -1,3 +1,17 @@
+2013-02-23 Michael Albinus <address@hidden>
+
+ * net/tramp.el (tramp-methods): Fix docstring.
+ (tramp-ssh-controlmaster-options): Rename it from
+ `tramp-ssh-controlmaster-template'. Return a string.
+ (tramp-default-method): Adapt check for
+ `tramp-ssh-controlmaster-options'.
+
+ * net/tramp-sh.el (tramp-methods): Replace
+ `tramp-ssh-controlmaster-template' by "%c".
+ (tramp-do-copy-or-rename-file-out-of-band)
+ (tramp-maybe-open-connection): Use it in format spec. Ensure,
+ that it is applied for the first hop only.
+
2013-02-22 Juri Linkov <address@hidden>
* isearch.el (isearch-lazy-highlight-new-loop):
=== modified file 'lisp/net/tramp-sh.el'
--- a/lisp/net/tramp-sh.el 2013-02-22 14:05:38 +0000
+++ b/lisp/net/tramp-sh.el 2013-02-23 12:40:14 +0000
@@ -109,17 +109,15 @@
(tramp-copy-keep-date t)))
;;;###tramp-autoload
(add-to-list 'tramp-methods
- `("scp"
+ '("scp"
(tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
+ (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
("-e" "none") ("%h")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell-args ("-c"))
(tramp-copy-program "scp")
- (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r")
- ,tramp-ssh-controlmaster-template))
+ (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r") ("%c")))
(tramp-copy-keep-date t)
(tramp-copy-recursive t)
(tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
@@ -128,17 +126,16 @@
(tramp-default-port 22)))
;;;###tramp-autoload
(add-to-list 'tramp-methods
- `("scp1"
+ '("scp1"
(tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
+ (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
("-1") ("-e" "none") ("%h")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell-args ("-c"))
(tramp-copy-program "scp")
- (tramp-copy-args (("-1") ("-P" "%p") ("-p" "%k") ("-q") ("-r")
- ,tramp-ssh-controlmaster-template))
+ (tramp-copy-args (("-1") ("-P" "%p") ("-p" "%k")
+ ("-q") ("-r") ("%c")))
(tramp-copy-keep-date t)
(tramp-copy-recursive t)
(tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
@@ -147,17 +144,16 @@
(tramp-default-port 22)))
;;;###tramp-autoload
(add-to-list 'tramp-methods
- `("scp2"
+ '("scp2"
(tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
+ (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
("-2") ("-e" "none") ("%h")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell-args ("-c"))
(tramp-copy-program "scp")
- (tramp-copy-args (("-2") ("-P" "%p") ("-p" "%k") ("-q") ("-r")
- ,tramp-ssh-controlmaster-template))
+ (tramp-copy-args (("-2") ("-P" "%p") ("-p" "%k")
+ ("-q") ("-r") ("%c")))
(tramp-copy-keep-date t)
(tramp-copy-recursive t)
(tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
@@ -166,17 +162,16 @@
(tramp-default-port 22)))
;;;###tramp-autoload
(add-to-list 'tramp-methods
- `("scpx"
+ '("scpx"
(tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
+ (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
("-e" "none") ("-t" "-t") ("%h") ("/bin/sh")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell-args ("-c"))
(tramp-copy-program "scp")
- (tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r")
- ,tramp-ssh-controlmaster-template))
+ (tramp-copy-args (("-P" "%p") ("-p" "%k")
+ ("-q") ("-r") ("%c")))
(tramp-copy-keep-date t)
(tramp-copy-recursive t)
(tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
@@ -185,34 +180,27 @@
(tramp-default-port 22)))
;;;###tramp-autoload
(add-to-list 'tramp-methods
- `("sftp"
+ '("sftp"
(tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
+ (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
("-e" "none") ("%h")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell-args ("-c"))
(tramp-copy-program "sftp")
- (tramp-copy-args ,tramp-ssh-controlmaster-template)))
+ (tramp-copy-args ("%c"))))
;;;###tramp-autoload
(add-to-list 'tramp-methods
- `("rsync"
+ '("rsync"
(tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
+ (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
("-e" "none") ("%h")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell-args ("-c"))
(tramp-copy-program "rsync")
(tramp-copy-args (("-t" "%k") ("-r")))
- (tramp-copy-env (("RSYNC_RSH")
- (,(mapconcat
- 'identity
- (append
- '("ssh") tramp-ssh-controlmaster-template)
- " "))))
+ (tramp-copy-env (("RSYNC_RSH") ("ssh" "%c")))
(tramp-copy-keep-date t)
(tramp-copy-keep-tmpfile t)
(tramp-copy-recursive t)))
@@ -232,10 +220,9 @@
(tramp-remote-shell-args ("-c"))))
;;;###tramp-autoload
(add-to-list 'tramp-methods
- `("ssh"
+ '("ssh"
(tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
+ (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
("-e" "none") ("%h")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
@@ -246,10 +233,9 @@
(tramp-default-port 22)))
;;;###tramp-autoload
(add-to-list 'tramp-methods
- `("ssh1"
+ '("ssh1"
(tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
+ (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
("-1") ("-e" "none") ("%h")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
@@ -260,10 +246,9 @@
(tramp-default-port 22)))
;;;###tramp-autoload
(add-to-list 'tramp-methods
- `("ssh2"
+ '("ssh2"
(tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
+ (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
("-2") ("-e" "none") ("%h")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
@@ -274,10 +259,9 @@
(tramp-default-port 22)))
;;;###tramp-autoload
(add-to-list 'tramp-methods
- `("sshx"
+ '("sshx"
(tramp-login-program "ssh")
- (tramp-login-args (("-l" "%u") ("-p" "%p")
- ,tramp-ssh-controlmaster-template
+ (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
("-e" "none") ("-t" "-t") ("%h") ("/bin/sh")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
@@ -2274,7 +2258,7 @@
(t2 (tramp-tramp-file-p newname))
(orig-vec (tramp-dissect-file-name (if t1 filename newname)))
copy-program copy-args copy-env copy-keep-date port spec
- source target)
+ options source target)
(with-parsed-tramp-file-name (if t1 filename newname) nil
(if (and t1 t2)
@@ -2342,9 +2326,11 @@
user (or user "")
port (or port "")
spec (format-spec-make
- ?h host ?u user ?p port
?t (tramp-get-connection-property
- (tramp-get-connection-process v) "temp-file" "")
+ (tramp-get-connection-process v) "temp-file" ""))
+ options (format-spec tramp-ssh-controlmaster-options spec)
+ spec (format-spec-make
+ ?h host ?u user ?p port ?c options
?k (if keep-date " " ""))
copy-program (tramp-get-method-parameter
method 'tramp-copy-program)
@@ -4404,6 +4390,9 @@
(setenv "PROMPT_COMMAND")
(setenv "PS1" tramp-initial-end-of-output)
(let* ((target-alist (tramp-compute-multi-hops vec))
+ ;; We will apply `tramp-ssh-controlmaster-options'
+ ;; only for the first hop.
+ (options tramp-ssh-controlmaster-options)
(process-connection-type tramp-process-connection-type)
(process-adaptive-read-buffering nil)
(coding-system-for-read nil)
@@ -4508,8 +4497,10 @@
l-host (or l-host "")
l-user (or l-user "")
l-port (or l-port "")
+ spec (format-spec-make ?t tmpfile)
+ options (format-spec options spec)
spec (format-spec-make
- ?h l-host ?u l-user ?p l-port ?t tmpfile)
+ ?h l-host ?u l-user ?p l-port ?c options)
command
(concat
;; We do not want to see the trailing local
@@ -4536,7 +4527,8 @@
(tramp-message
vec 3 "Found remote shell prompt on `%s'" l-host))
;; Next hop.
- (setq target-alist (cdr target-alist)))
+ (setq options ""
+ target-alist (cdr target-alist)))
;; Make initial shell settings.
(tramp-open-connection-setup-interactive-shell p vec))))
=== modified file 'lisp/net/tramp.el'
--- a/lisp/net/tramp.el 2013-02-22 14:05:38 +0000
+++ b/lisp/net/tramp.el 2013-02-23 12:40:14 +0000
@@ -220,7 +220,8 @@
argument. By this, arguments like (\"-l\" \"%u\") are optional.
\"%t\" is replaced by the temporary file name produced with
`tramp-make-tramp-temp-file'. \"%k\" indicates the keep-date
- parameter of a program, if exists.
+ parameter of a program, if exists. \"%c\" adds additional
+ `tramp-ssh-controlmaster-options' options for the first hop.
* `tramp-async-args'
When an asynchronous process is started, we know already that
the connection works. Therefore, we can pass additional
@@ -281,25 +282,23 @@
useful only in combination with `tramp-default-proxies-alist'.")
;;;###tramp-autoload
-(defconst tramp-ssh-controlmaster-template
- (let (result)
+(defconst tramp-ssh-controlmaster-options
+ (let ((result ""))
(ignore-errors
(with-temp-buffer
(call-process "ssh" nil t nil "-o" "ControlMaster")
(goto-char (point-min))
(when (search-forward-regexp "Missing ControlMaster argument" nil t)
- (setq result
- '("-o" "address@hidden:%%p"
- "-o" "ControlMaster=auto"))))
+ (setq result "-o address@hidden:%%p -o ControlMaster=auto")))
(when result
(with-temp-buffer
(call-process "ssh" nil t nil "-o" "ControlPersist")
(goto-char (point-min))
(when (search-forward-regexp "Missing ControlPersist argument" nil t)
- (setq result (append result '("-o" "ControlPersist=no")))))))
+ (setq result (concat result " -o ControlPersist=no"))))))
result)
"Call ssh to detect whether it supports the Control* arguments.
-Return a template to be used in `tramp-methods'.")
+Return a string to be used in `tramp-methods'.")
(defcustom tramp-default-method
;; An external copy method seems to be preferred, because it performs
@@ -333,7 +332,7 @@
(getenv "SSH_AUTH_SOCK")
(getenv "SSH_AGENT_PID")
;; We could reuse the connection.
- tramp-ssh-controlmaster-template)
+ (> (length tramp-ssh-controlmaster-options) 0))
"scp"
"ssh"))
;; Fallback.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r111861: * net/tramp.el (tramp-methods): Fix docstring.,
Michael Albinus <=