aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2010-03-13 20:11:01 +0100
committerMichael Albinus2010-03-13 20:11:01 +0100
commitc0e17ff2f203128a953ac59b3354a3db865e1c05 (patch)
tree3e11ae3e2f2fd007b63c01e3ebfb8b86efc5847c
parent6408fd427b47be7c301d31fe394d01f6a3ba23af (diff)
downloademacs-c0e17ff2f203128a953ac59b3354a3db865e1c05.tar.gz
emacs-c0e17ff2f203128a953ac59b3354a3db865e1c05.zip
* net/tramp.el (tramp-find-executable): Use
`tramp-get-connection-buffer'. Make the regexp for checking output of "wc -l" more robust. (tramp-find-shell): Use another shell but /bin/sh on OpenSolaris. (tramp-open-connection-setup-interactive-shell): Remove workaround for OpenSolaris bug, it is not needed anymore.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/net/tramp.el27
2 files changed, 22 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1422de1cf51..39d88698acd 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12010-03-13 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/tramp.el (tramp-find-executable): Use
4 `tramp-get-connection-buffer'. Make the regexp for checking
5 output of "wc -l" more robust.
6 (tramp-find-shell): Use another shell but /bin/sh on OpenSolaris.
7 (tramp-open-connection-setup-interactive-shell): Remove workaround
8 for OpenSolaris bug, it is not needed anymore.
9
12010-03-13 Eric M. Ludlam <zappo@gnu.org> 102010-03-13 Eric M. Ludlam <zappo@gnu.org>
2 11
3 * cedet/semantic/imenu.el: New file, from the CEDET repository 12 * cedet/semantic/imenu.el: New file, from the CEDET repository
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index c029f073724..a0fe20c2a99 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -6294,7 +6294,7 @@ only in DIRLIST.
6294Returns the absolute file name of PROGNAME, if found, and nil otherwise. 6294Returns the absolute file name of PROGNAME, if found, and nil otherwise.
6295 6295
6296This function expects to be in the right *tramp* buffer." 6296This function expects to be in the right *tramp* buffer."
6297 (with-current-buffer (tramp-get-buffer vec) 6297 (with-current-buffer (tramp-get-connection-buffer vec)
6298 (let (result) 6298 (let (result)
6299 ;; Check whether the executable is in $PATH. "which(1)" does not 6299 ;; Check whether the executable is in $PATH. "which(1)" does not
6300 ;; report always a correct error code; therefore we check the 6300 ;; report always a correct error code; therefore we check the
@@ -6302,7 +6302,7 @@ This function expects to be in the right *tramp* buffer."
6302 (unless ignore-path 6302 (unless ignore-path
6303 (tramp-send-command vec (format "which \\%s | wc -w" progname)) 6303 (tramp-send-command vec (format "which \\%s | wc -w" progname))
6304 (goto-char (point-min)) 6304 (goto-char (point-min))
6305 (if (looking-at "^1$") 6305 (if (looking-at "^\\s-*1$")
6306 (setq result (concat "\\" progname)))) 6306 (setq result (concat "\\" progname))))
6307 (unless result 6307 (unless result
6308 (when ignore-tilde 6308 (when ignore-tilde
@@ -6403,12 +6403,15 @@ file exists and nonzero exit status otherwise."
6403 (with-current-buffer (tramp-get-buffer vec) 6403 (with-current-buffer (tramp-get-buffer vec)
6404 (tramp-send-command vec "echo ~root" t) 6404 (tramp-send-command vec "echo ~root" t)
6405 (cond 6405 (cond
6406 ((string-match "^~root$" (buffer-string)) 6406 ((or (string-match "^~root$" (buffer-string))
6407 ;; The default shell (ksh93) of OpenSolaris is buggy.
6408 (string-equal (tramp-get-connection-property vec "uname" "")
6409 "SunOS 5.11"))
6407 (setq shell 6410 (setq shell
6408 (or (tramp-find-executable 6411 (or (tramp-find-executable
6409 vec "bash" (tramp-get-remote-path vec) t) 6412 vec "bash" (tramp-get-remote-path vec) t t)
6410 (tramp-find-executable 6413 (tramp-find-executable
6411 vec "ksh" (tramp-get-remote-path vec) t))) 6414 vec "ksh" (tramp-get-remote-path vec) t t)))
6412 (unless shell 6415 (unless shell
6413 (tramp-error 6416 (tramp-error
6414 vec 'file-error 6417 vec 'file-error
@@ -6837,9 +6840,11 @@ process to set up. VEC specifies the connection."
6837 ;; "test foo; echo $?" to check if various conditions hold, and 6840 ;; "test foo; echo $?" to check if various conditions hold, and
6838 ;; there are buggy /bin/sh implementations which don't execute the 6841 ;; there are buggy /bin/sh implementations which don't execute the
6839 ;; "echo $?" part if the "test" part has an error. In particular, 6842 ;; "echo $?" part if the "test" part has an error. In particular,
6840 ;; the Solaris /bin/sh is a problem. I'm betting that all systems 6843 ;; the OpenSolaris /bin/sh is a problem. There are also other
6841 ;; with buggy /bin/sh implementations will have a working bash or 6844 ;; problems with /bin/sh of OpenSolaris, like redirection of stderr
6842 ;; ksh. Whee... 6845 ;; in in function declarations, or changing HISTFILE in place.
6846 ;; Therefore, OpenSolaris' /bin/sh is replaced by bash, when
6847 ;; detected.
6843 (tramp-find-shell vec) 6848 (tramp-find-shell vec)
6844 6849
6845 ;; Disable unexpected output. 6850 ;; Disable unexpected output.
@@ -6848,12 +6853,6 @@ process to set up. VEC specifies the connection."
6848 ;; Set the environment. 6853 ;; Set the environment.
6849 (tramp-message vec 5 "Setting default environment") 6854 (tramp-message vec 5 "Setting default environment")
6850 6855
6851 ;; On OpenSolaris, there is a bug when HISTFILE is changed in place
6852 ;; <http://bugs.opensolaris.org/view_bug.do?bug_id=6834184>. We
6853 ;; apply the workaround.
6854 (if (string-equal (tramp-get-connection-property vec "uname" "") "SunOS 5.11")
6855 (tramp-send-command vec "unset HISTFILE" t))
6856
6857 (let ((env (copy-sequence tramp-remote-process-environment)) 6856 (let ((env (copy-sequence tramp-remote-process-environment))
6858 unset item) 6857 unset item)
6859 (while env 6858 (while env