emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r111901: * net/tramp.el (tramp-obsole


From: Michael Albinus
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r111901: * net/tramp.el (tramp-obsolete-methods): New defconst.
Date: Fri, 01 Mar 2013 09:13:53 +0100
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111901
committer: Michael Albinus <address@hidden
branch nick: trunk
timestamp: Fri 2013-03-01 09:13:53 +0100
message:
  * 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".
modified:
  lisp/ChangeLog
  lisp/net/tramp-sh.el
  lisp/net/tramp.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-03-01 03:43:57 +0000
+++ b/lisp/ChangeLog    2013-03-01 08:13:53 +0000
@@ -1,3 +1,15 @@
+2013-03-01  Michael Albinus  <address@hidden>
+
+       * 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".
+
 2013-02-28  Dale Sedivec  <address@hidden>
 
        * textmodes/sgml-mode.el (sgml-syntax-propertize-function):

=== modified file 'lisp/net/tramp-sh.el'
--- a/lisp/net/tramp-sh.el      2013-02-26 08:46:38 +0000
+++ b/lisp/net/tramp-sh.el      2013-03-01 08:13:53 +0000
@@ -126,42 +126,6 @@
     (tramp-default-port         22)))
 ;;;###tramp-autoload
 (add-to-list 'tramp-methods
-  '("scp1"
-    (tramp-login-program        "ssh")
-    (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") ("%c")))
-    (tramp-copy-keep-date       t)
-    (tramp-copy-recursive       t)
-    (tramp-gw-args              (("-o" "GlobalKnownHostsFile=/dev/null")
-                                ("-o" "UserKnownHostsFile=/dev/null")
-                                ("-o" "StrictHostKeyChecking=no")))
-    (tramp-default-port         22)))
-;;;###tramp-autoload
-(add-to-list 'tramp-methods
-  '("scp2"
-    (tramp-login-program        "ssh")
-    (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") ("%c")))
-    (tramp-copy-keep-date       t)
-    (tramp-copy-recursive       t)
-    (tramp-gw-args              (("-o" "GlobalKnownHostsFile=/dev/null")
-                                ("-o" "UserKnownHostsFile=/dev/null")
-                                ("-o" "StrictHostKeyChecking=no")))
-    (tramp-default-port         22)))
-;;;###tramp-autoload
-(add-to-list 'tramp-methods
   '("scpx"
     (tramp-login-program        "ssh")
     (tramp-login-args           (("-l" "%u") ("-p" "%p") ("%c")
@@ -233,32 +197,6 @@
     (tramp-default-port         22)))
 ;;;###tramp-autoload
 (add-to-list 'tramp-methods
-  '("ssh1"
-    (tramp-login-program        "ssh")
-    (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-gw-args              (("-o" "GlobalKnownHostsFile=/dev/null")
-                                ("-o" "UserKnownHostsFile=/dev/null")
-                                ("-o" "StrictHostKeyChecking=no")))
-    (tramp-default-port         22)))
-;;;###tramp-autoload
-(add-to-list 'tramp-methods
-  '("ssh2"
-    (tramp-login-program        "ssh")
-    (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-gw-args              (("-o" "GlobalKnownHostsFile=/dev/null")
-                                ("-o" "UserKnownHostsFile=/dev/null")
-                                ("-o" "StrictHostKeyChecking=no")))
-    (tramp-default-port         22)))
-;;;###tramp-autoload
-(add-to-list 'tramp-methods
   '("sshx"
     (tramp-login-program        "ssh")
     (tramp-login-args           (("-l" "%u") ("-p" "%p") ("%c")
@@ -316,14 +254,6 @@
     (tramp-default-port         22)))
 ;;;###tramp-autoload
 (add-to-list 'tramp-methods
-  '("plink1"
-    (tramp-login-program        "plink")
-    (tramp-login-args           (("-l" "%u") ("-P" "%p") ("-1" "-ssh") ("%h")))
-    (tramp-remote-shell         "/bin/sh")
-    (tramp-remote-shell-args    ("-c"))
-    (tramp-default-port         22)))
-;;;###tramp-autoload
-(add-to-list 'tramp-methods
   `("plinkx"
     (tramp-login-program        "plink")
     ;; ("%h") must be a single element, see
@@ -436,16 +366,12 @@
      (tramp-set-completion-function "rcp" tramp-completion-function-alist-rsh)
      (tramp-set-completion-function "remcp" 
tramp-completion-function-alist-rsh)
      (tramp-set-completion-function "scp" tramp-completion-function-alist-ssh)
-     (tramp-set-completion-function "scp1" tramp-completion-function-alist-ssh)
-     (tramp-set-completion-function "scp2" tramp-completion-function-alist-ssh)
      (tramp-set-completion-function "scpx" tramp-completion-function-alist-ssh)
      (tramp-set-completion-function "sftp" tramp-completion-function-alist-ssh)
      (tramp-set-completion-function "rsync" 
tramp-completion-function-alist-ssh)
      (tramp-set-completion-function "rsh" tramp-completion-function-alist-rsh)
      (tramp-set-completion-function "remsh" 
tramp-completion-function-alist-rsh)
      (tramp-set-completion-function "ssh" tramp-completion-function-alist-ssh)
-     (tramp-set-completion-function "ssh1" tramp-completion-function-alist-ssh)
-     (tramp-set-completion-function "ssh2" tramp-completion-function-alist-ssh)
      (tramp-set-completion-function "sshx" tramp-completion-function-alist-ssh)
      (tramp-set-completion-function
       "telnet" tramp-completion-function-alist-telnet)
@@ -456,8 +382,6 @@
       "krlogin" tramp-completion-function-alist-rsh)
      (tramp-set-completion-function "plink" 
tramp-completion-function-alist-ssh)
      (tramp-set-completion-function
-      "plink1" tramp-completion-function-alist-ssh)
-     (tramp-set-completion-function
       "plinkx" tramp-completion-function-alist-putty)
      (tramp-set-completion-function "pscp" tramp-completion-function-alist-ssh)
      (tramp-set-completion-function "fcp" 
tramp-completion-function-alist-ssh)))

=== modified file 'lisp/net/tramp.el'
--- a/lisp/net/tramp.el 2013-02-23 12:40:14 +0000
+++ b/lisp/net/tramp.el 2013-03-01 08:13:53 +0000
@@ -1170,21 +1170,45 @@
     (and (stringp name)
         (string-match tramp-file-name-regexp name))))
 
+;; Obsoleted with Tramp 2.2.7.
+(defconst tramp-obsolete-methods
+  '("ssh1" "ssh2" "scp1" "scp2" "scpc" "rsyncc" "plink1")
+  "Obsolete methods.")
+
+(defvar tramp-warned-obsolete-methods nil
+  "Which methods the user has been warned to be obsolete.")
+
 (defun tramp-find-method (method user host)
   "Return the right method string to use.
 This is METHOD, if non-nil. Otherwise, do a lookup in
-`tramp-default-method-alist'."
-  (or method
-      (let ((choices tramp-default-method-alist)
-           lmethod item)
-       (while choices
-         (setq item (pop choices))
-         (when (and (string-match (or (nth 0 item) "") (or host ""))
-                    (string-match (or (nth 1 item) "") (or user "")))
-           (setq lmethod (nth 2 item))
-           (setq choices nil)))
-       lmethod)
-      tramp-default-method))
+`tramp-default-method-alist'.  It maps also obsolete methods to
+their replacement."
+  (let ((result
+        (or method
+            (let ((choices tramp-default-method-alist)
+                  lmethod item)
+              (while choices
+                (setq item (pop choices))
+                (when (and (string-match (or (nth 0 item) "") (or host ""))
+                           (string-match (or (nth 1 item) "") (or user "")))
+                  (setq lmethod (nth 2 item))
+                  (setq choices nil)))
+              lmethod)
+            tramp-default-method)))
+    ;; This is needed for a transition period only.
+    (when (member result tramp-obsolete-methods)
+      (unless (member result tramp-warned-obsolete-methods)
+       (if noninteractive
+           (warn "Method %s is obsolete, using %s"
+                 result (substring result 0 -1))
+         (unless (y-or-n-p (format "Method %s is obsolete, use %s? "
+                                   result (substring result 0 -1)))
+           (error 'file-error "Method \"%s\" not supported" result)))
+       (add-to-list 'tramp-warned-obsolete-methods result))
+      ;; This works with the current set of `tramp-obsolete-methods'.
+      ;; Must be improved, if their are more sophisticated replacements.
+      (setq result (substring result 0 -1)))
+    result))
 
 (defun tramp-find-user (method user host)
   "Return the right user string to use.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]