Commit 66feec8b authored by Michael Albinus's avatar Michael Albinus
Browse files

* net/tramp.el (tramp-local-host-regexp): Add "localhost6".

(tramp-file-name-port): Check also for `tramp-default-port'.
(tramp-get-connection-name): New defun.
(tramp-get-connection-process): Use it.
(tramp-debug-message): Extend function exclude list.
(tramp-drop-volume-letter): Fix doc string.

* net/tramp-cmds.el: Remove solved todo item.

* net/tramp-efs.el:
* net/tramp-ftp.el:
* net/tramp-gvfs.el:
* net/tramp-gw.el:
* net/tramp-imap.el:
* net/tramp-smb.el: Fix regexps added to `tramp-default-method-alist'
and `tramp-default-user-alist', respectively.

* net/tramp-gw.el (tramp-gw-open-connection): Use
`tramp-get-connection-name' and `tramp-get-connection-buffer'.

* net/tramp-imap.el (tramp-imap-make-iht): Use just
`tramp-file-name-port'.

* net/tramp-sh.el (tramp-methods): Add recursive options to "pscp"
and "psftp".  Exchange "%k" marker with options.
(tramp-do-copy-or-rename-file, tramp-sh-handle-file-local-copy):
Compute size of link target.
(tramp-do-copy-or-rename-file-out-of-band). Move setting of
`tramp-current-*' up due to gateway methods.  Optimze computing of
copy arguments.  Use `tramp-get-connection-name' and
`tramp-get-connection-buffer'.  Improve debug messages.
(tramp-compute-multi-hops): Remove port determination.
(tramp-maybe-open-connection): Use `tramp-get-connection-name'.

* net/trampver.el: Update release number.
parent 05907bb3
2010-12-02 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-local-host-regexp): Add "localhost6".
(tramp-file-name-port): Check also for `tramp-default-port'.
(tramp-get-connection-name): New defun.
(tramp-get-connection-process): Use it.
(tramp-debug-message): Extend function exclude list.
(tramp-drop-volume-letter): Fix doc string.
* net/tramp-cmds.el: Remove solved todo item.
* net/tramp-efs.el:
* net/tramp-ftp.el:
* net/tramp-gvfs.el:
* net/tramp-gw.el:
* net/tramp-imap.el:
* net/tramp-smb.el: Fix regexps added to `tramp-default-method-alist'
and `tramp-default-user-alist', respectively.
* net/tramp-gw.el (tramp-gw-open-connection): Use
`tramp-get-connection-name' and `tramp-get-connection-buffer'.
* net/tramp-imap.el (tramp-imap-make-iht): Use just
`tramp-file-name-port'.
* net/tramp-sh.el (tramp-methods): Add recursive options to "pscp"
and "psftp". Exchange "%k" marker with options.
(tramp-do-copy-or-rename-file, tramp-sh-handle-file-local-copy):
Compute size of link target.
(tramp-do-copy-or-rename-file-out-of-band). Move setting of
`tramp-current-*' up due to gateway methods. Optimze computing of
copy arguments. Use `tramp-get-connection-name' and
`tramp-get-connection-buffer'. Improve debug messages.
(tramp-compute-multi-hops): Remove port determination.
(tramp-maybe-open-connection): Use `tramp-get-connection-name'.
* net/trampver.el: Update release number.
2010-12-02 Glenn Morris <rgm@gnu.org> 2010-12-02 Glenn Morris <rgm@gnu.org>
* emacs-lisp/cl-macs.el (cl-parse-loop-clause): * emacs-lisp/cl-macs.el (cl-parse-loop-clause):
......
...@@ -363,12 +363,5 @@ please ensure that the buffers are attached to your email.\n\n") ...@@ -363,12 +363,5 @@ please ensure that the buffers are attached to your email.\n\n")
;; flavor) (Reiner Steib) ;; flavor) (Reiner Steib)
;; * Let the user edit the connection properties interactively. ;; * Let the user edit the connection properties interactively.
;; Something like `gnus-server-edit-server' in Gnus' *Server* buffer. ;; Something like `gnus-server-edit-server' in Gnus' *Server* buffer.
;; * It's just that when I come to Customize `tramp-default-user-alist'
;; I'm presented with a mismatch and raw lisp for a value. It is my
;; understanding that a variable declared with defcustom is a User
;; Option and should not be modified by the code. add-to-list is
;; called in several places. One way to handle that is to have a new
;; ordinary variable that gets its initial value from
;; tramp-default-user-alist and then is added to. (Pete Forman)
;;; tramp-cmds.el ends here ;;; tramp-cmds.el ends here
...@@ -107,11 +107,11 @@ present for backward compatibility." ...@@ -107,11 +107,11 @@ present for backward compatibility."
(unless (featurep 'xemacs) (unless (featurep 'xemacs)
(add-to-list 'tramp-methods (cons tramp-ftp-method nil))) (add-to-list 'tramp-methods (cons tramp-ftp-method nil)))
;; Add some defaults for `tramp-default-method-alist' ;; Add some defaults for `tramp-default-method-alist'.
(add-to-list 'tramp-default-method-alist (add-to-list 'tramp-default-method-alist
(list "\\`ftp\\." "" tramp-ftp-method)) (list "\\`ftp\\." nil tramp-ftp-method))
(add-to-list 'tramp-default-method-alist (add-to-list 'tramp-default-method-alist
(list "" "\\`\\(anonymous\\|ftp\\)\\'" tramp-ftp-method)) (list nil "\\`\\(anonymous\\|ftp\\)\\'" tramp-ftp-method))
;; Add completion function for FTP method. ;; Add completion function for FTP method.
(tramp-set-completion-function (tramp-set-completion-function
...@@ -221,5 +221,4 @@ pass to the OPERATION." ...@@ -221,5 +221,4 @@ pass to the OPERATION."
;; * There are no backup files on FTP hosts. ;; * There are no backup files on FTP hosts.
;; arch-tag: 759fb338-5c63-4b99-bd36-b4d59db91cff
;;; tramp-ftp.el ends here ;;; tramp-ftp.el ends here
...@@ -124,8 +124,7 @@ ...@@ -124,8 +124,7 @@
;; Add a default for `tramp-default-user-alist'. Rule: For the SYNCE ;; Add a default for `tramp-default-user-alist'. Rule: For the SYNCE
;; method, no user is chosen. ;; method, no user is chosen.
(add-to-list 'tramp-default-user-alist (add-to-list 'tramp-default-user-alist '("\\`synce\\'" nil nil))
'("synce" nil nil))
(defcustom tramp-gvfs-zeroconf-domain "local" (defcustom tramp-gvfs-zeroconf-domain "local"
"*Zeroconf domain to be used for discovering services, like host names." "*Zeroconf domain to be used for discovering services, like host names."
...@@ -1432,5 +1431,4 @@ They are retrieved from the hal daemon." ...@@ -1432,5 +1431,4 @@ They are retrieved from the hal daemon."
;; capability. ;; capability.
;; * Implement obex for other serial communication but bluetooth. ;; * Implement obex for other serial communication but bluetooth.
;; arch-tag: f7f660ce-77f4-4132-9663-f5c25a47f7ed
;;; tramp-gvfs.el ends here ;;; tramp-gvfs.el ends here
...@@ -44,6 +44,9 @@ ...@@ -44,6 +44,9 @@
(when (featurep 'xemacs) (when (featurep 'xemacs)
(byte-compiler-options (warnings (- unused-vars))))) (byte-compiler-options (warnings (- unused-vars)))))
;; We don't add the following methods to `tramp-methods', in order to
;; exclude them from file name completion.
;; Define HTTP tunnel method ... ;; Define HTTP tunnel method ...
;;;###tramp-autoload ;;;###tramp-autoload
(defconst tramp-gw-tunnel-method "tunnel" (defconst tramp-gw-tunnel-method "tunnel"
...@@ -69,10 +72,12 @@ ...@@ -69,10 +72,12 @@
(list "Default server" "socks" tramp-gw-default-socks-port 5)) (list "Default server" "socks" tramp-gw-default-socks-port 5))
;; Add a default for `tramp-default-user-alist'. Default is the local user. ;; Add a default for `tramp-default-user-alist'. Default is the local user.
(add-to-list 'tramp-default-user-alist (add-to-list
`(,tramp-gw-tunnel-method nil ,(user-login-name))) 'tramp-default-user-alist
(add-to-list 'tramp-default-user-alist (list (concat "\\`"
`(,tramp-gw-socks-method nil ,(user-login-name))) (regexp-opt (list tramp-gw-tunnel-method tramp-gw-socks-method))
"\\'")
nil (user-login-name)))
;; Internal file name functions and variables. ;; Internal file name functions and variables.
...@@ -194,8 +199,8 @@ instead of the host name declared in TARGET-VEC." ...@@ -194,8 +199,8 @@ instead of the host name declared in TARGET-VEC."
(setq tramp-gw-gw-proc (setq tramp-gw-gw-proc
(funcall (funcall
socks-function socks-function
(tramp-buffer-name gw-vec) (tramp-get-connection-name gw-vec)
(tramp-get-buffer gw-vec) (tramp-get-connection-buffer gw-vec)
(tramp-file-name-real-host target-vec) (tramp-file-name-real-host target-vec)
(tramp-file-name-port target-vec))) (tramp-file-name-port target-vec)))
(set-process-sentinel tramp-gw-gw-proc 'tramp-gw-gw-proc-sentinel) (set-process-sentinel tramp-gw-gw-proc 'tramp-gw-gw-proc-sentinel)
...@@ -324,5 +329,4 @@ password in password cache. This is done for the first try only." ...@@ -324,5 +329,4 @@ password in password cache. This is done for the first try only."
;; * Provide descriptive Commentary. ;; * Provide descriptive Commentary.
;; * Enable it for several gateway processes in parallel. ;; * Enable it for several gateway processes in parallel.
;; arch-tag: 277e3a81-fdee-40cf-9e6b-59626292a5e0
;;; tramp-gw.el ends here ;;; tramp-gw.el ends here
...@@ -84,10 +84,6 @@ ...@@ -84,10 +84,6 @@
(add-to-list 'tramp-methods (add-to-list 'tramp-methods
(list tramp-imap-method '(tramp-default-port 143)))) (list tramp-imap-method '(tramp-default-port 143))))
;; Add a default for `tramp-default-user-alist'. Default is the local user.
(add-to-list 'tramp-default-user-alist
`(,tramp-imap-method nil ,(user-login-name)))
;; Define Tramp IMAPS method ... ;; Define Tramp IMAPS method ...
;;;###tramp-autoload ;;;###tramp-autoload
(defconst tramp-imaps-method "imaps" (defconst tramp-imaps-method "imaps"
...@@ -100,8 +96,12 @@ ...@@ -100,8 +96,12 @@
(list tramp-imaps-method '(tramp-default-port 993)))) (list tramp-imaps-method '(tramp-default-port 993))))
;; Add a default for `tramp-default-user-alist'. Default is the local user. ;; Add a default for `tramp-default-user-alist'. Default is the local user.
(add-to-list 'tramp-default-user-alist (add-to-list
`(,tramp-imaps-method nil ,(user-login-name))) 'tramp-default-user-alist
(list (concat "\\`"
(regexp-opt (list tramp-imap-method tramp-imaps-method))
"\\'")
nil (user-login-name)))
;; Add completion function for IMAP method. ;; Add completion function for IMAP method.
;; (tramp-set-completion-function ;; (tramp-set-completion-function
...@@ -746,8 +746,7 @@ With NEEDED-SUBJECT, alters the imap-hash test accordingly." ...@@ -746,8 +746,7 @@ With NEEDED-SUBJECT, alters the imap-hash test accordingly."
(method (tramp-file-name-method vec)) (method (tramp-file-name-method vec))
(user (tramp-file-name-user vec)) (user (tramp-file-name-user vec))
(ssl (string-equal method tramp-imaps-method)) (ssl (string-equal method tramp-imaps-method))
(port (or (tramp-file-name-port vec) (port (tramp-file-name-port vec))
(tramp-get-method-parameter method 'tramp-default-port)))
(result (imap-hash-make server port mbox user nil ssl))) (result (imap-hash-make server port mbox user nil ssl)))
;; Return the IHT with a test override to look for the subject ;; Return the IHT with a test override to look for the subject
;; marker. ;; marker.
...@@ -842,5 +841,3 @@ With NEEDED-SUBJECT, alters the imap-hash test accordingly." ...@@ -842,5 +841,3 @@ With NEEDED-SUBJECT, alters the imap-hash test accordingly."
;;; (tramp-imap-make-iht (tramp-dissect-file-name "/imap:yourhosthere.com:/test/welcommen")) ;;; (tramp-imap-make-iht (tramp-dissect-file-name "/imap:yourhosthere.com:/test/welcommen"))
;;; (tramp-imap-make-iht (tramp-dissect-file-name "/imap:yourhosthere.com:/INBOX.test/4")) ;;; (tramp-imap-make-iht (tramp-dissect-file-name "/imap:yourhosthere.com:/INBOX.test/4"))
;;; (tramp-imap-make-iht (tramp-dissect-file-name "/imap:yourhosthere.com:/INBOX.test/4") "extra") ;;; (tramp-imap-make-iht (tramp-dissect-file-name "/imap:yourhosthere.com:/INBOX.test/4") "extra")
;; arch-tag: f2723749-58fb-4f29-894e-39708096e850
...@@ -91,7 +91,7 @@ detected as prompt when being sent on echoing hosts, therefore.") ...@@ -91,7 +91,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-login-args (("%h") ("-l" "%u"))) (tramp-login-args (("%h") ("-l" "%u")))
(tramp-remote-sh "/bin/sh") (tramp-remote-sh "/bin/sh")
(tramp-copy-program "rcp") (tramp-copy-program "rcp")
(tramp-copy-args (("-p" "%k") ("-r"))) (tramp-copy-args (("%k" "-p") ("-r")))
(tramp-copy-keep-date t) (tramp-copy-keep-date t)
(tramp-copy-recursive t))) (tramp-copy-recursive t)))
;;;###tramp-autoload ;;;###tramp-autoload
...@@ -101,18 +101,17 @@ detected as prompt when being sent on echoing hosts, therefore.") ...@@ -101,18 +101,17 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-login-args (("%h") ("-l" "%u"))) (tramp-login-args (("%h") ("-l" "%u")))
(tramp-remote-sh "/bin/sh") (tramp-remote-sh "/bin/sh")
(tramp-copy-program "rcp") (tramp-copy-program "rcp")
(tramp-copy-args (("-p" "%k"))) (tramp-copy-args (("%k" "-p")))
(tramp-copy-keep-date t))) (tramp-copy-keep-date t)))
;;;###tramp-autoload ;;;###tramp-autoload
(add-to-list (add-to-list 'tramp-methods
'tramp-methods
'("scp" '("scp"
(tramp-login-program "ssh") (tramp-login-program "ssh")
(tramp-login-args (("-l" "%u") ("-p" "%p") ("-e" "none") ("%h"))) (tramp-login-args (("-l" "%u") ("-p" "%p") ("-e" "none") ("%h")))
(tramp-async-args (("-q"))) (tramp-async-args (("-q")))
(tramp-remote-sh "/bin/sh") (tramp-remote-sh "/bin/sh")
(tramp-copy-program "scp") (tramp-copy-program "scp")
(tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") ("-r"))) (tramp-copy-args (("-P" "%p") ("%k" "-p") ("-q") ("-r")))
(tramp-copy-keep-date t) (tramp-copy-keep-date t)
(tramp-copy-recursive t) (tramp-copy-recursive t)
(tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
...@@ -128,7 +127,7 @@ detected as prompt when being sent on echoing hosts, therefore.") ...@@ -128,7 +127,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-async-args (("-q"))) (tramp-async-args (("-q")))
(tramp-remote-sh "/bin/sh") (tramp-remote-sh "/bin/sh")
(tramp-copy-program "scp") (tramp-copy-program "scp")
(tramp-copy-args (("-1") ("-P" "%p") ("-p" "%k") ("-q") ("-r"))) (tramp-copy-args (("-1") ("-P" "%p") ("%k" "-p") ("-q") ("-r")))
(tramp-copy-keep-date t) (tramp-copy-keep-date t)
(tramp-copy-recursive t) (tramp-copy-recursive t)
(tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
...@@ -144,7 +143,7 @@ detected as prompt when being sent on echoing hosts, therefore.") ...@@ -144,7 +143,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-async-args (("-q"))) (tramp-async-args (("-q")))
(tramp-remote-sh "/bin/sh") (tramp-remote-sh "/bin/sh")
(tramp-copy-program "scp") (tramp-copy-program "scp")
(tramp-copy-args (("-2") ("-P" "%p") ("-p" "%k") ("-q") ("-r"))) (tramp-copy-args (("-2") ("-P" "%p") ("%k" "-p") ("-q") ("-r")))
(tramp-copy-keep-date t) (tramp-copy-keep-date t)
(tramp-copy-recursive t) (tramp-copy-recursive t)
(tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
...@@ -162,7 +161,7 @@ detected as prompt when being sent on echoing hosts, therefore.") ...@@ -162,7 +161,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-async-args (("-q"))) (tramp-async-args (("-q")))
(tramp-remote-sh "/bin/sh") (tramp-remote-sh "/bin/sh")
(tramp-copy-program "scp") (tramp-copy-program "scp")
(tramp-copy-args (("-P" "%p") ("-p" "%k") ("-q") (tramp-copy-args (("-P" "%p") ("%k" "-p") ("-q")
("-o" "ControlPath=%t.%%r@%%h:%%p") ("-o" "ControlPath=%t.%%r@%%h:%%p")
("-o" "ControlMaster=auto"))) ("-o" "ControlMaster=auto")))
(tramp-copy-keep-date t) (tramp-copy-keep-date t)
...@@ -180,7 +179,7 @@ detected as prompt when being sent on echoing hosts, therefore.") ...@@ -180,7 +179,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-async-args (("-q"))) (tramp-async-args (("-q")))
(tramp-remote-sh "/bin/sh") (tramp-remote-sh "/bin/sh")
(tramp-copy-program "scp") (tramp-copy-program "scp")
(tramp-copy-args (("-p" "%k"))) (tramp-copy-args (("%k" "-p")))
(tramp-copy-keep-date t) (tramp-copy-keep-date t)
(tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null") (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
("-o" "UserKnownHostsFile=/dev/null") ("-o" "UserKnownHostsFile=/dev/null")
...@@ -202,7 +201,7 @@ detected as prompt when being sent on echoing hosts, therefore.") ...@@ -202,7 +201,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-async-args (("-q"))) (tramp-async-args (("-q")))
(tramp-remote-sh "/bin/sh") (tramp-remote-sh "/bin/sh")
(tramp-copy-program "rsync") (tramp-copy-program "rsync")
(tramp-copy-args (("-e" "ssh") ("-t" "%k") ("-r"))) (tramp-copy-args (("-e" "ssh") ("%k" "-t") ("-r")))
(tramp-copy-keep-date t) (tramp-copy-keep-date t)
(tramp-copy-keep-tmpfile t) (tramp-copy-keep-tmpfile t)
(tramp-copy-recursive t))) (tramp-copy-recursive t)))
...@@ -217,7 +216,7 @@ detected as prompt when being sent on echoing hosts, therefore.") ...@@ -217,7 +216,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-async-args (("-q"))) (tramp-async-args (("-q")))
(tramp-remote-sh "/bin/sh") (tramp-remote-sh "/bin/sh")
(tramp-copy-program "rsync") (tramp-copy-program "rsync")
(tramp-copy-args (("-t" "%k") ("-r"))) (tramp-copy-args (("%k" "-t") ("-r")))
(tramp-copy-env (("RSYNC_RSH") (tramp-copy-env (("RSYNC_RSH")
(,(concat (,(concat
"ssh" "ssh"
...@@ -347,8 +346,10 @@ detected as prompt when being sent on echoing hosts, therefore.") ...@@ -347,8 +346,10 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%h"))) (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%h")))
(tramp-remote-sh "/bin/sh") (tramp-remote-sh "/bin/sh")
(tramp-copy-program "pscp") (tramp-copy-program "pscp")
(tramp-copy-args (("-P" "%p") ("-scp") ("-p" "%k"))) (tramp-copy-args (("-P" "%p") ("-scp") ("%k" "-p")
("-q") ("-r")))
(tramp-copy-keep-date t) (tramp-copy-keep-date t)
(tramp-copy-recursive t)
(tramp-password-end-of-line "xy") ;see docstring for "xy" (tramp-password-end-of-line "xy") ;see docstring for "xy"
(tramp-default-port 22))) (tramp-default-port 22)))
;;;###tramp-autoload ;;;###tramp-autoload
...@@ -358,8 +359,10 @@ detected as prompt when being sent on echoing hosts, therefore.") ...@@ -358,8 +359,10 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%h"))) (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%h")))
(tramp-remote-sh "/bin/sh") (tramp-remote-sh "/bin/sh")
(tramp-copy-program "pscp") (tramp-copy-program "pscp")
(tramp-copy-args (("-P" "%p") ("-sftp") ("-p" "%k"))) (tramp-copy-args (("-P" "%p") ("-sftp") ("%k" "-p")
("-q") ("-r")))
(tramp-copy-keep-date t) (tramp-copy-keep-date t)
(tramp-copy-recursive t)
(tramp-password-end-of-line "xy"))) ;see docstring for "xy" (tramp-password-end-of-line "xy"))) ;see docstring for "xy"
;;;###tramp-autoload ;;;###tramp-autoload
(add-to-list 'tramp-methods (add-to-list 'tramp-methods
...@@ -368,7 +371,7 @@ detected as prompt when being sent on echoing hosts, therefore.") ...@@ -368,7 +371,7 @@ detected as prompt when being sent on echoing hosts, therefore.")
(tramp-login-args (("%h") ("-l" "%u") ("sh" "-i"))) (tramp-login-args (("%h") ("-l" "%u") ("sh" "-i")))
(tramp-remote-sh "/bin/sh -i") (tramp-remote-sh "/bin/sh -i")
(tramp-copy-program "fcp") (tramp-copy-program "fcp")
(tramp-copy-args (("-p" "%k"))) (tramp-copy-args (("%k" "-p")))
(tramp-copy-keep-date t))) (tramp-copy-keep-date t)))
(add-to-list 'tramp-default-method-alist (add-to-list 'tramp-default-method-alist
...@@ -1943,7 +1946,7 @@ file names." ...@@ -1943,7 +1946,7 @@ file names."
;; Try out-of-band operation. ;; Try out-of-band operation.
((tramp-method-out-of-band-p ((tramp-method-out-of-band-p
v1 (nth 7 (file-attributes filename))) v1 (nth 7 (file-attributes (file-truename filename))))
(tramp-do-copy-or-rename-file-out-of-band (tramp-do-copy-or-rename-file-out-of-band
op filename newname keep-date)) op filename newname keep-date))
...@@ -1971,7 +1974,8 @@ file names." ...@@ -1971,7 +1974,8 @@ file names."
;; If the Tramp file has an out-of-band method, the ;; If the Tramp file has an out-of-band method, the
;; corresponding copy-program can be invoked. ;; corresponding copy-program can be invoked.
((tramp-method-out-of-band-p v (nth 7 (file-attributes filename))) ((tramp-method-out-of-band-p
v (nth 7 (file-attributes (file-truename filename))))
(tramp-do-copy-or-rename-file-out-of-band (tramp-do-copy-or-rename-file-out-of-band
op filename newname keep-date)) op filename newname keep-date))
...@@ -2178,10 +2182,11 @@ the uid and gid from FILENAME." ...@@ -2178,10 +2182,11 @@ the uid and gid from FILENAME."
(defun tramp-do-copy-or-rename-file-out-of-band (op filename newname keep-date) (defun tramp-do-copy-or-rename-file-out-of-band (op filename newname keep-date)
"Invoke rcp program to copy. "Invoke rcp program to copy.
The method used must be an out-of-band method." The method used must be an out-of-band method."
(let ((t1 (tramp-tramp-file-p filename)) (let* ((t1 (tramp-tramp-file-p filename))
(t2 (tramp-tramp-file-p newname)) (t2 (tramp-tramp-file-p newname))
copy-program copy-args copy-env copy-keep-date port spec (orig-vec (tramp-dissect-file-name (if t1 filename newname)))
source target) copy-program copy-args copy-env copy-keep-date port spec
source target)
(with-parsed-tramp-file-name (if t1 filename newname) nil (with-parsed-tramp-file-name (if t1 filename newname) nil
(if (and t1 t2) (if (and t1 t2)
...@@ -2207,6 +2212,12 @@ The method used must be an out-of-band method." ...@@ -2207,6 +2212,12 @@ The method used must be an out-of-band method."
(expand-file-name ".." tmpfile) 'recursive) (expand-file-name ".." tmpfile) 'recursive)
(delete-file tmpfile))))) (delete-file tmpfile)))))
;; Set variables for computing the prompt for reading
;; password.
(setq tramp-current-method (tramp-file-name-method v)
tramp-current-user (tramp-file-name-user v)
tramp-current-host (tramp-file-name-host v))
;; Expand hops. Might be necessary for gateway methods. ;; Expand hops. Might be necessary for gateway methods.
(setq v (car (tramp-compute-multi-hops v))) (setq v (car (tramp-compute-multi-hops v)))
(aset v 3 localname) (aset v 3 localname)
...@@ -2239,16 +2250,20 @@ The method used must be an out-of-band method." ...@@ -2239,16 +2250,20 @@ The method used must be an out-of-band method."
copy-keep-date (tramp-get-method-parameter copy-keep-date (tramp-get-method-parameter
method 'tramp-copy-keep-date) method 'tramp-copy-keep-date)
copy-args copy-args
(delq (delete
nil ;; " " has either been a replacement of "%k" (when
(mapcar ;; keep-date argument is non-nil), or a replacemtent
(lambda (x) ;; for the whole keep-date sublist.
(setq " "
x (dolist
;; " " is indication for keep-date argument. (x
(delete " " (mapcar (lambda (y) (format-spec y spec)) x))) (tramp-get-method-parameter method 'tramp-copy-args)
(unless (member "" x) (mapconcat 'identity x " "))) copy-args)
(tramp-get-method-parameter method 'tramp-copy-args))) (setq copy-args
(append
copy-args
(let ((y (mapcar (lambda (z) (format-spec z spec)) x)))
(if (zerop (length (car y))) '(" ") y))))))
copy-env copy-env
(delq (delq
nil nil
...@@ -2266,14 +2281,8 @@ The method used must be an out-of-band method." ...@@ -2266,14 +2281,8 @@ The method used must be an out-of-band method."
(tramp-error (tramp-error
v 'file-error "Cannot find copy program: %s" copy-program)) v 'file-error "Cannot find copy program: %s" copy-program))
;; Set variables for computing the prompt for reading (with-temp-buffer
;; password. (unwind-protect
(setq tramp-current-method (tramp-file-name-method v)
tramp-current-user (tramp-file-name-user v)
tramp-current-host (tramp-file-name-host v))
(unwind-protect
(with-temp-buffer
;; The default directory must be remote. ;; The default directory must be remote.
(let ((default-directory (let ((default-directory
(file-name-directory (if t1 filename newname))) (file-name-directory (if t1 filename newname)))
...@@ -2284,7 +2293,8 @@ The method used must be an out-of-band method." ...@@ -2284,7 +2293,8 @@ The method used must be an out-of-band method."
(tramp-set-connection-property (tramp-set-connection-property
v "process-buffer" (current-buffer)) v "process-buffer" (current-buffer))
(while copy-env (while copy-env
(tramp-message v 5 "%s=\"%s\"" (car copy-env) (cadr copy-env)) (tramp-message
orig-vec 5 "%s=\"%s\"" (car copy-env) (cadr copy-env))
(setenv (pop copy-env) (pop copy-env))) (setenv (pop copy-env) (pop copy-env)))
;; Use an asynchronous process. By this, password can ;; Use an asynchronous process. By this, password can
...@@ -2295,20 +2305,20 @@ The method used must be an out-of-band method." ...@@ -2295,20 +2305,20 @@ The method used must be an out-of-band method."
(let ((p (let ((default-directory (let ((p (let ((default-directory
(tramp-compat-temporary-file-directory))) (tramp-compat-temporary-file-directory)))
(apply 'start-process (apply 'start-process
(tramp-get-connection-property (tramp-get-connection-name v)
v "process-name" nil) (tramp-get-connection-buffer v)
(tramp-get-connection-property
v "process-buffer" nil)
copy-program copy-program
(append copy-args (list source target)))))) (append copy-args (list source target))))))
(tramp-message (tramp-message
v 6 "%s" (mapconcat 'identity (process-command p) " ")) orig-vec 6 "%s"
(mapconcat 'identity (process-command p) " "))
(tramp-compat-set-process-query-on-exit-flag p nil) (tramp-compat-set-process-query-on-exit-flag p nil)
(tramp-process-actions p v tramp-actions-copy-out-of-band)))) (tramp-process-actions p v tramp-actions-copy-out-of-band)))
;; Reset the transfer process properties. ;; Reset the transfer process properties.
(tramp-set-connection-property v "process-name" nil) (tramp-message orig-vec 6 "%s" (buffer-string))
(tramp-set-connection-property v "process-buffer" nil)) (tramp-set-connection-property v "process-name" nil)
(tramp-set-connection-property v "process-buffer" nil)))
;; Handle KEEP-DATE argument. ;; Handle KEEP-DATE argument.
(when (and keep-date (not copy-keep-date)) (when (and keep-date (not copy-keep-date))
...@@ -2895,7 +2905,7 @@ the result will be a local, non-Tramp, filename." ...@@ -2895,7 +2905,7 @@ the result will be a local, non-Tramp, filename."
v 'file-error v 'file-error
"Cannot make local copy of non-existing file `%s'" filename)) "Cannot make local copy of non-existing file `%s'" filename))
(let* ((size (nth 7 (file-attributes filename))) (let* ((size (nth 7 (file-attributes (file-truename filename))))
(rem-enc (tramp-get-inline-coding v "remote-encoding" size)) (rem-enc (tramp-get-inline-coding v "remote-encoding" size))
(loc-dec (tramp-get-inline-coding v "local-decoding" size)) (loc-dec (tramp-get-inline-coding v "local-decoding" size))
(tmpfile (tramp-compat-make-temp-file filename))) (tmpfile (tramp-compat-make-temp-file filename)))
...@@ -4103,22 +4113,10 @@ Gateway hops are already opened." ...@@ -4103,22 +4113,10 @@ Gateway hops are already opened."
(let ((gw (pop target-alist)) (let ((gw (pop target-alist))
(hop (pop target-alist))) (hop (pop target-alist)))
;; Is the method prepared for gateways? ;; Is the method prepared for gateways?
(unless (tramp-get-method-parameter (unless (tramp-file-name-port hop)
(tramp-file-name-method hop) 'tramp-default-port)
(tramp-error (tramp-error
vec 'file-error vec 'file-error
"Method `%s' is not supported for gateway access." "Connection `%s' is not supported for gateway access." hop))
(tramp-file-name-method hop)))
;; Add default port if needed.
(unless
(string-match
tramp-host-with-port-regexp (tramp-file-name-host hop))
(aset hop 2
(concat
(tramp-file-name-host hop) tramp-prefix-port-format
(number-to-string
(tramp-get-method-parameter
(tramp-file-name-method hop) 'tramp-default-port)))))
;; Open the gateway connection. ;; Open the gateway connection.
(add-to-list (add-to-list
'target-alist 'target-alist
...@@ -4238,7 +4236,7 @@ connection if a previous connection has died for some reason." ...@@ -4238,7 +4236,7 @@ connection if a previous connection has died for some reason."