diff options
| author | Michael Albinus | 2010-01-28 07:06:41 +0100 |
|---|---|---|
| committer | Michael Albinus | 2010-01-28 07:06:41 +0100 |
| commit | 7e5686f0e5721b10a43b677716c8e99c8d3fa127 (patch) | |
| tree | 874f06f4015060bb3789b140cf2aaf0f1cb5f98b | |
| parent | c85a168b398d680a6e67c2e4229a849889722c64 (diff) | |
| download | emacs-7e5686f0e5721b10a43b677716c8e99c8d3fa127.tar.gz emacs-7e5686f0e5721b10a43b677716c8e99c8d3fa127.zip | |
Fix some busybox annoyances.
* net/tramp.el (tramp-wrong-passwd-regexp): Add "Timeout, server
not responding." string.
(tramp-open-connection-setup-interactive-shell): Dump stty
settings. Enable "neveropen" arg for all `tramp-send-command'
calls. Handle "=" in variable values properly.
(tramp-find-inline-encoding): Raise an error, when no encoding is
found.
(tramp-wait-for-output): Check, whether PROC buffer is available.
Remove spurious " ^H" sequences, sent by busybox.
(tramp-get-ls-command): Suppress coloring, if possible.
| -rw-r--r-- | lisp/ChangeLog | 15 | ||||
| -rwxr-xr-x[-rw-r--r--] | lisp/net/tramp.el | 48 |
2 files changed, 53 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e92c89fa2ea..6b0c6a016ed 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,18 @@ | |||
| 1 | 2010-01-28 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | Fix some busybox annoyances. | ||
| 4 | |||
| 5 | * net/tramp.el (tramp-wrong-passwd-regexp): Add "Timeout, server | ||
| 6 | not responding." string. | ||
| 7 | (tramp-open-connection-setup-interactive-shell): Dump stty | ||
| 8 | settings. Enable "neveropen" arg for all `tramp-send-command' | ||
| 9 | calls. Handle "=" in variable values properly. | ||
| 10 | (tramp-find-inline-encoding): Raise an error, when no encoding is | ||
| 11 | found. | ||
| 12 | (tramp-wait-for-output): Check, whether PROC buffer is available. | ||
| 13 | Remove spurious " ^H" sequences, sent by busybox. | ||
| 14 | (tramp-get-ls-command): Suppress coloring, if possible. | ||
| 15 | |||
| 1 | 2010-01-28 Glenn Morris <rgm@gnu.org> | 16 | 2010-01-28 Glenn Morris <rgm@gnu.org> |
| 2 | 17 | ||
| 3 | * vc-svn.el (vc-svn-update): Use "svn --non-interactive". (Bug#4280) | 18 | * vc-svn.el (vc-svn-update): Use "svn --non-interactive". (Bug#4280) |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 3f4af0ebf0e..d411c69cb96 100644..100755 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -1085,6 +1085,7 @@ The `sudo' program appears to insert a `^@' character into the prompt." | |||
| 1085 | "Login Incorrect" | 1085 | "Login Incorrect" |
| 1086 | "Connection refused" | 1086 | "Connection refused" |
| 1087 | "Connection closed" | 1087 | "Connection closed" |
| 1088 | "Timeout, server not responding." | ||
| 1088 | "Sorry, try again." | 1089 | "Sorry, try again." |
| 1089 | "Name or service not known" | 1090 | "Name or service not known" |
| 1090 | "Host key verification failed." | 1091 | "Host key verification failed." |
| @@ -6732,6 +6733,9 @@ process to set up. VEC specifies the connection." | |||
| 6732 | ;; because we're running on a non-MULE Emacs. Let's try | 6733 | ;; because we're running on a non-MULE Emacs. Let's try |
| 6733 | ;; stty, instead. | 6734 | ;; stty, instead. |
| 6734 | (tramp-send-command vec "stty -onlcr" t)))) | 6735 | (tramp-send-command vec "stty -onlcr" t)))) |
| 6736 | ;; Dump stty settings in the traces. | ||
| 6737 | (when (>= tramp-verbose 10) | ||
| 6738 | (tramp-send-command vec "stty -a" t)) | ||
| 6735 | (tramp-send-command vec "set +o vi +o emacs" t) | 6739 | (tramp-send-command vec "set +o vi +o emacs" t) |
| 6736 | 6740 | ||
| 6737 | ;; Check whether the output of "uname -sr" has been changed. If | 6741 | ;; Check whether the output of "uname -sr" has been changed. If |
| @@ -6801,15 +6805,16 @@ process to set up. VEC specifies the connection." | |||
| 6801 | ;; <http://bugs.opensolaris.org/view_bug.do?bug_id=6834184>. We | 6805 | ;; <http://bugs.opensolaris.org/view_bug.do?bug_id=6834184>. We |
| 6802 | ;; apply the workaround. | 6806 | ;; apply the workaround. |
| 6803 | (if (string-equal (tramp-get-connection-property vec "uname" "") "SunOS 5.11") | 6807 | (if (string-equal (tramp-get-connection-property vec "uname" "") "SunOS 5.11") |
| 6804 | (tramp-send-command vec "unset HISTFILE")) | 6808 | (tramp-send-command vec "unset HISTFILE" t)) |
| 6805 | 6809 | ||
| 6806 | (let ((env (copy-sequence tramp-remote-process-environment)) | 6810 | (let ((env (copy-sequence tramp-remote-process-environment)) |
| 6807 | unset item) | 6811 | unset item) |
| 6808 | (while env | 6812 | (while env |
| 6809 | (setq item (tramp-compat-split-string (car env) "=")) | 6813 | (setq item (tramp-compat-split-string (car env) "=")) |
| 6810 | (if (and (stringp (cadr item)) (not (string-equal (cadr item) ""))) | 6814 | (setcdr item (mapconcat 'identity (cdr item) "=")) |
| 6815 | (if (and (stringp (cdr item)) (not (string-equal (cdr item) ""))) | ||
| 6811 | (tramp-send-command | 6816 | (tramp-send-command |
| 6812 | vec (format "%s=%s; export %s" (car item) (cadr item) (car item)) t) | 6817 | vec (format "%s=%s; export %s" (car item) (cdr item) (car item)) t) |
| 6813 | (push (car item) unset)) | 6818 | (push (car item) unset)) |
| 6814 | (setq env (cdr env))) | 6819 | (setq env (cdr env))) |
| 6815 | (when unset | 6820 | (when unset |
| @@ -6981,7 +6986,8 @@ Goes through the list `tramp-local-coding-commands' and | |||
| 6981 | 6986 | ||
| 6982 | ;; Did we find something? | 6987 | ;; Did we find something? |
| 6983 | (unless found | 6988 | (unless found |
| 6984 | (tramp-message vec 2 "Couldn't find an inline transfer encoding")) | 6989 | (tramp-error |
| 6990 | vec 'file-error "Couldn't find an inline transfer encoding")) | ||
| 6985 | 6991 | ||
| 6986 | ;; Set connection properties. | 6992 | ;; Set connection properties. |
| 6987 | (tramp-message vec 5 "Using local encoding `%s'" loc-enc) | 6993 | (tramp-message vec 5 "Using local encoding `%s'" loc-enc) |
| @@ -7301,7 +7307,10 @@ function waits for output unless NOOUTPUT is set." | |||
| 7301 | (unless nooutput (tramp-wait-for-output p)))) | 7307 | (unless nooutput (tramp-wait-for-output p)))) |
| 7302 | 7308 | ||
| 7303 | (defun tramp-wait-for-output (proc &optional timeout) | 7309 | (defun tramp-wait-for-output (proc &optional timeout) |
| 7304 | "Wait for output from remote rsh command." | 7310 | "Wait for output from remote command." |
| 7311 | (unless (buffer-live-p (process-buffer proc)) | ||
| 7312 | (delete-process proc) | ||
| 7313 | (tramp-error proc 'file-error "Process `%s' not available, try again" proc)) | ||
| 7305 | (with-current-buffer (process-buffer proc) | 7314 | (with-current-buffer (process-buffer proc) |
| 7306 | (let* (;; Initially, `tramp-end-of-output' is "#$ ". There might | 7315 | (let* (;; Initially, `tramp-end-of-output' is "#$ ". There might |
| 7307 | ;; be leading escape sequences, which must be ignored. | 7316 | ;; be leading escape sequences, which must be ignored. |
| @@ -7313,6 +7322,14 @@ function waits for output unless NOOUTPUT is set." | |||
| 7313 | (found (tramp-wait-for-regexp proc timeout regexp1))) | 7322 | (found (tramp-wait-for-regexp proc timeout regexp1))) |
| 7314 | (if found | 7323 | (if found |
| 7315 | (let (buffer-read-only) | 7324 | (let (buffer-read-only) |
| 7325 | ;; A simple-minded busybox has sent " ^H" sequences. | ||
| 7326 | ;; Delete them. | ||
| 7327 | (goto-char (point-min)) | ||
| 7328 | (when (re-search-forward | ||
| 7329 | "^\\(.\b\\)+$" (tramp-compat-line-end-position) t) | ||
| 7330 | (forward-line 1) | ||
| 7331 | (delete-region (point-min) (point))) | ||
| 7332 | ;; Delete the prompt. | ||
| 7316 | (goto-char (point-max)) | 7333 | (goto-char (point-max)) |
| 7317 | (re-search-backward regexp nil t) | 7334 | (re-search-backward regexp nil t) |
| 7318 | (delete-region (point) (point-max))) | 7335 | (delete-region (point) (point-max))) |
| @@ -8002,9 +8019,14 @@ necessary only. This function will be used in file name completion." | |||
| 8002 | (let ((dl (tramp-get-remote-path vec)) | 8019 | (let ((dl (tramp-get-remote-path vec)) |
| 8003 | result) | 8020 | result) |
| 8004 | (while (and dl (setq result (tramp-find-executable vec cmd dl t t))) | 8021 | (while (and dl (setq result (tramp-find-executable vec cmd dl t t))) |
| 8005 | ;; Check parameter. | 8022 | ;; Check parameters. On busybox, "ls" output coloring is |
| 8023 | ;; enabled by default sometimes. So we try to disable it | ||
| 8024 | ;; when possible. $LS_COLORING is not supported there. | ||
| 8006 | (when (zerop (tramp-send-command-and-check | 8025 | (when (zerop (tramp-send-command-and-check |
| 8007 | vec (format "%s -lnd /" result))) | 8026 | vec (format "%s -lnd /" result))) |
| 8027 | (when (zerop (tramp-send-command-and-check | ||
| 8028 | vec (format "%s --color=never /" result))) | ||
| 8029 | (setq result (concat result " --color=never"))) | ||
| 8008 | (throw 'ls-found result)) | 8030 | (throw 'ls-found result)) |
| 8009 | (setq dl (cdr dl)))))) | 8031 | (setq dl (cdr dl)))))) |
| 8010 | (tramp-error vec 'file-error "Couldn't find a proper `ls' command")))) | 8032 | (tramp-error vec 'file-error "Couldn't find a proper `ls' command")))) |
| @@ -8481,8 +8503,6 @@ Only works for Bourne-like shells." | |||
| 8481 | ;; * Don't use globbing for directories with many files, as this is | 8503 | ;; * Don't use globbing for directories with many files, as this is |
| 8482 | ;; likely to produce long command lines, and some shells choke on | 8504 | ;; likely to produce long command lines, and some shells choke on |
| 8483 | ;; long command lines. | 8505 | ;; long command lines. |
| 8484 | ;; * `vc-directory' does not work. It never displays any files, even | ||
| 8485 | ;; if it does show files when run locally. | ||
| 8486 | ;; * How to deal with MULE in `insert-file-contents' and `write-region'? | 8506 | ;; * How to deal with MULE in `insert-file-contents' and `write-region'? |
| 8487 | ;; * Test remote ksh or bash for tilde expansion in `tramp-find-shell'? | 8507 | ;; * Test remote ksh or bash for tilde expansion in `tramp-find-shell'? |
| 8488 | ;; * abbreviate-file-name | 8508 | ;; * abbreviate-file-name |
| @@ -8529,8 +8549,6 @@ Only works for Bourne-like shells." | |||
| 8529 | ;; * Reconnect directly to a compliant shell without first going | 8549 | ;; * Reconnect directly to a compliant shell without first going |
| 8530 | ;; through the user's default shell. (Pete Forman) | 8550 | ;; through the user's default shell. (Pete Forman) |
| 8531 | ;; * Make `tramp-default-user' obsolete. | 8551 | ;; * Make `tramp-default-user' obsolete. |
| 8532 | ;; * Tramp shall reconnect automatically to its ssh connection when it | ||
| 8533 | ;; detects that the process "has died". (David Reitter) | ||
| 8534 | ;; * How can I interrupt the remote process with a signal | 8552 | ;; * How can I interrupt the remote process with a signal |
| 8535 | ;; (interrupt-process seems not to work)? (Markus Triska) | 8553 | ;; (interrupt-process seems not to work)? (Markus Triska) |
| 8536 | ;; * Avoid the local shell entirely for starting remote processes. If | 8554 | ;; * Avoid the local shell entirely for starting remote processes. If |
| @@ -8552,6 +8570,16 @@ Only works for Bourne-like shells." | |||
| 8552 | ;; * Keep a second connection open for out-of-band methods like scp or | 8570 | ;; * Keep a second connection open for out-of-band methods like scp or |
| 8553 | ;; rsync. | 8571 | ;; rsync. |
| 8554 | ;; * Support ptys in `tramp-handle-start-file-process'. | 8572 | ;; * Support ptys in `tramp-handle-start-file-process'. |
| 8573 | ;; * IMHO, it's a drawback that currently Tramp doesn't support | ||
| 8574 | ;; Unicode in Dired file names by default. Is it possible to | ||
| 8575 | ;; improve Tramp to set LC_ALL to "C" only for commands where Tramp | ||
| 8576 | ;; expects English? Or just to set LC_MESSAGES to "C" if Tramp | ||
| 8577 | ;; expects only English messages? (Juri Linkov) | ||
| 8578 | ;; * Make shadowfile.el grok Tramp filenames. (Bug#4526, Bug#4846) | ||
| 8579 | ;; * Do not handle files with drive letter as remote. (Bug#5447) | ||
| 8580 | ;; * Load Tramp subpackages only when needed. (Bug#1529, Bug#5448) | ||
| 8581 | ;; * Try telnet+curl as new method. It might be useful for busybox, | ||
| 8582 | ;; without built-in uuencode/uudecode. | ||
| 8555 | 8583 | ||
| 8556 | ;; Functions for file-name-handler-alist: | 8584 | ;; Functions for file-name-handler-alist: |
| 8557 | ;; diff-latest-backup-file -- in diff.el | 8585 | ;; diff-latest-backup-file -- in diff.el |