[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master bc08ffb 2/2: Add coreutils 'ls' support for tramp a
From: |
Michael Albinus |
Subject: |
[Emacs-diffs] master bc08ffb 2/2: Add coreutils 'ls' support for tramp adb |
Date: |
Tue, 27 Feb 2018 02:39:21 -0500 (EST) |
branch: master
commit bc08ffbd2c44668c1653780522d11fb58edf0bd2
Author: Mathieu Othacehe <address@hidden>
Commit: Michael Albinus <address@hidden>
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
---
lisp/net/tramp-adb.el | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index f5c45f6..cb80506 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -71,7 +71,7 @@ It is used for TCP/IP devices."
(defconst tramp-adb-ls-toolbox-regexp
(concat
- "^[[:space:]]*\\([-[:alpha:]]+\\)" ; \1 permissions
+ "^[[:space:]]*\\([-.[:alpha:]]+\\)" ; \1 permissions
"\\(?:[[:space:]]+[[:digit:]]+\\)?" ; links (Android 7/toybox)
"[[:space:]]*\\([^[:space:]]+\\)" ; \2 username
"[[:space:]]+\\([^[:space:]]+\\)" ; \3 group
@@ -462,9 +462,15 @@ pass to the OPERATION."
(with-tramp-connection-property vec "ls"
(tramp-message vec 5 "Finding a suitable `ls' command")
(cond
+ ;; Support Android derived systems where "ls" command is provided
+ ;; by GNU Coreutils. Force "ls" to print one column and set
+ ;; time-style to imitate other "ls" flavours.
+ ((tramp-adb-send-command-and-check
+ vec "ls --time-style=long-iso /dev/null")
+ "ls -1 --time-style=long-iso")
;; Can't disable coloring explicitly for toybox ls command. We
- ;; must force "ls" to print just one column.
- ((tramp-adb-send-command-and-check vec "toybox") "env COLUMNS=1 ls")
+ ;; also must force "ls" to print just one column.
+ ((tramp-adb-send-command-and-check vec "toybox") "ls -1")
;; On CyanogenMod based system BusyBox is used and "ls" output
;; coloring is enabled by default. So we try to disable it when
;; possible.