emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 288b3ca: Fix Tramp for Android 7


From: Michael Albinus
Subject: [Emacs-diffs] master 288b3ca: Fix Tramp for Android 7
Date: Sun, 28 May 2017 07:06:59 -0400 (EDT)

branch: master
commit 288b3ca2e519903653b9bc88d281ecd9f6b162a4
Author: Jürgen Hötzel <address@hidden>
Commit: Michael Albinus <address@hidden>

    Fix Tramp for Android 7
    
    * tramp-adb.el (tramp-adb-ls-toolbox-regexp):
    Username part of prompt is empty on Android 7.
    (tramp-adb-ls-toolbox-regexp):
    Ignore addition links column on Android 7.
    (tramp-adb-get-ls-command):
    Dont use --color=none when using toybox (Android 7).  It's not
    possible to disable coloring explicitly for toybox ls.
---
 lisp/net/tramp-adb.el | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index a6c2c14..e9a3d00 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -58,7 +58,7 @@ It is used for TCP/IP devices."
 
 ;;;###tramp-autoload
 (defcustom tramp-adb-prompt
-  
"^\\(?:[[:digit:]]*|?\\)?\\(?:[[:alnum:]\e;address@hidden:alnum:]]*[^#\\$]*\\)?[#\\$][[:space:]]"
+  
"^\\(?:[[:digit:]]*|?\\)?\\(?:[[:alnum:]\e;address@hidden:alnum:]]*[^#\\$]*\\)?[#\\$][[:space:]]"
   "Regexp used as prompt in almquist shell."
   :type 'string
   :version "24.4"
@@ -72,6 +72,7 @@ It is used for TCP/IP devices."
 (defconst tramp-adb-ls-toolbox-regexp
   (concat
    "^[[:space:]]*\\([-[:alpha:]]+\\)"  ; \1 permissions
+   "\\(?:[[:space:]][[:digit:]]+\\)?"  ; links (Android 7/ToolBox)
    "[[:space:]]*\\([^[:space:]]+\\)"   ; \2 username
    "[[:space:]]+\\([^[:space:]]+\\)"   ; \3 group
    "[[:space:]]+\\([[:digit:]]+\\)"    ; \4 size
@@ -441,12 +442,15 @@ pass to the OPERATION."
   "Determine `ls' command at its arguments."
   (with-tramp-connection-property vec "ls"
     (tramp-message vec 5 "Finding a suitable `ls' command")
-    (if (tramp-adb-send-command-and-check vec "ls --color=never -al /dev/null")
-       ;; On CyanogenMod based system BusyBox is used and "ls" output
-       ;; coloring is enabled by default.  So we try to disable it
-       ;; when possible.
-       "ls --color=never"
-      "ls")))
+    (cond
+     ;; Can't disable coloring explicitly for toybox ls command
+     ((tramp-adb-send-command-and-check vec "toybox") "ls")
+     ;; On CyanogenMod based system BusyBox is used and "ls" output
+     ;; coloring is enabled by default.  So we try to disable it
+     ;; when possible.
+     ((tramp-adb-send-command-and-check vec "ls --color=never -al /dev/null")
+      "ls --color=never")
+     (t "ls"))))
 
 (defun tramp-adb--gnu-switches-to-ash (switches)
   "Almquist shell can't handle multiple arguments.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]