aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2010-05-10 17:50:30 +0200
committerMichael Albinus2010-05-10 17:50:30 +0200
commit94ecf5dae9490427cb05c0e4c4467810997ef05b (patch)
treec37734118542443a54816c067ed2a247c7c4b1da
parent77e2fc7a44f3a407c7124e89ef7007f0f97e8a86 (diff)
downloademacs-94ecf5dae9490427cb05c0e4c4467810997ef05b.tar.gz
emacs-94ecf5dae9490427cb05c0e4c4467810997ef05b.zip
* net/tramp.el (tramp-do-file-attributes-with-stat): Add space in
format string, in order to work around a bug in pdksh. Reported by Gilles Pion <gpion@lfdj.com>. (tramp-handle-verify-visited-file-modtime): Do not send a command when the connection is not established. (tramp-handle-set-file-times): Simplify the check for utc.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/net/tramp.el33
2 files changed, 25 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 26b56bd7b69..8bc5a26df8f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12010-05-10 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/tramp.el (tramp-do-file-attributes-with-stat): Add space in
4 format string, in order to work around a bug in pdksh. Reported
5 by Gilles Pion <gpion@lfdj.com>.
6 (tramp-handle-verify-visited-file-modtime): Do not send a command
7 when the connection is not established.
8 (tramp-handle-set-file-times): Simplify the check for utc.
9
12010-05-10 Juanma Barranquero <lekktu@gmail.com> 102010-05-10 Juanma Barranquero <lekktu@gmail.com>
2 11
3 Fix use of `filter-buffer-substring' (rework previous change). 12 Fix use of `filter-buffer-substring' (rework previous change).
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 3a291cfb695..2da11bda834 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -2867,7 +2867,9 @@ target of the symlink differ."
2867 (tramp-send-command-and-read 2867 (tramp-send-command-and-read
2868 vec 2868 vec
2869 (format 2869 (format
2870 "((%s %s || %s -h %s) && %s -c '((\"%%N\") %%h %s %s %%X.0 %%Y.0 %%Z.0 %%s.0 \"%%A\" t %%i.0 -1)' %s || echo nil)" 2870 ;; On Opsware, pdksh (which is the true name of ksh there) doesn't
2871 ;; parse correctly the sequence "((". Therefore, we add a space.
2872 "( (%s %s || %s -h %s) && %s -c '( (\"%%N\") %%h %s %s %%X.0 %%Y.0 %%Z.0 %%s.0 \"%%A\" t %%i.0 -1)' %s || echo nil)"
2871 (tramp-get-file-exists-command vec) 2873 (tramp-get-file-exists-command vec)
2872 (tramp-shell-quote-argument localname) 2874 (tramp-shell-quote-argument localname)
2873 (tramp-get-test-command vec) 2875 (tramp-get-test-command vec)
@@ -2920,12 +2922,14 @@ already know that the buffer is visiting a file and that
2920function directly, unless those two cases are already taken care 2922function directly, unless those two cases are already taken care
2921of." 2923of."
2922 (with-current-buffer buf 2924 (with-current-buffer buf
2923 ;; There is no file visiting the buffer, or the buffer has no 2925 (let ((f (buffer-file-name)))
2924 ;; recorded last modification time. 2926 ;; There is no file visiting the buffer, or the buffer has no
2925 (if (or (not (buffer-file-name)) 2927 ;; recorded last modification time, or there is no established
2926 (eq (visited-file-modtime) 0)) 2928 ;; connection.
2927 t 2929 (if (or (not f)
2928 (let ((f (buffer-file-name))) 2930 (eq (visited-file-modtime) 0)
2931 (not (tramp-file-name-handler 'file-remote-p f nil 'connected)))
2932 t
2929 (with-parsed-tramp-file-name f nil 2933 (with-parsed-tramp-file-name f nil
2930 (tramp-flush-file-property v localname) 2934 (tramp-flush-file-property v localname)
2931 (let* ((attr (file-attributes f)) 2935 (let* ((attr (file-attributes f))
@@ -2984,16 +2988,11 @@ of."
2984 (let ((time (if (or (null time) (equal time '(0 0))) 2988 (let ((time (if (or (null time) (equal time '(0 0)))
2985 (current-time) 2989 (current-time)
2986 time)) 2990 time))
2987 (utc 2991 ;; With GNU Emacs, `format-time-string' has an optional
2988 ;; With GNU Emacs, `format-time-string' has an 2992 ;; parameter UNIVERSAL. This is preferred, because we
2989 ;; optional parameter UNIVERSAL. This is preferred, 2993 ;; could handle the case when the remote host is
2990 ;; because we could handle the case when the remote 2994 ;; located in a different time zone as the local host.
2991 ;; host is located in a different time zone as the 2995 (utc (not (featurep 'xemacs))))
2992 ;; local host.
2993 (and (functionp 'subr-arity)
2994 (subrp (symbol-function 'format-time-string))
2995 (= 3 (cdr (tramp-compat-funcall
2996 'subr-arity 'format-time-string))))))
2997 (tramp-send-command-and-check 2996 (tramp-send-command-and-check
2998 v (format "%s touch -t %s %s" 2997 v (format "%s touch -t %s %s"
2999 (if utc "TZ=UTC; export TZ;" "") 2998 (if utc "TZ=UTC; export TZ;" "")