aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathieu Othacehe2018-02-26 16:43:46 +0100
committerMichael Albinus2018-02-27 08:31:18 +0100
commitbc08ffbd2c44668c1653780522d11fb58edf0bd2 (patch)
tree4bf661e63a792d3f9a075d76d3d25bc97a18a7a8
parenta566062722a194a7f528867b9a8211a3337d0aa7 (diff)
downloademacs-bc08ffbd2c44668c1653780522d11fb58edf0bd2.tar.gz
emacs-bc08ffbd2c44668c1653780522d11fb58edf0bd2.zip
Add coreutils 'ls' support for tramp adb
* lisp/net/tramp-adb.el (tramp-adb-ls-toolbox-regexp): Allow '.' character in file permissions. It indicates an SELinux security context. (tramp-adb-get-ls-command): Detect Coreutils version of 'ls'. Use 'ls -1' instead of passing COLUMNS=1 env variable. This is isofunctional. (Bug#30594) Copyright-paperwork-exempt: yes
-rw-r--r--lisp/net/tramp-adb.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index f5c45f68e94..cb805067864 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -71,7 +71,7 @@ It is used for TCP/IP devices."
71 71
72(defconst tramp-adb-ls-toolbox-regexp 72(defconst tramp-adb-ls-toolbox-regexp
73 (concat 73 (concat
74 "^[[:space:]]*\\([-[:alpha:]]+\\)" ; \1 permissions 74 "^[[:space:]]*\\([-.[:alpha:]]+\\)" ; \1 permissions
75 "\\(?:[[:space:]]+[[:digit:]]+\\)?" ; links (Android 7/toybox) 75 "\\(?:[[:space:]]+[[:digit:]]+\\)?" ; links (Android 7/toybox)
76 "[[:space:]]*\\([^[:space:]]+\\)" ; \2 username 76 "[[:space:]]*\\([^[:space:]]+\\)" ; \2 username
77 "[[:space:]]+\\([^[:space:]]+\\)" ; \3 group 77 "[[:space:]]+\\([^[:space:]]+\\)" ; \3 group
@@ -462,9 +462,15 @@ pass to the OPERATION."
462 (with-tramp-connection-property vec "ls" 462 (with-tramp-connection-property vec "ls"
463 (tramp-message vec 5 "Finding a suitable `ls' command") 463 (tramp-message vec 5 "Finding a suitable `ls' command")
464 (cond 464 (cond
465 ;; Support Android derived systems where "ls" command is provided
466 ;; by GNU Coreutils. Force "ls" to print one column and set
467 ;; time-style to imitate other "ls" flavours.
468 ((tramp-adb-send-command-and-check
469 vec "ls --time-style=long-iso /dev/null")
470 "ls -1 --time-style=long-iso")
465 ;; Can't disable coloring explicitly for toybox ls command. We 471 ;; Can't disable coloring explicitly for toybox ls command. We
466 ;; must force "ls" to print just one column. 472 ;; also must force "ls" to print just one column.
467 ((tramp-adb-send-command-and-check vec "toybox") "env COLUMNS=1 ls") 473 ((tramp-adb-send-command-and-check vec "toybox") "ls -1")
468 ;; On CyanogenMod based system BusyBox is used and "ls" output 474 ;; On CyanogenMod based system BusyBox is used and "ls" output
469 ;; coloring is enabled by default. So we try to disable it when 475 ;; coloring is enabled by default. So we try to disable it when
470 ;; possible. 476 ;; possible.