GNU bug report logs - #30595
[PATCH] Handle command line wrapping in Tramp adb.

Previous Next

Package: emacs;

Reported by: Mathieu Othacehe <m.othacehe <at> gmail.com>

Date: Sat, 24 Feb 2018 18:08:02 UTC

Severity: normal

Tags: moreinfo, patch, wontfix

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 30595 in the body.
You can then email your comments to 30595 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#30595; Package emacs. (Sat, 24 Feb 2018 18:08:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mathieu Othacehe <m.othacehe <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 24 Feb 2018 18:08:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <m.othacehe <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Cc: Mathieu Othacehe <m.othacehe <at> gmail.com>
Subject: [PATCH] Handle command line wrapping in Tramp adb.
Date: Sat, 24 Feb 2018 19:07:09 +0100
The command sent to an adb shell input might be wrapped around
terminal column count by the kernel. Remove CR and LF introduced when
it happends.

* lisp/net/tramp-adb.el (tramp-adb-send-command): Remove W32 trailing
  CR but also CR/LF introduced by command line wrapping.
---
 lisp/net/tramp-adb.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index be269aca51..532569414b 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -1178,14 +1178,17 @@ tramp-adb-send-command
   (with-current-buffer (tramp-get-connection-buffer vec)
     (save-excursion
       (goto-char (point-min))
-      ;; We can't use stty to disable echo of command.
-      (delete-matching-lines (regexp-quote command))
       ;; When the local machine is W32, there are still trailing ^M.
       ;; There must be a better solution by setting the correct coding
       ;; system, but this requires changes in core Tramp.
+      ;;
+      ;; Also remove CR and LF introduced by kernel when input command
+      ;; is longer than terminal column count.
+      (while (re-search-forward "\r+\n*" nil t)
+	(replace-match "" nil nil))
       (goto-char (point-min))
-      (while (re-search-forward "\r+$" nil t)
-	(replace-match "" nil nil)))))
+      ;; We can't use stty to disable echo of command.
+      (delete-matching-lines (regexp-quote command)))))
 
 (defun tramp-adb-send-command-and-check (vec command)
   "Run COMMAND and check its exit status.
-- 
2.16.1





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30595; Package emacs. (Mon, 26 Feb 2018 16:01:01 GMT) Full text and rfc822 format available.

Message #8 received at 30595 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Mathieu Othacehe <m.othacehe <at> gmail.com>
Cc: 30595 <at> debbugs.gnu.org
Subject: Re: bug#30595: [PATCH] Handle command line wrapping in Tramp adb.
Date: Mon, 26 Feb 2018 16:59:58 +0100
Mathieu Othacehe <m.othacehe <at> gmail.com> writes:

Hi Mathieu,

> The command sent to an adb shell input might be wrapped around
> terminal column count by the kernel. Remove CR and LF introduced when
> it happends.

Your patch doesn't pass Tramp's test suite, using my plain Galaxy S6. It
fails in tramp-test09-insert-file-contents. Could you, pls, check?

In order to run the test suite in Tramp's git repository, apply

$ env REMOTE_TEMPORARY_FILE_DIRECTORY=/adb::/sdcard/tmp make check

If you use Emacs' git repository instead, apply

$ env REMOTE_TEMPORARY_FILE_DIRECTORY=/adb::/sdcard/tmp \
  make check -C test tramp-tests

(You might use another temporary directory on your device.)

Pls sync first with the git repository; I've pushed a patch earlier
today fixing another nasty (unrelated) bug which let Tramp fail in test.

Btw, your other patch wrt bug#30594 runs OK with the tests.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30595; Package emacs. (Tue, 27 Feb 2018 17:14:01 GMT) Full text and rfc822 format available.

Message #11 received at 30595 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <m.othacehe <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 30595 <at> debbugs.gnu.org
Subject: Re: bug#30595: [PATCH] Handle command line wrapping in Tramp adb.
Date: Tue, 27 Feb 2018 18:13:24 +0100
Hi Michael,

> Pls sync first with the git repository; I've pushed a patch earlier
> today fixing another nasty (unrelated) bug which let Tramp fail in test.
>
> Btw, your other patch wrt bug#30594 runs OK with the tests.

Ok I'll try to understand why it breaks tramp tests.

Thanks for pushing the previous patch,

Mathieu




Added tag(s) moreinfo. Request was from Michael Albinus <michael.albinus <at> gmx.de> to control <at> debbugs.gnu.org. (Sat, 03 Mar 2018 18:37:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30595; Package emacs. (Mon, 14 May 2018 11:10:01 GMT) Full text and rfc822 format available.

Message #16 received at 30595 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Mathieu Othacehe <m.othacehe <at> gmail.com>
Cc: 30595 <at> debbugs.gnu.org
Subject: Re: bug#30595: [PATCH] Handle command line wrapping in Tramp adb.
Date: Mon, 14 May 2018 13:09:25 +0200
Mathieu Othacehe <m.othacehe <at> gmail.com> writes:

> Hi Michael,

Hi Mathieu,

>> Pls sync first with the git repository; I've pushed a patch earlier
>> today fixing another nasty (unrelated) bug which let Tramp fail in test.
>
> Ok I'll try to understand why it breaks tramp tests.

Ping.

> Mathieu

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#30595; Package emacs. (Tue, 05 Jun 2018 11:10:02 GMT) Full text and rfc822 format available.

Message #19 received at 30595 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Mathieu Othacehe <m.othacehe <at> gmail.com>
Cc: 30595 <at> debbugs.gnu.org
Subject: Re: bug#30595: [PATCH] Handle command line wrapping in Tramp adb.
Date: Tue, 05 Jun 2018 13:09:44 +0200
Michael Albinus <michael.albinus <at> gmx.de> writes:

> Mathieu Othacehe <m.othacehe <at> gmail.com> writes:

Hi Mathieu,

>>> Pls sync first with the git repository; I've pushed a patch earlier
>>> today fixing another nasty (unrelated) bug which let Tramp fail in test.
>>
>> Ok I'll try to understand why it breaks tramp tests.
>
> Ping.

No progress, so I'm closing the bug. If you still intend to propose a
patch, you could reply.

>> Mathieu

Best regards, Michael.




Added tag(s) wontfix. Request was from Michael Albinus <michael.albinus <at> gmx.de> to control <at> debbugs.gnu.org. (Tue, 05 Jun 2018 11:11:01 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 30595 <at> debbugs.gnu.org and Mathieu Othacehe <m.othacehe <at> gmail.com> Request was from Michael Albinus <michael.albinus <at> gmx.de> to control <at> debbugs.gnu.org. (Tue, 05 Jun 2018 11:11:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 03 Jul 2018 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 292 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.