# HG changeset patch # User Michael Albinus # Date 1268507461 -3600 # Node ID 40467a8dcd6cc1c1affc135ce720cae6aeb8b981 # Parent b09401cc9d96b6332ff309f3c871fc44106d933d * 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. diff -r b09401cc9d96 -r 40467a8dcd6c lisp/ChangeLog --- a/lisp/ChangeLog Sat Mar 13 10:49:54 2010 -0500 +++ b/lisp/ChangeLog Sat Mar 13 20:11:01 2010 +0100 @@ -1,3 +1,12 @@ +2010-03-13 Michael Albinus + + * 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. + 2010-03-13 Eric M. Ludlam * cedet/semantic/imenu.el: New file, from the CEDET repository diff -r b09401cc9d96 -r 40467a8dcd6c lisp/net/tramp.el --- a/lisp/net/tramp.el Sat Mar 13 10:49:54 2010 -0500 +++ b/lisp/net/tramp.el Sat Mar 13 20:11:01 2010 +0100 @@ -6294,7 +6294,7 @@ Returns the absolute file name of PROGNAME, if found, and nil otherwise. This function expects to be in the right *tramp* buffer." - (with-current-buffer (tramp-get-buffer vec) + (with-current-buffer (tramp-get-connection-buffer vec) (let (result) ;; Check whether the executable is in $PATH. "which(1)" does not ;; report always a correct error code; therefore we check the @@ -6302,7 +6302,7 @@ (unless ignore-path (tramp-send-command vec (format "which \\%s | wc -w" progname)) (goto-char (point-min)) - (if (looking-at "^1$") + (if (looking-at "^\\s-*1$") (setq result (concat "\\" progname)))) (unless result (when ignore-tilde @@ -6403,12 +6403,15 @@ (with-current-buffer (tramp-get-buffer vec) (tramp-send-command vec "echo ~root" t) (cond - ((string-match "^~root$" (buffer-string)) + ((or (string-match "^~root$" (buffer-string)) + ;; The default shell (ksh93) of OpenSolaris is buggy. + (string-equal (tramp-get-connection-property vec "uname" "") + "SunOS 5.11")) (setq shell (or (tramp-find-executable - vec "bash" (tramp-get-remote-path vec) t) + vec "bash" (tramp-get-remote-path vec) t t) (tramp-find-executable - vec "ksh" (tramp-get-remote-path vec) t))) + vec "ksh" (tramp-get-remote-path vec) t t))) (unless shell (tramp-error vec 'file-error @@ -6837,9 +6840,11 @@ ;; "test foo; echo $?" to check if various conditions hold, and ;; there are buggy /bin/sh implementations which don't execute the ;; "echo $?" part if the "test" part has an error. In particular, - ;; the Solaris /bin/sh is a problem. I'm betting that all systems - ;; with buggy /bin/sh implementations will have a working bash or - ;; ksh. Whee... + ;; the OpenSolaris /bin/sh is a problem. There are also other + ;; problems with /bin/sh of OpenSolaris, like redirection of stderr + ;; in in function declarations, or changing HISTFILE in place. + ;; Therefore, OpenSolaris' /bin/sh is replaced by bash, when + ;; detected. (tramp-find-shell vec) ;; Disable unexpected output. @@ -6848,12 +6853,6 @@ ;; Set the environment. (tramp-message vec 5 "Setting default environment") - ;; On OpenSolaris, there is a bug when HISTFILE is changed in place - ;; . We - ;; apply the workaround. - (if (string-equal (tramp-get-connection-property vec "uname" "") "SunOS 5.11") - (tramp-send-command vec "unset HISTFILE" t)) - (let ((env (copy-sequence tramp-remote-process-environment)) unset item) (while env