emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/net/tramp.el


From: Kai Großjohann
Subject: [Emacs-diffs] Changes to emacs/lisp/net/tramp.el
Date: Mon, 02 Sep 2002 08:53:12 -0400

Index: emacs/lisp/net/tramp.el
diff -c emacs/lisp/net/tramp.el:1.22 emacs/lisp/net/tramp.el:1.23
*** emacs/lisp/net/tramp.el:1.22        Thu Aug 22 11:16:08 2002
--- emacs/lisp/net/tramp.el     Mon Sep  2 08:53:12 2002
***************
*** 1,4 ****
! ;;; tramp.el --- Transparent Remote Access, Multiple Protocol -*- coding: 
iso-8859-1; -*- 
  
  ;; Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
  
--- 1,4 ----
! ;;; tramp.el --- Transparent Remote Access, Multiple Protocol -*- coding: 
iso-8859-1; -*-
  
  ;; Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
  
***************
*** 72,78 ****
  ;; In the Tramp CVS repository, the version numer is auto-frobbed from
  ;; the Makefile, so you should edit the top-level Makefile to change
  ;; the version number.
! (defconst tramp-version "2.0.14"
    "This version of tramp.")
  
  (defconst tramp-bug-report-address "address@hidden"
--- 72,78 ----
  ;; In the Tramp CVS repository, the version numer is auto-frobbed from
  ;; the Makefile, so you should edit the top-level Makefile to change
  ;; the version number.
! (defconst tramp-version "2.0.15"
    "This version of tramp.")
  
  (defconst tramp-bug-report-address "address@hidden"
***************
*** 80,86 ****
  
  (require 'timer)
  (require 'format-spec)                  ;from Gnus 5.8, also in tar ball
! (require 'base64)                       ;for the mimencode methods
  (require 'shell)
  (require 'advice)
  
--- 80,91 ----
  
  (require 'timer)
  (require 'format-spec)                  ;from Gnus 5.8, also in tar ball
! ;; The explicit check is not necessary in Emacs, which provides the
! ;; feature even if implemented in C, but it appears to be necessary
! ;; in XEmacs.
! (unless (and (fboundp 'base64-encode-region)
!            (fboundp 'base64-decode-region))
!   (require 'base64))                       ;for the mimencode methods
  (require 'shell)
  (require 'advice)
  
***************
*** 317,346 ****
                (tramp-su-args              nil)
                (tramp-telnet-program       nil)
                (tramp-telnet-args          nil))
-      ("ssh1-old"
-               (tramp-connection-function  tramp-open-connection-rsh)
-               (tramp-rsh-program          "ssh1")
-               (tramp-rcp-program          nil)
-               (tramp-remote-sh            "/bin/sh")
-               (tramp-rsh-args             ("-e" "none"))
-               (tramp-rcp-args             nil)
-               (tramp-rcp-keep-date-arg    nil)
-               (tramp-su-program           nil)
-               (tramp-su-args              nil)
-               (tramp-telnet-program       nil)
-               (tramp-telnet-args          nil))
-      ("ssh2-old"
-               (tramp-connection-function  tramp-open-connection-rsh)
-               (tramp-rsh-program          "ssh2")
-               (tramp-rcp-program          nil)
-               (tramp-remote-sh            "/bin/sh")
-               (tramp-rsh-args             ("-e" "none"))
-               (tramp-rcp-args             nil)
-               (tramp-rcp-keep-date-arg    nil)
-               (tramp-su-program           nil)
-               (tramp-su-args              nil)
-               (tramp-telnet-program       nil)
-               (tramp-telnet-args          nil))
       ("telnet"
                (tramp-connection-function  tramp-open-connection-telnet)
                (tramp-rsh-program          nil)
--- 322,327 ----
***************
*** 1414,1423 ****
  This variable is buffer-local in every buffer.")
  (make-variable-buffer-local 'tramp-last-cmd-time)
  
  (defvar tramp-feature-write-region-fix
!   (let ((file-coding-system-alist '(("test" emacs-mule))))
!     (find-operation-coding-system 'write-region 0 0 "" nil "test"))
!   "Internal variable to say if `write-region' chooses the right coding.
  Older versions of Emacs chose the coding system for `write-region' based
  on the FILENAME argument, even if VISIT was a string.")
  
--- 1395,1407 ----
  This variable is buffer-local in every buffer.")
  (make-variable-buffer-local 'tramp-last-cmd-time)
  
+ ;; This variable does not have the right value in XEmacs.  What should
+ ;; I use instead of find-operation-coding-system in XEmacs?
  (defvar tramp-feature-write-region-fix
!   (unless (featurep 'xemacs)
!     (let ((file-coding-system-alist '(("test" emacs-mule))))
!       (find-operation-coding-system 'write-region 0 0 "" nil "test")))
!     "Internal variable to say if `write-region' chooses the right coding.
  Older versions of Emacs chose the coding system for `write-region' based
  on the FILENAME argument, even if VISIT was a string.")
  
***************
*** 1975,1981 ****
    "Like `set-file-modes' for tramp files."
    (with-parsed-tramp-file-name filename nil
      (when (tramp-ange-ftp-file-name-p multi-method method)
!       (tramp-invoke-ange-ftp 'set-file-modes filename mode))
      (save-excursion
        (unless (zerop (tramp-send-command-and-check
                      multi-method method user host
--- 1959,1965 ----
    "Like `set-file-modes' for tramp files."
    (with-parsed-tramp-file-name filename nil
      (when (tramp-ange-ftp-file-name-p multi-method method)
!       (tramp-invoke-ange-ftp 'set-file-modes mode filename))
      (save-excursion
        (unless (zerop (tramp-send-command-and-check
                      multi-method method user host
***************
*** 2374,2382 ****
          ;; Possibly invoke Ange-FTP.
          (when (and (tramp-ange-ftp-file-name-p v1-multi-method v1-method)
                     (tramp-ange-ftp-file-name-p v2-multi-method v2-method))
!           (tramp-invoke-ange-ftp
!            (if (eq op 'copy) 'copy-file 'rename-file)
!            filename newname ok-if-already-exists keep-date))
          ;; Check if we can use a shortcut.
          (if (and (equal v1-multi-method v2-multi-method)
                   (equal v1-method v2-method)
--- 2358,2368 ----
          ;; Possibly invoke Ange-FTP.
          (when (and (tramp-ange-ftp-file-name-p v1-multi-method v1-method)
                     (tramp-ange-ftp-file-name-p v2-multi-method v2-method))
!           (if (eq op 'copy)
!               (tramp-invoke-ange-ftp
!                'copy-file filename newname ok-if-already-exists keep-date)
!             (tramp-invoke-ange-ftp
!              'rename-file filename newname ok-if-already-exists)))
          ;; Check if we can use a shortcut.
          (if (and (equal v1-multi-method v2-multi-method)
                   (equal v1-method v2-method)
***************
*** 2956,2962 ****
    (with-parsed-tramp-file-name filename nil
      (when (tramp-ange-ftp-file-name-p multi-method method)
        (tramp-invoke-ange-ftp 'write-region
!                            start end filename append visit lockname confirm))
      (let ((curbuf (current-buffer))
          (rcp-program (tramp-get-rcp-program multi-method method))
          (rcp-args (tramp-get-rcp-args multi-method method))
--- 2942,2948 ----
    (with-parsed-tramp-file-name filename nil
      (when (tramp-ange-ftp-file-name-p multi-method method)
        (tramp-invoke-ange-ftp 'write-region
!                            start end filename append visit))
      (let ((curbuf (current-buffer))
          (rcp-program (tramp-get-rcp-program multi-method method))
          (rcp-args (tramp-get-rcp-args multi-method method))
***************
*** 3228,3234 ****
  
  (defun tramp-invoke-ange-ftp (operation &rest args)
    "Invoke the Ange-FTP handler function and throw."
!   (or (boundp 'ange-ftp-name-format) (require 'ange-ftp))
    (let ((ange-ftp-name-format
         (list (nth 0 tramp-file-name-structure)
               (nth 3 tramp-file-name-structure)
--- 3214,3222 ----
  
  (defun tramp-invoke-ange-ftp (operation &rest args)
    "Invoke the Ange-FTP handler function and throw."
!   (or (boundp 'ange-ftp-name-format)
!       (and (require 'ange-ftp)
!          (tramp-disable-ange-ftp)))
    (let ((ange-ftp-name-format
         (list (nth 0 tramp-file-name-structure)
               (nth 3 tramp-file-name-structure)
***************
*** 3240,3246 ****
  
  (defun tramp-ange-ftp-file-name-p (multi-method method)
    "Check if it's a filename that should be forwarded to Ange-FTP."
!   (and (null multi-method) (string= method tramp-ftp-method)))
  
  
  ;;; Interactions with other packages:
--- 3228,3236 ----
  
  (defun tramp-ange-ftp-file-name-p (multi-method method)
    "Check if it's a filename that should be forwarded to Ange-FTP."
!   (and (not (featurep 'xemacs))
!        (null multi-method)
!        (string= method tramp-ftp-method)))
  
  
  ;;; Interactions with other packages:
***************
*** 3836,3877 ****
        (erase-buffer)
        (tramp-process-actions p multi-method method user host
                               tramp-actions-before-shell)
- 
- ;;         (tramp-message 9 "Waiting for login prompt...")
- ;;         (unless (tramp-wait-for-regexp p nil tramp-login-prompt-regexp)
- ;;           (pop-to-buffer (buffer-name))
- ;;           (kill-process p)
- ;;           (error "Couldn't find remote login prompt"))
- ;;         (erase-buffer)
- ;;         ;; Remote login defaults to local one.
- ;;         (tramp-message 9 "Sending login name %s" (or user 
(user-login-name)))
- ;;         (process-send-string p (concat (or user (user-login-name)) 
- ;;                                        tramp-rsh-end-of-line))
- ;;         (tramp-message 9 "Waiting for password prompt...")
- ;;         (unless (setq found (tramp-wait-for-regexp
- ;;                              p nil tramp-password-prompt-regexp))
- ;;           (pop-to-buffer (buffer-name))
- ;;           (kill-process p)
- ;;           (error "Couldn't find remote password prompt"))
- ;;         (erase-buffer)
- ;;         (setq pw (tramp-read-passwd (car found)))
- ;;         (tramp-message 9 "Sending password")
- ;;         (process-send-string p (concat pw tramp-rsh-end-of-line))
- ;;         (tramp-message 9 "Waiting 30s for remote shell to come up...")
- ;;         (unless (setq found
- ;;                       (tramp-wait-for-regexp
- ;;                        p 30 (format "\\(%s\\)\\|\\(%s\\)\\|\\(%s\\)\\'"
- ;;                                     tramp-wrong-passwd-regexp
- ;;                                     shell-prompt-pattern
- ;;                                     tramp-shell-prompt-pattern)))
- ;;           (pop-to-buffer (buffer-name))
- ;;           (kill-process p)
- ;;           (error "Couldn't find remote shell prompt"))
- ;;         (when (nth 1 found)
- ;;           (pop-to-buffer (buffer-name))
- ;;           (kill-process p)
- ;;           (error "Login failed: %s" (nth 1 found)))
- 
          (tramp-open-connection-setup-interactive-shell
           p multi-method method user host)
          (tramp-post-connection multi-method method user host)))))
--- 3826,3831 ----
***************
*** 3936,3980 ****
        (set-buffer buf)
        (tramp-process-actions p multi-method method user host
                               tramp-actions-before-shell)
- 
- ;;         (tramp-message 9 "Waiting 60s for shell or passwd prompt from %s" 
host)
- ;;         (setq found
- ;;               (tramp-wait-for-regexp
- ;;                p 60
- ;;                (format
- ;;                 "\\(%s\\)\\|\\(%s\\)\\|\\(%s\\)\\'"
- ;;                 tramp-password-prompt-regexp
- ;;                 shell-prompt-pattern tramp-shell-prompt-pattern)))
- ;;         (unless found
- ;;           (pop-to-buffer (buffer-name))
- ;;           (kill-process p)
- ;;           (error "Couldn't find remote shell or passwd prompt"))
- ;;         (when (nth 1 found)
- ;;           (when (tramp-method-out-of-band-p multi-method method)
- ;;             (pop-to-buffer (buffer-name))
- ;;             (kill-process p)
- ;;             (error (concat "Out of band method `%s' not applicable"
- ;;                            " for remote shell asking for a password")
- ;;                    method))
- ;;           (erase-buffer)
- ;;           (tramp-message 9 "Sending password...")
- ;;           (tramp-enter-password p (nth 1 found))
- ;;           (tramp-message 9 "Sent password, waiting 60s for remote shell 
prompt")
- ;;           (setq found (tramp-wait-for-regexp
- ;;                        p 60
- ;;                        (format "\\(%s\\)\\|\\(%s\\)\\|\\(%s\\)\\'"
- ;;                                tramp-wrong-passwd-regexp
- ;;                                shell-prompt-pattern
- ;;                                tramp-shell-prompt-pattern))))
- ;;         (unless found
- ;;           (pop-to-buffer (buffer-name))
- ;;           (kill-process p)
- ;;           (error "Couldn't find remote shell prompt"))
- ;;         (when (nth 1 found)
- ;;           (pop-to-buffer (buffer-name))
- ;;           (kill-process p)
- ;;           (error "Login failed: %s" (nth 1 found)))
- 
          (tramp-message 7 "Initializing remote shell")
          (tramp-open-connection-setup-interactive-shell
           p multi-method method user host)
--- 3890,3895 ----
***************
*** 4003,4012 ****
         "Cannot connect to different host `%s' with `su' connection method"
         host))
      (when (not user)
!       (error "Must give user name for `su' connection method"))
      (tramp-pre-connection multi-method method user host)
!     (tramp-message 7 "Opening connection for `%s' using `%s'..." 
!                  (or user (user-login-name)) method)
      (let ((process-environment (copy-sequence process-environment)))
        (setenv "TERM" tramp-terminal-type)
        (let* ((default-directory (tramp-temporary-file-directory))
--- 3918,3926 ----
         "Cannot connect to different host `%s' with `su' connection method"
         host))
      (when (not user)
!       (setq user "root"))
      (tramp-pre-connection multi-method method user host)
!     (tramp-message 7 "Opening connection for `%s' using `%s'..." user method)
      (let ((process-environment (copy-sequence process-environment)))
        (setenv "TERM" tramp-terminal-type)
        (let* ((default-directory (tramp-temporary-file-directory))
***************
*** 4027,4063 ****
        (set-buffer (tramp-get-buffer multi-method method user host))
        (tramp-process-actions p multi-method method user host
                               tramp-actions-before-shell)
- 
- ;;         (tramp-message 9 "Waiting 30s for shell or password prompt...")
- ;;         (unless (setq found (tramp-wait-for-regexp
- ;;                              p 30
- ;;                              (format "\\(%s\\)\\|\\(%s\\)\\|\\(%s\\)\\'"
- ;;                                      tramp-password-prompt-regexp
- ;;                                      shell-prompt-pattern
- ;;                                      tramp-shell-prompt-pattern)))
- ;;           (pop-to-buffer (buffer-name))
- ;;           (kill-process p)
- ;;           (error "Couldn't find shell or password prompt"))
- ;;         (when (nth 1 found)
- ;;           (erase-buffer)
- ;;           (setq pw (tramp-read-passwd (car found)))
- ;;           (tramp-message 9 "Sending password")
- ;;           (process-send-string p (concat pw tramp-rsh-end-of-line))
- ;;           (tramp-message 9 "Waiting 30s for remote shell to come up...")
- ;;           (unless (setq found
- ;;                         (tramp-wait-for-regexp
- ;;                          p 30 (format "\\(%s\\)\\|\\(%s\\)\\|\\(%s\\)\\'"
- ;;                                       tramp-wrong-passwd-regexp
- ;;                                       shell-prompt-pattern
- ;;                                       tramp-shell-prompt-pattern)))
- ;;             (pop-to-buffer (buffer-name))
- ;;             (kill-process p)
- ;;             (error "Couldn't find remote shell prompt"))
- ;;           (when (nth 1 found)
- ;;             (pop-to-buffer (buffer-name))
- ;;             (kill-process p)
- ;;             (error "`su' failed: %s" (nth 1 found))))
- 
          (tramp-open-connection-setup-interactive-shell
           p multi-method method user host)
          (tramp-post-connection multi-method method 
--- 3941,3946 ----
***************
*** 4120,4126 ****
                   (entry (assoc m tramp-multi-connection-function-alist))
                   (multi-func (nth 1 entry))
                   (command (nth 2 entry)))
!           ;; The multi-funcs don't need to do save-match-data, as that
              ;; is done here.
              (funcall multi-func p m u h command)
              (erase-buffer)
--- 4003,4009 ----
                   (entry (assoc m tramp-multi-connection-function-alist))
                   (multi-func (nth 1 entry))
                   (command (nth 2 entry)))
!           ;; The multi-funcs don't need to do save-match-data, as that
              ;; is done here.
              (funcall multi-func p m u h command)
              (erase-buffer)
***************
*** 4150,4189 ****
      (tramp-message 9 "Sending telnet command `%s'" cmd1)
      (process-send-string p cmd)
      (tramp-process-multi-actions p method user host
!                                tramp-multi-actions)
! 
! ;;     (tramp-message 9 "Waiting 30s for login prompt from %s" host)
! ;;     (unless (tramp-wait-for-regexp p 30 tramp-login-prompt-regexp)
! ;;       (pop-to-buffer (buffer-name))
! ;;       (kill-process p)
! ;;       (error "Couldn't find login prompt from host %s" host))
! ;;     (erase-buffer)
! ;;     (tramp-message 9 "Sending login name %s" (or user (user-login-name)))
! ;;     (process-send-string p (concat (or user (user-login-name)) 
tramp-rsh-end-of-line))
! ;;     (tramp-message 9 "Waiting for password prompt")
! ;;     (unless (setq found (tramp-wait-for-regexp p nil 
tramp-password-prompt-regexp))
! ;;       (pop-to-buffer (buffer-name))
! ;;       (kill-process p)
! ;;       (error "Couldn't find password prompt from host %s" host))
! ;;     (erase-buffer)
! ;;     (setq pw (tramp-read-passwd
! ;;               (format "Password for address@hidden, %s" (or user 
(user-login-name)) host found)))
! ;;     (tramp-message 9 "Sending password")
! ;;     (process-send-string p (concat pw tramp-rsh-end-of-line))
! ;;     (tramp-message 9 "Waiting 60s for remote shell to come up...")
! ;;     (unless (setq found (tramp-wait-for-regexp
! ;;                          p 60 (format "\\(%s\\)\\|\\(%s\\)\\|\\(%s\\)\\'"
! ;;                                       tramp-wrong-passwd-regexp
! ;;                                       shell-prompt-pattern
! ;;                                       tramp-shell-prompt-pattern)))
! ;;       (pop-to-buffer (buffer-name))
! ;;       (kill-process p)
! ;;       (error "Couldn't find shell prompt from host %s" host))
! ;;     (when (nth 1 found)
! ;;       (pop-to-buffer (buffer-name))
! ;;       (kill-process p)
! ;;       (error "Login to %s failed: %s" (nth 2 found)))
!     ))
  
  ;; HHH: Changed.  Multi method.  Don't know how to handle this in the case 
  ;;      of no user name provided.  Hack to make it work as it did before:  
--- 4033,4039 ----
      (tramp-message 9 "Sending telnet command `%s'" cmd1)
      (process-send-string p cmd)
      (tramp-process-multi-actions p method user host
!                                tramp-multi-actions)))
  
  ;; HHH: Changed.  Multi method.  Don't know how to handle this in the case 
  ;;      of no user name provided.  Hack to make it work as it did before:  
***************
*** 4209,4244 ****
      (tramp-message 9 "Sending rlogin command `%s'" cmd1)
      (process-send-string p cmd)
      (tramp-process-multi-actions p method user host
!                                tramp-multi-actions)
! ;;     (tramp-message 9 "Waiting 60s for shell or passwd prompt from %s" host)
! ;;     (unless (setq found
! ;;                   (tramp-wait-for-regexp p 60
! ;;                                        (format 
"\\(%s\\)\\|\\(%s\\)\\|\\(%s\\)\\'"
! ;;                                                tramp-password-prompt-regexp
! ;;                                                shell-prompt-pattern
! ;;                                                
tramp-shell-prompt-pattern)))
! ;;       (pop-to-buffer (buffer-name))
! ;;       (kill-process p)
! ;;       (error "Couldn't find remote shell or passwd prompt"))
! ;;     (when (nth 1 found)
! ;;       (erase-buffer)
! ;;       (tramp-message 9 "Sending password...")
! ;;       (tramp-enter-password p (nth 1 found))
! ;;       (tramp-message 9 "Sent password, waiting 60s for remote shell 
prompt")
! ;;       (setq found (tramp-wait-for-regexp p 60
! ;;                                          (format 
"\\(%s\\)\\|\\(%s\\)\\|\\(%s\\)\\'"
! ;;                                                  tramp-wrong-passwd-regexp
! ;;                                                  shell-prompt-pattern
! ;;                                                  
tramp-shell-prompt-pattern))))
! ;;     (unless found
! ;;       (pop-to-buffer (buffer-name))
! ;;       (kill-process p)
! ;;       (error "Couldn't find remote shell prompt"))
! ;;     (when (nth 1 found)
! ;;       (pop-to-buffer (buffer-name))
! ;;       (kill-process p)
! ;;       (error "Login failed: %s" (nth 1 found)))
!     ))
  
  ;; HHH: Changed.  Multi method.  Don't know how to handle this in the case 
  ;;      of no user name provided.  Hack to make it work as it did before:  
--- 4059,4065 ----
      (tramp-message 9 "Sending rlogin command `%s'" cmd1)
      (process-send-string p cmd)
      (tramp-process-multi-actions p method user host
!                                tramp-multi-actions)))
  
  ;; HHH: Changed.  Multi method.  Don't know how to handle this in the case 
  ;;      of no user name provided.  Hack to make it work as it did before:  
***************
*** 4265,4300 ****
      (tramp-message 9 "Sending su command `%s'" cmd1)
      (process-send-string p cmd)
      (tramp-process-multi-actions p method user host
!                                tramp-multi-actions)
! ;;     (tramp-message 9 "Waiting 60s for shell or passwd prompt for %s" (or 
user (user-login-name)))
! ;;     (unless (setq found (tramp-wait-for-regexp
! ;;                          p 60 (format "\\(%s\\)\\|\\(%s\\)\\|\\(%s\\)\\'"
! ;;                                       tramp-password-prompt-regexp
! ;;                                       shell-prompt-pattern
! ;;                                       tramp-shell-prompt-pattern)))
! ;;       (pop-to-buffer (buffer-name))
! ;;       (kill-process p)
! ;;       (error "Couldn't find shell or passwd prompt for %s" 
! ;;         (or user (user-login-name))))
! ;;     (when (nth 1 found)
! ;;       (tramp-message 9 "Sending password...")
! ;;       (tramp-enter-password p (nth 1 found))
! ;;       (erase-buffer)
! ;;       (tramp-message 9 "Sent password, waiting 60s for remote shell 
prompt")
! ;;       (setq found (tramp-wait-for-regexp p 60
! ;;                                        (format 
"\\(%s\\)\\|\\(%s\\)\\|\\(%s\\)\\'"
! ;;                                                tramp-wrong-passwd-regexp
! ;;                                                shell-prompt-pattern
! ;;                                                
tramp-shell-prompt-pattern))))
! ;;     (unless found
! ;;       (pop-to-buffer (buffer-name))
! ;;       (kill-process p)
! ;;       (error "Couldn't find remote shell prompt"))
! ;;     (when (nth 1 found)
! ;;       (pop-to-buffer (buffer-name))
! ;;       (kill-process p)
! ;;       (error "Login failed: %s" (nth 1 found)))
!     ))
  
  ;; Utility functions.
  
--- 4086,4092 ----
      (tramp-message 9 "Sending su command `%s'" cmd1)
      (process-send-string p cmd)
      (tramp-process-multi-actions p method user host
!                                tramp-multi-actions)))
  
  ;; Utility functions.
  




reply via email to

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