aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2013-03-01 09:13:53 +0100
committerMichael Albinus2013-03-01 09:13:53 +0100
commit36a8b68b3381b77971c0fd655a8e7f41ecc58426 (patch)
tree523023047fbfbe9ce5f776a8e6d665fa27b0b111
parent4a83d19e56d3d13f254b406fcd569ba9b5fe0cfd (diff)
downloademacs-36a8b68b3381b77971c0fd655a8e7f41ecc58426.tar.gz
emacs-36a8b68b3381b77971c0fd655a8e7f41ecc58426.zip
* net/tramp.el (tramp-obsolete-methods): New defconst.
(tramp-warned-obsolete-methods): New defvar. (tramp-find-method): Check for obsolete methods. Map them to a replacement method if appropriate. * net/tramp-sh.el (tramp-methods) [scp1, scp2, ssh1, ssh2, plink1]: Remove methods. (top): Remove completion functions for "scp1", "scp2", "ssh1", "ssh2" and "plink1".
-rw-r--r--lisp/ChangeLog12
-rw-r--r--lisp/net/tramp-sh.el76
-rw-r--r--lisp/net/tramp.el48
3 files changed, 48 insertions, 88 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5ce0e6b597a..2ffe23823ba 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,15 @@
12013-03-01 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/tramp.el (tramp-obsolete-methods): New defconst.
4 (tramp-warned-obsolete-methods): New defvar.
5 (tramp-find-method): Check for obsolete methods. Map them to a
6 replacement method if appropriate.
7
8 * net/tramp-sh.el (tramp-methods) [scp1, scp2, ssh1, ssh2, plink1]:
9 Remove methods.
10 (top): Remove completion functions for "scp1", "scp2", "ssh1",
11 "ssh2" and "plink1".
12
12013-02-28 Dale Sedivec <dale@codefu.org> 132013-02-28 Dale Sedivec <dale@codefu.org>
2 14
3 * textmodes/sgml-mode.el (sgml-syntax-propertize-function): 15 * textmodes/sgml-mode.el (sgml-syntax-propertize-function):
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index e2aaafb38dd..9dd37fdf63a 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -126,42 +126,6 @@ detected as prompt when being sent on echoing hosts, therefore.")
126 (tramp-default-port 22))) 126 (tramp-default-port 22)))
127;;;###tramp-autoload 127;;;###tramp-autoload
128(add-to-list 'tramp-methods 128(add-to-list 'tramp-methods
129 '("scp1"
130 (tramp-login-program "ssh")
131 (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
132 ("-1") ("-e" "none") ("%h")))
133 (tramp-async-args (("-q")))
134 (tramp-remote-shell "/bin/sh")
135 (tramp-remote-shell-args ("-c"))
136 (tramp-copy-program "scp")
137 (tramp-copy-args (("-1") ("-P" "%p") ("-p" "%k")
138 ("-q") ("-r") ("%c")))
139 (tramp-copy-keep-date t)
140 (tramp-copy-recursive t)
141 (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
142 ("-o" "UserKnownHostsFile=/dev/null")
143 ("-o" "StrictHostKeyChecking=no")))
144 (tramp-default-port 22)))
145;;;###tramp-autoload
146(add-to-list 'tramp-methods
147 '("scp2"
148 (tramp-login-program "ssh")
149 (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
150 ("-2") ("-e" "none") ("%h")))
151 (tramp-async-args (("-q")))
152 (tramp-remote-shell "/bin/sh")
153 (tramp-remote-shell-args ("-c"))
154 (tramp-copy-program "scp")
155 (tramp-copy-args (("-2") ("-P" "%p") ("-p" "%k")
156 ("-q") ("-r") ("%c")))
157 (tramp-copy-keep-date t)
158 (tramp-copy-recursive t)
159 (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
160 ("-o" "UserKnownHostsFile=/dev/null")
161 ("-o" "StrictHostKeyChecking=no")))
162 (tramp-default-port 22)))
163;;;###tramp-autoload
164(add-to-list 'tramp-methods
165 '("scpx" 129 '("scpx"
166 (tramp-login-program "ssh") 130 (tramp-login-program "ssh")
167 (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c") 131 (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
@@ -233,32 +197,6 @@ detected as prompt when being sent on echoing hosts, therefore.")
233 (tramp-default-port 22))) 197 (tramp-default-port 22)))
234;;;###tramp-autoload 198;;;###tramp-autoload
235(add-to-list 'tramp-methods 199(add-to-list 'tramp-methods
236 '("ssh1"
237 (tramp-login-program "ssh")
238 (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
239 ("-1") ("-e" "none") ("%h")))
240 (tramp-async-args (("-q")))
241 (tramp-remote-shell "/bin/sh")
242 (tramp-remote-shell-args ("-c"))
243 (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
244 ("-o" "UserKnownHostsFile=/dev/null")
245 ("-o" "StrictHostKeyChecking=no")))
246 (tramp-default-port 22)))
247;;;###tramp-autoload
248(add-to-list 'tramp-methods
249 '("ssh2"
250 (tramp-login-program "ssh")
251 (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
252 ("-2") ("-e" "none") ("%h")))
253 (tramp-async-args (("-q")))
254 (tramp-remote-shell "/bin/sh")
255 (tramp-remote-shell-args ("-c"))
256 (tramp-gw-args (("-o" "GlobalKnownHostsFile=/dev/null")
257 ("-o" "UserKnownHostsFile=/dev/null")
258 ("-o" "StrictHostKeyChecking=no")))
259 (tramp-default-port 22)))
260;;;###tramp-autoload
261(add-to-list 'tramp-methods
262 '("sshx" 200 '("sshx"
263 (tramp-login-program "ssh") 201 (tramp-login-program "ssh")
264 (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c") 202 (tramp-login-args (("-l" "%u") ("-p" "%p") ("%c")
@@ -316,14 +254,6 @@ detected as prompt when being sent on echoing hosts, therefore.")
316 (tramp-default-port 22))) 254 (tramp-default-port 22)))
317;;;###tramp-autoload 255;;;###tramp-autoload
318(add-to-list 'tramp-methods 256(add-to-list 'tramp-methods
319 '("plink1"
320 (tramp-login-program "plink")
321 (tramp-login-args (("-l" "%u") ("-P" "%p") ("-1" "-ssh") ("%h")))
322 (tramp-remote-shell "/bin/sh")
323 (tramp-remote-shell-args ("-c"))
324 (tramp-default-port 22)))
325;;;###tramp-autoload
326(add-to-list 'tramp-methods
327 `("plinkx" 257 `("plinkx"
328 (tramp-login-program "plink") 258 (tramp-login-program "plink")
329 ;; ("%h") must be a single element, see 259 ;; ("%h") must be a single element, see
@@ -436,16 +366,12 @@ detected as prompt when being sent on echoing hosts, therefore.")
436 (tramp-set-completion-function "rcp" tramp-completion-function-alist-rsh) 366 (tramp-set-completion-function "rcp" tramp-completion-function-alist-rsh)
437 (tramp-set-completion-function "remcp" tramp-completion-function-alist-rsh) 367 (tramp-set-completion-function "remcp" tramp-completion-function-alist-rsh)
438 (tramp-set-completion-function "scp" tramp-completion-function-alist-ssh) 368 (tramp-set-completion-function "scp" tramp-completion-function-alist-ssh)
439 (tramp-set-completion-function "scp1" tramp-completion-function-alist-ssh)
440 (tramp-set-completion-function "scp2" tramp-completion-function-alist-ssh)
441 (tramp-set-completion-function "scpx" tramp-completion-function-alist-ssh) 369 (tramp-set-completion-function "scpx" tramp-completion-function-alist-ssh)
442 (tramp-set-completion-function "sftp" tramp-completion-function-alist-ssh) 370 (tramp-set-completion-function "sftp" tramp-completion-function-alist-ssh)
443 (tramp-set-completion-function "rsync" tramp-completion-function-alist-ssh) 371 (tramp-set-completion-function "rsync" tramp-completion-function-alist-ssh)
444 (tramp-set-completion-function "rsh" tramp-completion-function-alist-rsh) 372 (tramp-set-completion-function "rsh" tramp-completion-function-alist-rsh)
445 (tramp-set-completion-function "remsh" tramp-completion-function-alist-rsh) 373 (tramp-set-completion-function "remsh" tramp-completion-function-alist-rsh)
446 (tramp-set-completion-function "ssh" tramp-completion-function-alist-ssh) 374 (tramp-set-completion-function "ssh" tramp-completion-function-alist-ssh)
447 (tramp-set-completion-function "ssh1" tramp-completion-function-alist-ssh)
448 (tramp-set-completion-function "ssh2" tramp-completion-function-alist-ssh)
449 (tramp-set-completion-function "sshx" tramp-completion-function-alist-ssh) 375 (tramp-set-completion-function "sshx" tramp-completion-function-alist-ssh)
450 (tramp-set-completion-function 376 (tramp-set-completion-function
451 "telnet" tramp-completion-function-alist-telnet) 377 "telnet" tramp-completion-function-alist-telnet)
@@ -456,8 +382,6 @@ detected as prompt when being sent on echoing hosts, therefore.")
456 "krlogin" tramp-completion-function-alist-rsh) 382 "krlogin" tramp-completion-function-alist-rsh)
457 (tramp-set-completion-function "plink" tramp-completion-function-alist-ssh) 383 (tramp-set-completion-function "plink" tramp-completion-function-alist-ssh)
458 (tramp-set-completion-function 384 (tramp-set-completion-function
459 "plink1" tramp-completion-function-alist-ssh)
460 (tramp-set-completion-function
461 "plinkx" tramp-completion-function-alist-putty) 385 "plinkx" tramp-completion-function-alist-putty)
462 (tramp-set-completion-function "pscp" tramp-completion-function-alist-ssh) 386 (tramp-set-completion-function "pscp" tramp-completion-function-alist-ssh)
463 (tramp-set-completion-function "fcp" tramp-completion-function-alist-ssh))) 387 (tramp-set-completion-function "fcp" tramp-completion-function-alist-ssh)))
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index e5e69492130..d959cfc854a 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1170,21 +1170,45 @@ If the `tramp-methods' entry does not exist, return nil."
1170 (and (stringp name) 1170 (and (stringp name)
1171 (string-match tramp-file-name-regexp name)))) 1171 (string-match tramp-file-name-regexp name))))
1172 1172
1173;; Obsoleted with Tramp 2.2.7.
1174(defconst tramp-obsolete-methods
1175 '("ssh1" "ssh2" "scp1" "scp2" "scpc" "rsyncc" "plink1")
1176 "Obsolete methods.")
1177
1178(defvar tramp-warned-obsolete-methods nil
1179 "Which methods the user has been warned to be obsolete.")
1180
1173(defun tramp-find-method (method user host) 1181(defun tramp-find-method (method user host)
1174 "Return the right method string to use. 1182 "Return the right method string to use.
1175This is METHOD, if non-nil. Otherwise, do a lookup in 1183This is METHOD, if non-nil. Otherwise, do a lookup in
1176`tramp-default-method-alist'." 1184`tramp-default-method-alist'. It maps also obsolete methods to
1177 (or method 1185their replacement."
1178 (let ((choices tramp-default-method-alist) 1186 (let ((result
1179 lmethod item) 1187 (or method
1180 (while choices 1188 (let ((choices tramp-default-method-alist)
1181 (setq item (pop choices)) 1189 lmethod item)
1182 (when (and (string-match (or (nth 0 item) "") (or host "")) 1190 (while choices
1183 (string-match (or (nth 1 item) "") (or user ""))) 1191 (setq item (pop choices))
1184 (setq lmethod (nth 2 item)) 1192 (when (and (string-match (or (nth 0 item) "") (or host ""))
1185 (setq choices nil))) 1193 (string-match (or (nth 1 item) "") (or user "")))
1186 lmethod) 1194 (setq lmethod (nth 2 item))
1187 tramp-default-method)) 1195 (setq choices nil)))
1196 lmethod)
1197 tramp-default-method)))
1198 ;; This is needed for a transition period only.
1199 (when (member result tramp-obsolete-methods)
1200 (unless (member result tramp-warned-obsolete-methods)
1201 (if noninteractive
1202 (warn "Method %s is obsolete, using %s"
1203 result (substring result 0 -1))
1204 (unless (y-or-n-p (format "Method %s is obsolete, use %s? "
1205 result (substring result 0 -1)))
1206 (error 'file-error "Method \"%s\" not supported" result)))
1207 (add-to-list 'tramp-warned-obsolete-methods result))
1208 ;; This works with the current set of `tramp-obsolete-methods'.
1209 ;; Must be improved, if their are more sophisticated replacements.
1210 (setq result (substring result 0 -1)))
1211 result))
1188 1212
1189(defun tramp-find-user (method user host) 1213(defun tramp-find-user (method user host)
1190 "Return the right user string to use. 1214 "Return the right user string to use.