aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Großjohann2002-09-22 13:55:14 +0000
committerKai Großjohann2002-09-22 13:55:14 +0000
commit91879624ba4e260553f5f66978fba871ff0b6ab9 (patch)
tree7be2291b1d76331c361eafe955aa2436eed750ed
parent16674e4f3b1e05ebece0b676fffe6119d9b2edd4 (diff)
downloademacs-91879624ba4e260553f5f66978fba871ff0b6ab9.tar.gz
emacs-91879624ba4e260553f5f66978fba871ff0b6ab9.zip
Version 2.0.21 released.
(tramp-handle-file-newer-than-file-p): If mtime of both files is known, return a useful result. Better error message in case one is a Tramp file and one isn't. (tramp-handle-file-local-copy, tramp-handle-write-region) (tramp-find-shell, tramp-open-connection-telnet) (tramp-open-connection-rsh, tramp-open-connection-su) (tramp-open-connection-setup-interactive-shell) (tramp-post-connection, tramp-maybe-open-connection) (tramp-method-out-of-band-p): Correct number of args for `tramp-get-rsh-program' and similar functions.
-rw-r--r--lisp/ChangeLog16
-rw-r--r--lisp/net/tramp.el123
-rw-r--r--man/tramp.texi2
3 files changed, 96 insertions, 45 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3c1bb32bded..9ee6f601adc 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,6 +1,20 @@
12002-09-22 Kai Gro,b_(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE>
2
3 * net/tramp.el: Version 2.0.21 released.
4 (tramp-handle-file-newer-than-file-p): If mtime of both files is
5 known, return a useful result. Better error message in case one
6 is a Tramp file and one isn't.
7 (tramp-handle-file-local-copy, tramp-handle-write-region)
8 (tramp-find-shell, tramp-open-connection-telnet)
9 (tramp-open-connection-rsh, tramp-open-connection-su)
10 (tramp-open-connection-setup-interactive-shell)
11 (tramp-post-connection, tramp-maybe-open-connection)
12 (tramp-method-out-of-band-p): Correct number of args for
13 `tramp-get-rsh-program' and similar functions.
14
12002-09-22 Kai Gro,b_(Bjohann <grossjoh@ls6.informatik.uni-dortmund.de> 152002-09-22 Kai Gro,b_(Bjohann <grossjoh@ls6.informatik.uni-dortmund.de>
2 16
3 Version 2.0.20 released. 17 * net/tramp.el: Version 2.0.20 released.
4 18
52002-09-20 Kai Gro,b_(Bjohann <grossjoh@ls6.informatik.uni-dortmund.de> 192002-09-20 Kai Gro,b_(Bjohann <grossjoh@ls6.informatik.uni-dortmund.de>
6 20
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 259a52f583b..58ec71b312d 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -72,7 +72,7 @@
72;; In the Tramp CVS repository, the version numer is auto-frobbed from 72;; In the Tramp CVS repository, the version numer is auto-frobbed from
73;; the Makefile, so you should edit the top-level Makefile to change 73;; the Makefile, so you should edit the top-level Makefile to change
74;; the version number. 74;; the version number.
75(defconst tramp-version "2.0.20" 75(defconst tramp-version "2.0.21"
76 "This version of tramp.") 76 "This version of tramp.")
77 77
78(defconst tramp-bug-report-address "tramp-devel@mail.freesoftware.fsf.org" 78(defconst tramp-bug-report-address "tramp-devel@mail.freesoftware.fsf.org"
@@ -2173,33 +2173,54 @@ if the remote host can't provide the modtime."
2173 nil) 2173 nil)
2174 ((not (file-exists-p file2)) 2174 ((not (file-exists-p file2))
2175 t) 2175 t)
2176 ;; We are sure both files exist at this point. We assume that 2176 ;; We are sure both files exist at this point.
2177 ;; both files are Tramp files, otherwise we issue an error
2178 ;; message. Todo: make a better error message.
2179 (t 2177 (t
2180 (save-excursion 2178 (save-excursion
2181 (with-parsed-tramp-file-name file1 v1 2179 ;; We try to get the mtime of both files. If they are not
2182 (with-parsed-tramp-file-name file2 v2 2180 ;; equal to the "dont-know" value, then we subtract the times
2183 (when (and (tramp-ange-ftp-file-name-p v1-multi-method v1-method) 2181 ;; and obtain the result.
2184 (tramp-ange-ftp-file-name-p v2-multi-method v2-method)) 2182 (let ((fa1 (file-attributes file1))
2185 (tramp-invoke-ange-ftp 'file-newer-than-file-p 2183 (fa2 (file-attributes file2)))
2186 file1 file2)) 2184 (if (and (not (equal (nth 5 fa1) '(0 0)))
2187 (unless (and (equal v1-multi-method v2-multi-method) 2185 (not (equal (nth 5 fa2) '(0 0))))
2188 (equal v1-method v2-method) 2186 (> 0 (car (subtract-time (nth 5 fa1) (nth 5 fa2))))
2189 (equal v1-user v2-user) 2187 ;; If one of them is the dont-know value, then we can
2190 (equal v1-host v2-host)) 2188 ;; still try to run a shell command on the remote host.
2191 (signal 'file-error 2189 ;; However, this only works if both files are Tramp
2192 (list "Files must have same method, user, host" 2190 ;; files and both have the same method, same user, same
2193 file1 file2))) 2191 ;; host.
2194 (unless (and (tramp-tramp-file-p file1) 2192 (unless (and (tramp-tramp-file-p file1)
2195 (tramp-tramp-file-p file2)) 2193 (tramp-tramp-file-p file2))
2196 (signal 'file-error 2194 (signal
2197 (list "Files must be tramp files on same host" 2195 'file-error
2198 file1 file2))) 2196 (list
2199 (if (tramp-get-test-groks-nt 2197 "Cannot check if Tramp file is newer than non-Tramp file"
2200 v1-multi-method v1-method v1-user v1-host) 2198 file1 file2)))
2201 (zerop (tramp-run-test2 "test" file1 file2 "-nt")) 2199 (with-parsed-tramp-file-name file1 v1
2202 (zerop (tramp-run-test2 "tramp_test_nt" file1 file2))))))))) 2200 (with-parsed-tramp-file-name file2 v2
2201 (when (and (tramp-ange-ftp-file-name-p
2202 v1-multi-method v1-method)
2203 (tramp-ange-ftp-file-name-p
2204 v2-multi-method v2-method))
2205 (tramp-invoke-ange-ftp 'file-newer-than-file-p
2206 file1 file2))
2207 (unless (and (equal v1-multi-method v2-multi-method)
2208 (equal v1-method v2-method)
2209 (equal v1-user v2-user)
2210 (equal v1-host v2-host))
2211 (signal 'file-error
2212 (list "Files must have same method, user, host"
2213 file1 file2)))
2214 (unless (and (tramp-tramp-file-p file1)
2215 (tramp-tramp-file-p file2))
2216 (signal 'file-error
2217 (list "Files must be tramp files on same host"
2218 file1 file2)))
2219 (if (tramp-get-test-groks-nt
2220 v1-multi-method v1-method v1-user v1-host)
2221 (zerop (tramp-run-test2 "test" file1 file2 "-nt"))
2222 (zerop (tramp-run-test2
2223 "tramp_test_nt" file1 file2)))))))))))
2203 2224
2204;; Functions implemented using the basic functions above. 2225;; Functions implemented using the basic functions above.
2205 2226
@@ -2952,10 +2973,12 @@ This will break if COMMAND prints a newline, followed by the value of
2952 (let ((trampbuf (get-buffer-create "*tramp output*")) 2973 (let ((trampbuf (get-buffer-create "*tramp output*"))
2953 (rcp-program (tramp-get-rcp-program 2974 (rcp-program (tramp-get-rcp-program
2954 multi-method 2975 multi-method
2955 (tramp-find-method multi-method method user host))) 2976 (tramp-find-method multi-method method user host)
2977 user host))
2956 (rcp-args (tramp-get-rcp-args 2978 (rcp-args (tramp-get-rcp-args
2957 multi-method 2979 multi-method
2958 (tramp-find-method multi-method method user host))) 2980 (tramp-find-method multi-method method user host)
2981 user host))
2959 tmpfil) 2982 tmpfil)
2960 (unless (file-exists-p filename) 2983 (unless (file-exists-p filename)
2961 (error "Cannot make local copy of non-existing file `%s'" 2984 (error "Cannot make local copy of non-existing file `%s'"
@@ -3122,10 +3145,12 @@ This will break if COMMAND prints a newline, followed by the value of
3122 start end filename append visit)) 3145 start end filename append visit))
3123 (let ((curbuf (current-buffer)) 3146 (let ((curbuf (current-buffer))
3124 (rcp-program (tramp-get-rcp-program 3147 (rcp-program (tramp-get-rcp-program
3125 multi-method (tramp-find-method multi-method method user host))) 3148 multi-method (tramp-find-method multi-method method user host)
3149 user host))
3126 (rcp-args (tramp-get-rcp-args 3150 (rcp-args (tramp-get-rcp-args
3127 multi-method 3151 multi-method
3128 (tramp-find-method multi-method method user host))) 3152 (tramp-find-method multi-method method user host)
3153 user host))
3129 (rem-enc (tramp-get-remote-encoding multi-method method user host)) 3154 (rem-enc (tramp-get-remote-encoding multi-method method user host))
3130 (rem-dec (tramp-get-remote-decoding multi-method method user host)) 3155 (rem-dec (tramp-get-remote-decoding multi-method method user host))
3131 (loc-enc (tramp-get-local-encoding multi-method method user host)) 3156 (loc-enc (tramp-get-local-encoding multi-method method user host))
@@ -4227,7 +4252,7 @@ file exists and nonzero exit status otherwise."
4227 9 "Setting remote shell prompt...done") 4252 9 "Setting remote shell prompt...done")
4228 ) 4253 )
4229 (t (tramp-message 5 "Remote `%s' groks tilde expansion, good" 4254 (t (tramp-message 5 "Remote `%s' groks tilde expansion, good"
4230 (tramp-get-remote-sh multi-method method)))))) 4255 (tramp-get-remote-sh multi-method method user host))))))
4231 4256
4232(defun tramp-check-ls-command (multi-method method user host cmd) 4257(defun tramp-check-ls-command (multi-method method user host cmd)
4233 "Checks whether the given `ls' executable groks `-n'. 4258 "Checks whether the given `ls' executable groks `-n'.
@@ -4481,11 +4506,13 @@ Maybe the different regular expressions need to be tuned.
4481 (tramp-get-buffer multi-method method user host) 4506 (tramp-get-buffer multi-method method user host)
4482 (tramp-get-telnet-program 4507 (tramp-get-telnet-program
4483 multi-method 4508 multi-method
4484 (tramp-find-method multi-method method user host)) 4509 (tramp-find-method multi-method method user host)
4510 user host)
4485 host 4511 host
4486 (tramp-get-telnet-args 4512 (tramp-get-telnet-args
4487 multi-method 4513 multi-method
4488 (tramp-find-method multi-method method user host)))) 4514 (tramp-find-method multi-method method user host)
4515 user host)))
4489 (found nil) 4516 (found nil)
4490 (pw nil)) 4517 (pw nil))
4491 (process-kill-without-query p) 4518 (process-kill-without-query p)
@@ -4536,10 +4563,12 @@ arguments, and xx will be used as the host name to connect to.
4536 (buf (tramp-get-buffer multi-method method user host)) 4563 (buf (tramp-get-buffer multi-method method user host))
4537 (rsh-program (tramp-get-rsh-program 4564 (rsh-program (tramp-get-rsh-program
4538 multi-method 4565 multi-method
4539 (tramp-find-method multi-method method user host))) 4566 (tramp-find-method multi-method method user host)
4567 user host))
4540 (rsh-args (tramp-get-rsh-args 4568 (rsh-args (tramp-get-rsh-args
4541 multi-method 4569 multi-method
4542 (tramp-find-method multi-method method user host)))) 4570 (tramp-find-method multi-method method user host)
4571 user host)))
4543 ;; The following should be changed. We need a more general 4572 ;; The following should be changed. We need a more general
4544 ;; mechanism to parse extra host args. 4573 ;; mechanism to parse extra host args.
4545 (when (string-match "\\([^#]*\\)#\\(.*\\)" host) 4574 (when (string-match "\\([^#]*\\)#\\(.*\\)" host)
@@ -4609,13 +4638,15 @@ prompt than you do, so it is not at all unlikely that the variable
4609 (tramp-get-buffer multi-method method user host) 4638 (tramp-get-buffer multi-method method user host)
4610 (tramp-get-su-program 4639 (tramp-get-su-program
4611 multi-method 4640 multi-method
4612 (tramp-find-method multi-method method user host)) 4641 (tramp-find-method multi-method method user host)
4642 user host)
4613 (mapcar 4643 (mapcar
4614 '(lambda (x) 4644 '(lambda (x)
4615 (format-spec x `((?u . ,(or user "root"))))) 4645 (format-spec x `((?u . ,(or user "root")))))
4616 (tramp-get-su-args 4646 (tramp-get-su-args
4617 multi-method 4647 multi-method
4618 (tramp-find-method multi-method method user host))))) 4648 (tramp-find-method multi-method method user host)
4649 user host))))
4619 (found nil) 4650 (found nil)
4620 (pw nil)) 4651 (pw nil))
4621 (process-kill-without-query p) 4652 (process-kill-without-query p)
@@ -4857,7 +4888,8 @@ to set up. METHOD, USER and HOST specify the connection."
4857 ;; Pittman reports that the unusual positioning of the single quotes 4888 ;; Pittman reports that the unusual positioning of the single quotes
4858 ;; makes it work under `rc', too. 4889 ;; makes it work under `rc', too.
4859 (process-send-string nil (format "exec env 'PS1=$ ' %s%s" 4890 (process-send-string nil (format "exec env 'PS1=$ ' %s%s"
4860 (tramp-get-remote-sh multi-method method) 4891 (tramp-get-remote-sh
4892 multi-method method user host)
4861 tramp-rsh-end-of-line)) 4893 tramp-rsh-end-of-line))
4862 (when tramp-debug-buffer 4894 (when tramp-debug-buffer
4863 (save-excursion 4895 (save-excursion
@@ -4865,15 +4897,16 @@ to set up. METHOD, USER and HOST specify the connection."
4865 (goto-char (point-max)) 4897 (goto-char (point-max))
4866 (tramp-insert-with-face 4898 (tramp-insert-with-face
4867 'bold (format "$ exec env PS1='$ ' %s\n" 4899 'bold (format "$ exec env PS1='$ ' %s\n"
4868 (tramp-get-remote-sh multi-method method))))) 4900 (tramp-get-remote-sh multi-method method user host)))))
4869 (tramp-message 9 "Waiting 30s for remote `%s' to come up..." 4901 (tramp-message 9 "Waiting 30s for remote `%s' to come up..."
4870 (tramp-get-remote-sh multi-method method)) 4902 (tramp-get-remote-sh multi-method method user host))
4871 (unless (tramp-wait-for-regexp 4903 (unless (tramp-wait-for-regexp
4872 p 30 (format "\\(%s\\|%s\\)\\'" 4904 p 30 (format "\\(%s\\|%s\\)\\'"
4873 shell-prompt-pattern tramp-shell-prompt-pattern)) 4905 shell-prompt-pattern tramp-shell-prompt-pattern))
4874 (pop-to-buffer (buffer-name)) 4906 (pop-to-buffer (buffer-name))
4875 (error "Remote `%s' didn't come up. See buffer `%s' for details" 4907 (error "Remote `%s' didn't come up. See buffer `%s' for details"
4876 (tramp-get-remote-sh multi-method method) (buffer-name))) 4908 (tramp-get-remote-sh multi-method method user host)
4909 (buffer-name)))
4877 (tramp-message 9 "Setting up remote shell environment") 4910 (tramp-message 9 "Setting up remote shell environment")
4878 (tramp-discard-garbage-erase-buffer p multi-method method user host) 4911 (tramp-discard-garbage-erase-buffer p multi-method method user host)
4879 (process-send-string 4912 (process-send-string
@@ -5099,7 +5132,8 @@ locale to C and sets up the remote shell search path."
5099 (tramp-wait-for-output) 5132 (tramp-wait-for-output)
5100 (unless (tramp-get-rcp-program 5133 (unless (tramp-get-rcp-program
5101 multi-method 5134 multi-method
5102 (tramp-find-method multi-method method user host)) 5135 (tramp-find-method multi-method method user host)
5136 user host)
5103 (tramp-message 5 "Sending the Perl `mime-encode' implementations.") 5137 (tramp-message 5 "Sending the Perl `mime-encode' implementations.")
5104 (tramp-send-linewise 5138 (tramp-send-linewise
5105 multi-method method user host 5139 multi-method method user host
@@ -5140,7 +5174,8 @@ locale to C and sets up the remote shell search path."
5140 ;; Find the right encoding/decoding commands to use. 5174 ;; Find the right encoding/decoding commands to use.
5141 (unless (tramp-get-rcp-program 5175 (unless (tramp-get-rcp-program
5142 multi-method 5176 multi-method
5143 (tramp-find-method multi-method method user host)) 5177 (tramp-find-method multi-method method user host)
5178 user host)
5144 (tramp-find-inline-encoding multi-method method user host)) 5179 (tramp-find-inline-encoding multi-method method user host))
5145 ;; If encoding/decoding command are given, test to see if they work. 5180 ;; If encoding/decoding command are given, test to see if they work.
5146 ;; CCC: Maybe it would be useful to run the encoder both locally and 5181 ;; CCC: Maybe it would be useful to run the encoder both locally and
@@ -5345,7 +5380,8 @@ connection if a previous connection has died for some reason."
5345 (delete-process p)) 5380 (delete-process p))
5346 (funcall (tramp-get-connection-function 5381 (funcall (tramp-get-connection-function
5347 multi-method 5382 multi-method
5348 (tramp-find-method multi-method method user host)) 5383 (tramp-find-method multi-method method user host)
5384 user host)
5349 multi-method method user host)))) 5385 multi-method method user host))))
5350 5386
5351(defun tramp-send-command 5387(defun tramp-send-command
@@ -5835,7 +5871,8 @@ It is important to check for this condition, since it is not possible
5835to enter a password for the `tramp-rcp-program'." 5871to enter a password for the `tramp-rcp-program'."
5836 (tramp-get-rcp-program 5872 (tramp-get-rcp-program
5837 multi-method 5873 multi-method
5838 (tramp-find-method multi-method method user host))) 5874 (tramp-find-method multi-method method user host)
5875 user host))
5839 5876
5840;; Variables local to connection. 5877;; Variables local to connection.
5841 5878
diff --git a/man/tramp.texi b/man/tramp.texi
index 66b16b23fd7..c5b8e9ca7b4 100644
--- a/man/tramp.texi
+++ b/man/tramp.texi
@@ -12,7 +12,7 @@
12@c Makefile, so you should edit the top-level Makefile to change 12@c Makefile, so you should edit the top-level Makefile to change
13@c the version number. 13@c the version number.
14@macro trampver{} 14@macro trampver{}
152.0.20 152.0.21
16@end macro 16@end macro
17 17
18@c Entries for @command{install-info} to use 18@c Entries for @command{install-info} to use