From unknown Mon Aug 18 17:53:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30594: [PATCH] Add coreutils 'ls' support for tramp adb Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Feb 2018 18:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 30594 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 30594@debbugs.gnu.org Cc: Mathieu Othacehe X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15194956318604 (code B ref -1); Sat, 24 Feb 2018 18:08:01 +0000 Received: (at submit) by debbugs.gnu.org; 24 Feb 2018 18:07:11 +0000 Received: from localhost ([127.0.0.1]:58953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epeE3-0002Eh-FM for submit@debbugs.gnu.org; Sat, 24 Feb 2018 13:07:11 -0500 Received: from eggs.gnu.org ([208.118.235.92]:54054) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epeE1-0002EU-1d for submit@debbugs.gnu.org; Sat, 24 Feb 2018 13:07:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1epeDu-00012j-Tn for submit@debbugs.gnu.org; Sat, 24 Feb 2018 13:07:03 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:37471) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1epeDu-00012I-QZ for submit@debbugs.gnu.org; Sat, 24 Feb 2018 13:07:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45016) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1epeDt-0004Ac-E5 for bug-gnu-emacs@gnu.org; Sat, 24 Feb 2018 13:07:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1epeDq-0000xW-9f for bug-gnu-emacs@gnu.org; Sat, 24 Feb 2018 13:07:01 -0500 Received: from mail-wr0-x233.google.com ([2a00:1450:400c:c0c::233]:37384) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1epeDq-0000wT-3H for bug-gnu-emacs@gnu.org; Sat, 24 Feb 2018 13:06:58 -0500 Received: by mail-wr0-x233.google.com with SMTP id z12so17175009wrg.4 for ; Sat, 24 Feb 2018 10:06:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Vl9nAJZHX/I2sWgVtjF5cpAKE8a/apr6o+dNI9klFAs=; b=H91b7OzTFr4vE/afuSbpfxpXLttWFoaiJxNr7NxS2KxejyeX7ehUJNDWCLHWwabESf B+GXoXLklCRB5wqgTonIh7M0XhKV1Km5vvGultUTGny6wriJJrOTvHI03K6rHTq6JY0n 7cK6/KAn5SfBkgiT3gAO1eNO5HiSDrwqfHE1miR0xlOoLOS8tDAB5c+OZqW64/sEdz8/ YN1W1leDqixcEsqcUg7ti1XQWfGpjlKVbi6BmkBLNsIP7QGcS0J4Ke7j5xXg52KxSleJ JqQ0/pirpvhw3cS70pGq5I0fxu4tk4zEiqRA5aBRDlpAl31el19piyigKFr7m0L3Svwl ciSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Vl9nAJZHX/I2sWgVtjF5cpAKE8a/apr6o+dNI9klFAs=; b=CFdrEkd1KXPw02SAz1L9rTiKh1c/3PVRmQfo5peGJc/b4QX8bUblnDLdoaZCdlb2x7 XtccuFjuAq9IuILQOs6NeZIR9JEzH7cp+V/jsPjuGBlrmnu1uR6H/hITWKT8epF9wBj8 dA0TCG04FN3u5w9Vj3boWrYJEO6iy2TPRp/QtkSmaE+kcb99LdmMfZmUfCGBC0532bo5 O6niXPBwYMwYxWAEoyBPGGGsdIvsaSIni5VcH27VP2LW6H+AFq7YT5UVlC/+MXyHEg3r dLh5jwOUkac2fNfAjjN4ACHeJj8dbSHxo7FSVdyhFA2Nwas4ejmZWtHnOevtF4QWBsJ1 ER2A== X-Gm-Message-State: APf1xPB4cT2DhKYGY96uTCIGoraMiM/C/I0pWt7vIwcCd2fJRP436U5I /eIY/quCmdwR0EGjbS/zo+AgLQ== X-Google-Smtp-Source: AH8x227p9XCgTND7ARfWu+KNtrFK7/+5Vs4WrRHnmhcpo09DAUDdwZ3H4jl1PsG9aEazhN+lUog34Q== X-Received: by 10.223.171.247 with SMTP id s110mr5046325wrc.106.1519495616431; Sat, 24 Feb 2018 10:06:56 -0800 (PST) Received: from localhost.localdomain ([78.192.96.126]) by smtp.gmail.com with ESMTPSA id 55sm27754wrz.6.2018.02.24.10.06.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Feb 2018 10:06:55 -0800 (PST) From: Mathieu Othacehe Date: Sat, 24 Feb 2018 19:06:40 +0100 Message-Id: <20180224180640.29490-1-m.othacehe@gmail.com> X-Mailer: git-send-email 2.16.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Support some Android derived systems where 'ls' binary is provided by GNU Coreutils. * 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'. Force output on one column and long-iso time style to match the behaviour of toybox and busybox 'ls' commands. --- 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 f5c45f68e9..be269aca51 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -71,7 +71,7 @@ tramp-adb-ls-date-regexp (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 @@ tramp-adb-get-ls-command (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 --help | grep coreutils") + "env COLUMNS=1 ls --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") + "env COLUMNS=1 ls") ;; On CyanogenMod based system BusyBox is used and "ls" output ;; coloring is enabled by default. So we try to disable it when ;; possible. -- 2.16.1 From unknown Mon Aug 18 17:53:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30594: [PATCH] Add coreutils 'ls' support for tramp adb Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Feb 2018 20:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30594 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Mathieu Othacehe Cc: 30594@debbugs.gnu.org Received: via spool by 30594-submit@debbugs.gnu.org id=B30594.151950582223517 (code B ref 30594); Sat, 24 Feb 2018 20:58:02 +0000 Received: (at 30594) by debbugs.gnu.org; 24 Feb 2018 20:57:02 +0000 Received: from localhost ([127.0.0.1]:59070 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epgsP-00067A-Sa for submit@debbugs.gnu.org; Sat, 24 Feb 2018 15:57:02 -0500 Received: from mout.gmx.net ([212.227.15.19]:57107) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epgsN-00066w-DU for 30594@debbugs.gnu.org; Sat, 24 Feb 2018 15:56:59 -0500 Received: from detlef.gmx.de ([79.140.122.208]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MHoC5-1esj973vcD-003d0F; Sat, 24 Feb 2018 21:56:53 +0100 From: Michael Albinus References: <20180224180640.29490-1-m.othacehe@gmail.com> Date: Sat, 24 Feb 2018 21:56:51 +0100 In-Reply-To: <20180224180640.29490-1-m.othacehe@gmail.com> (Mathieu Othacehe's message of "Sat, 24 Feb 2018 19:06:40 +0100") Message-ID: <87371qqf70.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:N1bB//yJcKUvmsnCDPX1QYDl3/USWPmC6kN80NMzlnmI+5wgnyX YTdcCTGGPe48goRYL8rgelzRfVd0Y7iv9Z1csaYCe0/I90cEgjTXhTMAzLu/cv76otgKM4m AFIZ+y12K47f5AP9d+jNHYpzdmOclXXq8O6IPLN+4e8PtHwSolvLfiTwdNDboPrDLTBnZK3 LgWViwJ0dTtdXiI3j1nWA== X-UI-Out-Filterresults: notjunk:1;V01:K0:O4srdmaK+9I=:taITthamSf85qKtSC/BiDO kmk/hXUC/xGEfvIQXhL4uWUxlszIT56qDKynijYY0GSkFDMxycCdOZgVmEtCHW/cPchzmih5o k3EYDp4r6lBx+F/Ef+6BQO2dlFIX6BXygxjz8fPJ3U/UmKhWoK9GGHgMwEhebibkmK8Tvdy3T E9RWaWlef+RyZ3cH66vFD4uNQ6/HeNSScVG8ZK9q577cd5C/ksXFBYIzZnP9OuujY0sifcBaJ sL1ljr3In8sCaoaHxiqE3mpkjMoM6uRxTSA865lYUEiMK+VTSdQayevkuQYLu4dEO2Qfkgf8W DKOQQrlAE8dnrUSuaCm192GRAOCEF7wrntYv0HxnQjThomyz5lPEJZ8V+pdlgqcoA508iJ7VU mMr5qdajYdz8YMEuVqFQG+r5hsvbS3PJvySSlDmXN6/PPWIu/8v9nz7rCN4oHbeo3zntS7Tqg 3v31gE3ZzCazLtBC7fL8+U2MkemnzSAtD7aez8WqNJG7PDY6pl63rGXCHYKkA9XXMoLlmA5XZ 0BrmSeI7dn2aIir6GqwP8eXYeq/Jlx8ehXeAJIiM3vFy/xagdY4t63gxFZMUFcJstcrYDCPXm dsJdjr+g5UXjlcQ3iIFfs+hGalX9EdMxPWaBhmK5WjooRDo4buazsod0CQKaxws8QfR5f2RV1 JWhhlNlX0cDcZ5mo0skzUGnWbhvMWXLRHhv2MXg3M3wJL483sPhOJVwPHelB9+NphiZYPCo1W RupStDLFGxftqfbBKqOC8zcTvw4a1Sci2VJnvszXrw+UoAagK4gJoIXn2ysILmwhk0dkCmQf/ kxaj5onHxJmXaBtO4v+Do+bd3hqUCBDKohROIrLeUaB1PX8+U4= X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Mathieu Othacehe writes: Hi Mathieu, > Support some Android derived systems where 'ls' binary is provided by > GNU Coreutils. Thanks for this! I cannot test myself, so I'll trust that it works proper. However, > + ;; 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 --help | grep coreutils") > + "env COLUMNS=1 ls --time-style=long-iso") I believe it is not future-safe to depend on any string in --help output. The better approach is to test, whether the ls command accepts the --time-style=long-iso argument. Something like ((tramp-adb-send-command-and-check vec "ls --time-style=long-iso /dev/null") Could you pls check, whether it works like this? Best regards, Michael. From unknown Mon Aug 18 17:53:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30594: [PATCH] Add coreutils 'ls' support for tramp adb Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 24 Feb 2018 21:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30594 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Mathieu Othacehe Cc: 30594@debbugs.gnu.org Received: via spool by 30594-submit@debbugs.gnu.org id=B30594.151950627324223 (code B ref 30594); Sat, 24 Feb 2018 21:05:02 +0000 Received: (at 30594) by debbugs.gnu.org; 24 Feb 2018 21:04:33 +0000 Received: from localhost ([127.0.0.1]:59074 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epgzg-0006Id-Pl for submit@debbugs.gnu.org; Sat, 24 Feb 2018 16:04:32 -0500 Received: from mout.gmx.net ([212.227.15.18]:54441) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epgzd-0006IM-QZ for 30594@debbugs.gnu.org; Sat, 24 Feb 2018 16:04:31 -0500 Received: from detlef.gmx.de ([79.140.122.208]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Lu874-1eiNDl2o4s-011SeI; Sat, 24 Feb 2018 22:04:23 +0100 From: Michael Albinus References: <20180224180640.29490-1-m.othacehe@gmail.com> <87371qqf70.fsf@gmx.de> Date: Sat, 24 Feb 2018 22:04:23 +0100 In-Reply-To: <87371qqf70.fsf@gmx.de> (Michael Albinus's message of "Sat, 24 Feb 2018 21:56:51 +0100") Message-ID: <87woz2p0a0.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:oauRkPgjaAutAkFTSe4DQ01RDf0j9JNR3K19DifxrG92pcXmp5K luBIb5YqGSAxmdyBsFoHwn8RFJWKYr4PK8fQKfmfZ0knZ8dRL9jd7qXuHO9Xb9q6Tc6lcGp tBPE1ndFKIcr8yK10SSrnpaVWlFVd9EpMaLSF3i+BVMriG1GxFPovrPFpI5j5BtEljUzgP2 0KpveGyUJIvP/k8GBD4ng== X-UI-Out-Filterresults: notjunk:1;V01:K0:gnjIv5ewpkY=:VAk+eyGWJzlAEJ584xk8kg BQM9eu0fr2Wz9Zmtes3vJSxF2uRhlUVoh0KyMooEdSPh/xaRKONeYxVth7mlxYTG1c1/lxy2/ YviqRE9L5W+zfnjBqxZXX/7PvBWvo4Xqai10xj+d7mZndksO9PpuOIrFzd+l7Mu9oJa6thiWJ MWMSIRfAQt2qoUQRCMdoUX3YUJ1Tasn0Ze9K8myzbvKZ6kHbMP4oOaJ85GHjnv7dUf2vuBwWn FMaN703ovm91Njp1FcXzPf1soLmfFMlzEFThEj3yRf/W/ejYC8o8IyGm7U1sX7hQiqKa+xHH9 H2dp4DcDDIaQRDwicSiOs2w6TkIT0/7HAuaGrSODinCDFpCYWDasvlZecGQRRun+WRtUEbXY4 +BYrn/l9RCUJT/ZzV28DDVwmxViWxkcneOWHpMwUNy4+EZyIIb8pT6iHzy9HFdY1dEl4rFeEx OwVcGzxRQdPsVAIAQ9lWry9yKwjrpATlHCTZmXDuP7i2aJSKtAWi2ttrNBmgvBfz4fvRxV90w lHCVFMn8uQaPpyuDqbJHuB1Y7ZlE4Cf0GNZMSalvsBnwIrW7k8kEt69SA+/YI3RGUFQTdNgMB 39olJ9IeaiKLsyceB2+V6s7YzxtuyGHiY1mHEO3vfyzjB7QMDqW+owA6jdhftEKohIP8PDjyM 41FpHcS2iZG7Zn7AY5TImknkn3Jc2h+/Yg2rssITJvqbxE0LRIXENdmEhMt4yEZnm/zS16kru 28j1ttLton99eLaHgvN9cdQEwWrAXgjVorOVOx36V+ISuFZHsUJ8Ow6cjx0kVaKxtvdpxRA61 vybODRbeXHu3FXvnRPQHSHjvLYbcwvDFYFhXt63VEQLQuPHVX8= X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Michael Albinus writes: Hi Mathieu, > Could you pls check, whether it works like this? Ahh, and btw: "." is not special in "[]" in regexps. So you might do + "^[[:space:]]*\\([-.[:alpha:]]+\\)" ; \1 permissions Best regards, Michael. From unknown Mon Aug 18 17:53:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30594: [PATCH] Add coreutils 'ls' support for tramp adb Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Feb 2018 09:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30594 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Michael Albinus Cc: 30594@debbugs.gnu.org Received: via spool by 30594-submit@debbugs.gnu.org id=B30594.15195517472894 (code B ref 30594); Sun, 25 Feb 2018 09:43:02 +0000 Received: (at 30594) by debbugs.gnu.org; 25 Feb 2018 09:42:27 +0000 Received: from localhost ([127.0.0.1]:59402 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epsp9-0000kb-7r for submit@debbugs.gnu.org; Sun, 25 Feb 2018 04:42:27 -0500 Received: from mail-wr0-f171.google.com ([209.85.128.171]:33201) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epsp7-0000kN-Nj for 30594@debbugs.gnu.org; Sun, 25 Feb 2018 04:42:26 -0500 Received: by mail-wr0-f171.google.com with SMTP id s5so18203750wra.0 for <30594@debbugs.gnu.org>; Sun, 25 Feb 2018 01:42:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=4q6w3zDp7Vn+GdaBT/UYb3LMngbnhz0lzuCIK35osz8=; b=IsijGUhCfcM55XRYAxVED16QoHa+7vbsOOJpXz3hx4Rh8u6LHKIDuSsODl0h+Nsxv4 +Razj+qYmlgXJiOo6FoSAI9aWt2v/w+ACvkbiXXOQm7W0WFntdEvB8EAoHniqpW6o7yo FovQMxQ4cYfQM3RMb+Nh3mFYVS6Iv2S9J0111iqty/uF3PYB8cKNA9oRAQxcKGYF0ncS E2hlG7cnzuRWwt65hWvFkA3eToSLB7GwBIL1M1SbEIR5ygo8wlMMSMYdCoTbQUgRbGH+ zX/piAczzxZQlP4dgvdv7PV3vFFMiTg43kMAfocVqSY2x5ax7ZkhFlcfQ3xk49anspQS hxYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=4q6w3zDp7Vn+GdaBT/UYb3LMngbnhz0lzuCIK35osz8=; b=hcU6uWn/AXyms7vrQTKFdH9DgHa6YxPi7Z6BtJU7qKXYYo4iu90s8LQn/xH+PENljv VdMgMgN9lPVR465uT/rv1cs3chF8R+fT8xBV9ZTJ+RxyJlnS9WOi8eZ/E8vuBUo5NtMq XJ72L6hBC54No/9dNDfmnyLFyJsQVHO72EKt0rLqde+HFFmH/9hCZChR2IAJVs7b1oBF aqQIc/Njay/x1L8SEfA8Kzuzwg2yjHnKtJorrAYpuCCARiqaKcFVVBfyt0eU//QVd1VY TI698+MbPmpeckIUzAIxjCc2sCts0Qge3PYSflLcLon3KNAsgPU49crj0WJ7iJ4+lRuc Q0QQ== X-Gm-Message-State: APf1xPDwosF9dNAEZv380RA7E4QSyVo2CmXkeeO/JU2tdQ3fEGrCF8eq 9fC3KMghnPTn0yr4hCVroQjl2Q== X-Google-Smtp-Source: AH8x227uBgzStzfb0BKbLhLqr7wbizJixhpDNGQuGhhi84ShjggEleoePKANqP7kgyr6dUBZl6oJuQ== X-Received: by 10.223.128.67 with SMTP id 61mr6805080wrk.61.1519551739637; Sun, 25 Feb 2018 01:42:19 -0800 (PST) Received: from cervin ([78.192.96.126]) by smtp.gmail.com with ESMTPSA id 4sm4366209wmz.31.2018.02.25.01.42.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 25 Feb 2018 01:42:18 -0800 (PST) References: <20180224180640.29490-1-m.othacehe@gmail.com> <87371qqf70.fsf@gmx.de> <87woz2p0a0.fsf@gmx.de> User-agent: mu4e 0.9.18; emacs 25.3.1 From: Mathieu Othacehe In-reply-to: <87woz2p0a0.fsf@gmx.de> Date: Sun, 25 Feb 2018 10:42:18 +0100 Message-ID: <87h8q5pfr9.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) --=-=-= Content-Type: text/plain Hi Michael, > Ahh, and btw: "." is not special in "[]" in regexps. So you might do > > + "^[[:space:]]*\\([-.[:alpha:]]+\\)" ; \1 permissions Thanks for reviewing! I fixed your remarks, it still works fine. You'll find v2 attached. Mathieu --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Add-coreutils-ls-support-for-tramp-adb.patch >From 553412dad14be2f8c12a61c7d96cbd2ce7e7693e Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Sat, 24 Feb 2018 18:56:54 +0100 Subject: [PATCH v2] Add coreutils 'ls' support for tramp adb Support some Android derived systems where 'ls' binary is provided by GNU Coreutils. * 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'. Force output on one column and long-iso time style to match the behaviour of toybox and busybox 'ls' commands. --- 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 f5c45f68e9..443d45d831 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -71,7 +71,7 @@ tramp-adb-ls-date-regexp (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 @@ tramp-adb-get-ls-command (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") + "env COLUMNS=1 ls --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") + "env COLUMNS=1 ls") ;; On CyanogenMod based system BusyBox is used and "ls" output ;; coloring is enabled by default. So we try to disable it when ;; possible. -- 2.16.1 --=-=-=-- From unknown Mon Aug 18 17:53:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30594: [PATCH] Add coreutils 'ls' support for tramp adb Resent-From: Andreas Schwab Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Feb 2018 10:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30594 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Mathieu Othacehe Cc: 30594@debbugs.gnu.org, Michael Albinus Received: via spool by 30594-submit@debbugs.gnu.org id=B30594.15195536285481 (code B ref 30594); Sun, 25 Feb 2018 10:14:01 +0000 Received: (at 30594) by debbugs.gnu.org; 25 Feb 2018 10:13:48 +0000 Received: from localhost ([127.0.0.1]:59408 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eptJT-0001QK-Qa for submit@debbugs.gnu.org; Sun, 25 Feb 2018 05:13:47 -0500 Received: from mail-out.m-online.net ([212.18.0.9]:45732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eptJQ-0001Q9-1b for 30594@debbugs.gnu.org; Sun, 25 Feb 2018 05:13:44 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3zq1525Bccz1qsSr; Sun, 25 Feb 2018 11:13:42 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 3zq1524TLHz1r40G; Sun, 25 Feb 2018 11:13:42 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id pUe2ZDvoeQ4i; Sun, 25 Feb 2018 11:13:42 +0100 (CET) X-Auth-Info: GRxCiXPwAhhIv/WGALH1BLYe/Wl2VsXk6uKFU6rESwzuA4hGRwsGGABsW8vf55td Received: from linux.local (ppp-188-174-150-66.dynamic.mnet-online.de [188.174.150.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Sun, 25 Feb 2018 11:13:41 +0100 (CET) Received: by linux.local (Postfix, from userid 501) id A8EA71E585E; Sun, 25 Feb 2018 11:13:37 +0100 (CET) From: Andreas Schwab References: <20180224180640.29490-1-m.othacehe@gmail.com> <87371qqf70.fsf@gmx.de> <87woz2p0a0.fsf@gmx.de> <87h8q5pfr9.fsf@gmail.com> X-Yow: I'm not an Iranian!! I voted for Dianne Feinstein!! Date: Sun, 25 Feb 2018 11:13:37 +0100 In-Reply-To: <87h8q5pfr9.fsf@gmail.com> (Mathieu Othacehe's message of "Sun, 25 Feb 2018 10:42:18 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) On Feb 25 2018, Mathieu Othacehe wrote: > @@ -462,9 +462,15 @@ tramp-adb-get-ls-command > (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 Thats `ls -1'. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From unknown Mon Aug 18 17:53:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30594: [PATCH] Add coreutils 'ls' support for tramp adb Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Feb 2018 10:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30594 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Andreas Schwab Cc: 30594@debbugs.gnu.org, Michael Albinus Received: via spool by 30594-submit@debbugs.gnu.org id=B30594.15195556948420 (code B ref 30594); Sun, 25 Feb 2018 10:49:01 +0000 Received: (at 30594) by debbugs.gnu.org; 25 Feb 2018 10:48:14 +0000 Received: from localhost ([127.0.0.1]:59415 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eptqo-0002Bk-HW for submit@debbugs.gnu.org; Sun, 25 Feb 2018 05:48:14 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:54984) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eptql-0002BW-Un for 30594@debbugs.gnu.org; Sun, 25 Feb 2018 05:48:12 -0500 Received: by mail-wm0-f49.google.com with SMTP id z81so12271582wmb.4 for <30594@debbugs.gnu.org>; Sun, 25 Feb 2018 02:48:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=QnxFzRCO4AVPp4AGplmVQdOfuKSAVGP1/TSCHsce/vE=; b=Uo/ONlI0Cpitlt3Jd9JNFoGA3yiIvL/xUbOwpsj66Yyk0VOFVls0Yi9c+HgfVBvzD+ A5SHrRXtKW/PnW3A8afPNCF7chfZaDXd282kMgb5D+VdEzxuzjTF0SFD5Re146taylRL 714pNttv99w07Lcs2bwOKezVaxuTdNTZR4e3YANE6GkQVN6ERpBMz61sor9N22W8ESP8 pA7kLAp2VIQ85qDYbsZxxxlSMrUC83qUPy9cwoRuapUG9kD00/U5IlJjGtOiTU6xjyic 1CepzppMemKbC24OApzsjBxkEIHWyKZcd0OXYXljU+oYZaTeoOJCudu9RJCL4eLYllMD btMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=QnxFzRCO4AVPp4AGplmVQdOfuKSAVGP1/TSCHsce/vE=; b=bjItIeVst8tbSIzzYPjurZ1Ng7V6rMN+Pt1W65E90UPZ5zkusNIOEFNnnuL1mXOCzn b1BH1Vw5bizdAu2vHU8onvaGMiWMwFvvwMXwTzV/d0l1BArdud/fbeiHNanZYQqlI6Je Z92QqyCWIjvSGe/VZo+3yEgSaYOy8Z7kBnf8KyZKw5R67diDcRZ68hUKddaLvU/CWFTT wNX1XszAsV0SpUIFkYqtgcijKFrI9994bOcFION7mIw3o9W1yDE1JOOeg6rTb9aT0W+h H3PS/2hq5s7vELCVjtxGUYw4w+qjB8h3nUmLUOJMyiJ0iQTeuGmi56eQTNG3foYZHsH2 kTIA== X-Gm-Message-State: APf1xPD6teh4xNkb05oIVCCUbhPeStfve3spX9CNz5njFgDZKSr7Hpcd Zg76jDCS04Z1L7gLz5zT4ubiYA== X-Google-Smtp-Source: AH8x227J9gCs794LtPnEUgwr7VG/daHS866FN8utnXSCLRJkOWST8/gns3N7MQ32+noGsveHlMkD/g== X-Received: by 10.28.191.193 with SMTP id o62mr5692109wmi.113.1519555685667; Sun, 25 Feb 2018 02:48:05 -0800 (PST) Received: from cervin ([78.192.96.126]) by smtp.gmail.com with ESMTPSA id e15sm6014382wmd.26.2018.02.25.02.48.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 25 Feb 2018 02:48:04 -0800 (PST) References: <20180224180640.29490-1-m.othacehe@gmail.com> <87371qqf70.fsf@gmx.de> <87woz2p0a0.fsf@gmx.de> <87h8q5pfr9.fsf@gmail.com> User-agent: mu4e 0.9.18; emacs 25.3.1 From: Mathieu Othacehe In-reply-to: Date: Sun, 25 Feb 2018 11:48:04 +0100 Message-ID: <87fu5ppcpn.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain Hi Andreas, > Thats `ls -1'. You're right, I updated my patch. As toybox 'ls' seems to also support this option, here's an other patch to use 'ls -1' for toybox too. Thanks, Mathieu --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Add-coreutils-ls-support-for-tramp-adb.patch >From 20a0de9436cdac80ac22c1b1efbbaf9654d5bf7f Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Sat, 24 Feb 2018 18:12:36 +0100 Subject: [PATCH] Add coreutils 'ls' support for tramp adb Support some Android derived systems where 'ls' binary is provided by GNU Coreutils. * 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'. Force output on one column and long-iso time style to match the behaviour of toybox and busybox 'ls' commands. --- 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 f5c45f68e9..5489dbe5a5 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -71,7 +71,7 @@ tramp-adb-ls-date-regexp (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 @@ tramp-adb-get-ls-command (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 --help | grep coreutils") + "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") + "env COLUMNS=1 ls") ;; On CyanogenMod based system BusyBox is used and "ls" output ;; coloring is enabled by default. So we try to disable it when ;; possible. -- 2.16.1 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Use-ls-1-to-list-files-with-toybox-ls.patch >From c41d53965288843285faf1cf9344d6b751eaf1fc Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Sun, 25 Feb 2018 11:32:30 +0100 Subject: [PATCH] Use 'ls -1' to list files with toybox ls * lisp/net/tramp-adb.el (tramp-adb-get-ls-command): Use 'ls -1' instead of passing COLUMNS=1 env variable. This is isofunctional. --- lisp/net/tramp-adb.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 5489dbe5a5..6fe38fb2e5 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -470,7 +470,7 @@ tramp-adb-get-ls-command ;; Can't disable coloring explicitly for toybox ls command. We ;; also must force "ls" to print just one column. ((tramp-adb-send-command-and-check vec "toybox") - "env COLUMNS=1 ls") + "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. -- 2.16.1 --=-=-=-- From unknown Mon Aug 18 17:53:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30594: [PATCH] Add coreutils 'ls' support for tramp adb Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Feb 2018 10:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30594 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Mathieu Othacehe Cc: 30594@debbugs.gnu.org, Andreas Schwab Received: via spool by 30594-submit@debbugs.gnu.org id=B30594.15195562859241 (code B ref 30594); Sun, 25 Feb 2018 10:59:02 +0000 Received: (at 30594) by debbugs.gnu.org; 25 Feb 2018 10:58:05 +0000 Received: from localhost ([127.0.0.1]:59419 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epu0L-0002Oz-JL for submit@debbugs.gnu.org; Sun, 25 Feb 2018 05:58:05 -0500 Received: from mout.gmx.net ([212.227.17.20]:47995) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epu0I-0002OT-PO for 30594@debbugs.gnu.org; Sun, 25 Feb 2018 05:58:04 -0500 Received: from detlef.gmx.de ([213.220.149.21]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MPHrQ-1elU9L0oHg-004Ovm; Sun, 25 Feb 2018 11:57:55 +0100 From: Michael Albinus References: <20180224180640.29490-1-m.othacehe@gmail.com> <87371qqf70.fsf@gmx.de> <87woz2p0a0.fsf@gmx.de> <87h8q5pfr9.fsf@gmail.com> <87fu5ppcpn.fsf@gmail.com> Date: Sun, 25 Feb 2018 11:57:54 +0100 In-Reply-To: <87fu5ppcpn.fsf@gmail.com> (Mathieu Othacehe's message of "Sun, 25 Feb 2018 11:48:04 +0100") Message-ID: <87sh9ppc99.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:JAPvizgeOSltcEe8PmkmwxEfvlMPrdQw71BTWladoi5vKhjjr3j XgwZPYN4JTu+uwS4sxeDrk+r8Uch8E79b7QT9G/MJODcMb0impRYmSdbLxI3+UQdlAduSL3 lALl5sThDITDswMU9LwSyVqihDQ8vtpBs/iil8BnxSjNk1hgdOMc20YM8cdXgS1Opv1Z+Wk IQL6SLiHvp9LwPkPCpbwQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:2Adj/RlQACs=:q1emCSuZQ/Iz9hrHW+04rT WCLBSJX2mj1FokbKwHz8141C3mNUdi0947VJ2CKlqyfg3TpIONddbKV4eznZOnzucsP0JY764 wgy01Mkr2q7Q9Uhzvec6YK6AKozPi+Ne3amEVfo0GCmvB5cqPpgYeS/oM/QP2oyy9Ds6UWaXA PY0K5fqO//uSa/DE6JwlgnV36w2HqpVg9XOJpORrYwFKQiMHzcz5wv2DlsUc0AxaxdJhMbYdF v4sW7ZjJX/9akO7ka1VR3L4e3kB6zQJ3fPw9YO2xinPsWXqClw35HaeP5q53RcP3mdypivX9U Jfd93YR3pB4lPRf2YYf5biSTlbiGaG/UwLPY8rmEPWp1fOjsw5iIi/jImVRCe8iQJs0DijSyy XAGh7FQzOsW/gAY0z1jAOxsm+MV3PUiPU9M9Wuz1jVJDwzN4zkZt3X2/sdJ/NmfSR+iy+z1vA RMlKsNWLV7S86JclxoE1TImzmkCQYXtolf6HP4ZUDHa6n++EDrklBIu0N5TQWpXdN4N4ku/fF s61lwlB2CwwxQXVsw/CFvZJBWIY77cjvKLRG53JZzndbqwS8aTNtoKaKiMNO75PWheSuJpXgh 0HpM4GKX3EQjEh64bLgho/0kMZ4dSQkp0wZ+jylSbfN8/Aok1PSWkkkwBNCbQUiRVNJSLgtS0 sHrxLkKDjVNaWuGLhc/8uQZy4xWErbVRdKXTnr/O3irrT+NMkjHDo0thGVDOB7wHeCPmBbSGB wMlThNAKAhEkR9Htpy1cCk2qfN4R9M9xkrAe1ZzpQb5aomNTecDYkOyo4JV9x/9lx4eYw95rM ZaVqZUwHipu2hw7Dtu9NUGq9tZBrLUGR/D8eoK8Lz48YZ6K+/0= X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Mathieu Othacehe writes: > Hi Andreas, Hi Mathieu, > You're right, I updated my patch. As toybox 'ls' seems to also support > this option, here's an other patch to use 'ls -1' for toybox too. > + ((tramp-adb-send-command-and-check vec "ls --help | grep coreutils") This is not what we have agreed. Could you, pls, rework? > Thanks, > > Mathieu Best regards, Michael From unknown Mon Aug 18 17:53:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30594: [PATCH] Add coreutils 'ls' support for tramp adb Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Feb 2018 11:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30594 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Michael Albinus Cc: 30594@debbugs.gnu.org, Andreas Schwab Received: via spool by 30594-submit@debbugs.gnu.org id=B30594.151955754111142 (code B ref 30594); Sun, 25 Feb 2018 11:19:01 +0000 Received: (at 30594) by debbugs.gnu.org; 25 Feb 2018 11:19:01 +0000 Received: from localhost ([127.0.0.1]:59447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epuKa-0002tb-ON for submit@debbugs.gnu.org; Sun, 25 Feb 2018 06:19:01 -0500 Received: from mail-wr0-f170.google.com ([209.85.128.170]:34696) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epuKZ-0002tO-N0 for 30594@debbugs.gnu.org; Sun, 25 Feb 2018 06:19:00 -0500 Received: by mail-wr0-f170.google.com with SMTP id m5so18330255wrg.1 for <30594@debbugs.gnu.org>; Sun, 25 Feb 2018 03:18:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=rf882r2kYC6eorqiTpykJUiZ9PTEswOd9HTL6a+759I=; b=u7sfUrRRUgZwREA46oCpOHNAPyeznJ+/ADukKG2efLZfc8h8Va/MqJCBRAnApioTAw bQ45Q1LZP+x5OFKD5mP3c+RceEybjhZq0BmQEpWnlERJxCYpM0UGrNvVfSmTQGdChMYw rYsanhkAx/UKoWrfpXdtuOSCZGp5t4DXucUfDxuCgI0YZ7RnsnlYiu6Bokse3RmCJM/B LUP0MTdkVcUFYDNRpZmzfhBc6g58fObuBAKxiXDBevT21mGM2mzUgPVP+szVyW9KKYNd oHGR/fMfzgXxv0W7vyI8XGxE4Jg5z+khpNVAQ8CizOw8ijNNW8KxP4bUnCYf3ZMMPGlY Emmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=rf882r2kYC6eorqiTpykJUiZ9PTEswOd9HTL6a+759I=; b=OLy/TbYDcwhaYun5LC8F13mVVRaK86TgpUUMKJnWxj3T/nPTzj72m94eLdHv9KgiPQ r2m6amaoguNUGhYg58OlQCTxBWKxA55IjYU9kQZQKOvDdakh1xGIHGf3Xux+gv3d5+J0 mo0/LJgXR81PHvj3N196vuEuvyZyRirrOux318cZp7hL7XinlJyMY1obp7+W7e6+Jx5j Bk+o/s6ZcBR3dRw6UQZbpMw30YUhNwhpaWmY9N9ud57lfPUJCCcyY7QD/EoYJ8QgbiRQ 6e2ZMz6tlKVZVzjenrfwEJ0/aTlmwFfqMYAp4bKYBoiucIsuU5CHLA87wn4Mt8VOln9c iAlA== X-Gm-Message-State: APf1xPC7jL8uETdXzTYGcdK5FE/l3kCSqlw4LOoDPkVGO8/o0XAo4ths qNkdWumUu5OvwLAaGU34aJZ2CQ== X-Google-Smtp-Source: AH8x226HedS9lys4pjoOeKR4Rim9i7g0Y474uXXCLnopeO6/YhUOafuDDwAzmh+s2/aaai0+svoWtQ== X-Received: by 10.223.157.205 with SMTP id q13mr6407269wre.266.1519557533819; Sun, 25 Feb 2018 03:18:53 -0800 (PST) Received: from cervin ([78.192.96.126]) by smtp.gmail.com with ESMTPSA id k2sm15641303wrc.30.2018.02.25.03.18.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 25 Feb 2018 03:18:52 -0800 (PST) References: <20180224180640.29490-1-m.othacehe@gmail.com> <87371qqf70.fsf@gmx.de> <87woz2p0a0.fsf@gmx.de> <87h8q5pfr9.fsf@gmail.com> <87fu5ppcpn.fsf@gmail.com> <87sh9ppc99.fsf@gmx.de> User-agent: mu4e 0.9.18; emacs 25.3.1 From: Mathieu Othacehe In-reply-to: <87sh9ppc99.fsf@gmx.de> Date: Sun, 25 Feb 2018 12:18:52 +0100 Message-ID: <87efl9pbab.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) --=-=-= Content-Type: text/plain > This is not what we have agreed. Could you, pls, rework? Oops wrong rebase, sorry about that. Here's an update version. Mathieu --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Add-coreutils-ls-support-for-tramp-adb.patch >From c904d5da9d65b95a6176c86bb6ba143b29e90f1d Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Sat, 24 Feb 2018 18:12:36 +0100 Subject: [PATCH] Add coreutils 'ls' support for tramp adb Support some Android derived systems where 'ls' binary is provided by GNU Coreutils. * 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'. Force output on one column and long-iso time style to match the behaviour of toybox and busybox 'ls' commands. --- 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 f5c45f68e9..6257f84d6f 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -71,7 +71,7 @@ tramp-adb-ls-date-regexp (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 @@ tramp-adb-get-ls-command (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") + "env COLUMNS=1 ls") ;; On CyanogenMod based system BusyBox is used and "ls" output ;; coloring is enabled by default. So we try to disable it when ;; possible. -- 2.16.1 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Use-ls-1-to-list-files-with-toybox-ls.patch >From 6d216933f307bdb946d569510853003fafea3c45 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Sun, 25 Feb 2018 11:32:30 +0100 Subject: [PATCH] Use 'ls -1' to list files with toybox ls * lisp/net/tramp-adb.el (tramp-adb-get-ls-command): Use 'ls -1' instead of passing COLUMNS=1 env variable. This is isofunctional. --- lisp/net/tramp-adb.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 6257f84d6f..3f4de93bc5 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -470,7 +470,7 @@ tramp-adb-get-ls-command ;; Can't disable coloring explicitly for toybox ls command. We ;; also must force "ls" to print just one column. ((tramp-adb-send-command-and-check vec "toybox") - "env COLUMNS=1 ls") + "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. -- 2.16.1 --=-=-=-- From unknown Mon Aug 18 17:53:45 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Mathieu Othacehe Subject: bug#30594: closed (Re: bug#30594: [PATCH] Add coreutils 'ls' support for tramp adb) Message-ID: References: <87muzv929z.fsf@gmx.de> <20180224180640.29490-1-m.othacehe@gmail.com> X-Gnu-PR-Message: they-closed 30594 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 30594@debbugs.gnu.org Date: Mon, 26 Feb 2018 15:53:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1519660382-15317-1" This is a multi-part message in MIME format... ------------=_1519660382-15317-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #30594: [PATCH] Add coreutils 'ls' support for tramp adb which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 30594@debbugs.gnu.org. --=20 30594: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D30594 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1519660382-15317-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 30594-done) by debbugs.gnu.org; 26 Feb 2018 15:52:34 +0000 Received: from localhost ([127.0.0.1]:33662 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqL4r-0003yL-S8 for submit@debbugs.gnu.org; Mon, 26 Feb 2018 10:52:33 -0500 Received: from mout.gmx.net ([212.227.15.18]:44395) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqL4q-0003y9-Dd for 30594-done@debbugs.gnu.org; Mon, 26 Feb 2018 10:52:32 -0500 Received: from detlef.gmx.de ([79.140.124.243]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MNYxW-1eohRS3n5u-007Bj7; Mon, 26 Feb 2018 16:52:25 +0100 From: Michael Albinus To: Mathieu Othacehe Subject: Re: bug#30594: [PATCH] Add coreutils 'ls' support for tramp adb References: <20180224180640.29490-1-m.othacehe@gmail.com> <87371qqf70.fsf@gmx.de> <87woz2p0a0.fsf@gmx.de> <87h8q5pfr9.fsf@gmail.com> <87fu5ppcpn.fsf@gmail.com> <87sh9ppc99.fsf@gmx.de> <87efl9pbab.fsf@gmail.com> Date: Mon, 26 Feb 2018 16:52:24 +0100 In-Reply-To: <87efl9pbab.fsf@gmail.com> (Mathieu Othacehe's message of "Sun, 25 Feb 2018 12:18:52 +0100") Message-ID: <87muzv929z.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:JPryqBkWE3U7+Mpaf1skJ2LVwa1dsdtzkEzjQcfz/CWr0cizbio Qdm0D3WBu1xGT1dqlRUGS/b63u29WjSNtk5mBKL7GXDM+unbAiwdyXCj5sK3AqyopZbTEkW kSnpDdY4TDgRiWgpWMnKzDf3bjZXOlkU5RxBWZLfAA6NwG8mMAJwkcv5c0Db0vzYnP9tVUn SIrHOmwg38g8rBTdofFYQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:OScRiPwsvW8=:IB3Rr6ZSKLW3bWprvK2tMu +V8twrh89h3nlFfDvTbUIfvp0s/KVB7C8lWvE3Jb6jyh4PJEbZTSSAXyi0hAW0nJ/tZn6SKDX EJamBwIyI5lFvikqZ8Q8sza8rWRO/4tXfk7UhIK6OCTv5GmA8o+VqmP6inpJUmNoJD4gJhwM2 GCGJGgZp+LKYQtduQMD6m26j3lxS3oJd1y5W9l//WrZIPkVryVRIrp/etVpv3AWjBOeZMmsLz kp6+fHo2Rur5utB+fBxHb/NbaEBogPPh8OVUXFs5HPNtksKa606sqi+YJ1yZuPQYyd8tuaDpy jtOnc+w0gTiMd1SvVhPwXREDtYVkNgVidi9fmLrw7+WQKNdYVCE0rOq+Ik6Rif5cAlCNARr8R 1a4MRmN4ookIZgMTOGH0TF0scqdK3aLodrbTeBQjYWLbSfjaFYhGbOYAwPy0VMtYfro6CdpZc xuvE9YDNrRO0afetkAsc1ba4WmUdc5LfkR/UpK0G0H0r2MzOGeR2QtdIkzte5XdBoB60UkPK3 qlGjRA6YQdBk85B/ja5jetb8pJAZ3EnjAAXcKmSguQ63yYtRd31vIsoOyTBtHzWwFSg/uFRZv Pf0TJgtmtHqWpq9AuUs2LbeLeAcSPAa8YMRf8Ts0XysAgbIZ6wAOQVJAT6ZKpT59cagMgUVcN BNCc39Cs28S7rKhvL40wmmcYhVbJb8/bKY+7xCMSwK9j/HiM+vSipx/bFD5d3Sbbt+4FjxMr6 DUCaRabntcP4aICYqURs/UUesqGe7rJnL2esPfqobQXC4s3iCahZzPLAwsFQDCmnMFYRfN1Aq vmJmE+UCVibxy96b4XJQPCxhp+gxSdsaUD1Q0VpXRSBL21CLhY= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 30594-done Cc: 30594-done@debbugs.gnu.org, Andreas Schwab X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Version: 27.1 Mathieu Othacehe writes: > Oops wrong rebase, sorry about that. Here's an update version. Thanks. I have pushed your patch to both Tramp and Emacs repositories. Closing the bug. > Mathieu Best regards, Michael. ------------=_1519660382-15317-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 24 Feb 2018 18:07:11 +0000 Received: from localhost ([127.0.0.1]:58953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epeE3-0002Eh-FM for submit@debbugs.gnu.org; Sat, 24 Feb 2018 13:07:11 -0500 Received: from eggs.gnu.org ([208.118.235.92]:54054) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epeE1-0002EU-1d for submit@debbugs.gnu.org; Sat, 24 Feb 2018 13:07:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1epeDu-00012j-Tn for submit@debbugs.gnu.org; Sat, 24 Feb 2018 13:07:03 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:37471) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1epeDu-00012I-QZ for submit@debbugs.gnu.org; Sat, 24 Feb 2018 13:07:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45016) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1epeDt-0004Ac-E5 for bug-gnu-emacs@gnu.org; Sat, 24 Feb 2018 13:07:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1epeDq-0000xW-9f for bug-gnu-emacs@gnu.org; Sat, 24 Feb 2018 13:07:01 -0500 Received: from mail-wr0-x233.google.com ([2a00:1450:400c:c0c::233]:37384) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1epeDq-0000wT-3H for bug-gnu-emacs@gnu.org; Sat, 24 Feb 2018 13:06:58 -0500 Received: by mail-wr0-x233.google.com with SMTP id z12so17175009wrg.4 for ; Sat, 24 Feb 2018 10:06:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Vl9nAJZHX/I2sWgVtjF5cpAKE8a/apr6o+dNI9klFAs=; b=H91b7OzTFr4vE/afuSbpfxpXLttWFoaiJxNr7NxS2KxejyeX7ehUJNDWCLHWwabESf B+GXoXLklCRB5wqgTonIh7M0XhKV1Km5vvGultUTGny6wriJJrOTvHI03K6rHTq6JY0n 7cK6/KAn5SfBkgiT3gAO1eNO5HiSDrwqfHE1miR0xlOoLOS8tDAB5c+OZqW64/sEdz8/ YN1W1leDqixcEsqcUg7ti1XQWfGpjlKVbi6BmkBLNsIP7QGcS0J4Ke7j5xXg52KxSleJ JqQ0/pirpvhw3cS70pGq5I0fxu4tk4zEiqRA5aBRDlpAl31el19piyigKFr7m0L3Svwl ciSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Vl9nAJZHX/I2sWgVtjF5cpAKE8a/apr6o+dNI9klFAs=; b=CFdrEkd1KXPw02SAz1L9rTiKh1c/3PVRmQfo5peGJc/b4QX8bUblnDLdoaZCdlb2x7 XtccuFjuAq9IuILQOs6NeZIR9JEzH7cp+V/jsPjuGBlrmnu1uR6H/hITWKT8epF9wBj8 dA0TCG04FN3u5w9Vj3boWrYJEO6iy2TPRp/QtkSmaE+kcb99LdmMfZmUfCGBC0532bo5 O6niXPBwYMwYxWAEoyBPGGGsdIvsaSIni5VcH27VP2LW6H+AFq7YT5UVlC/+MXyHEg3r dLh5jwOUkac2fNfAjjN4ACHeJj8dbSHxo7FSVdyhFA2Nwas4ejmZWtHnOevtF4QWBsJ1 ER2A== X-Gm-Message-State: APf1xPB4cT2DhKYGY96uTCIGoraMiM/C/I0pWt7vIwcCd2fJRP436U5I /eIY/quCmdwR0EGjbS/zo+AgLQ== X-Google-Smtp-Source: AH8x227p9XCgTND7ARfWu+KNtrFK7/+5Vs4WrRHnmhcpo09DAUDdwZ3H4jl1PsG9aEazhN+lUog34Q== X-Received: by 10.223.171.247 with SMTP id s110mr5046325wrc.106.1519495616431; Sat, 24 Feb 2018 10:06:56 -0800 (PST) Received: from localhost.localdomain ([78.192.96.126]) by smtp.gmail.com with ESMTPSA id 55sm27754wrz.6.2018.02.24.10.06.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Feb 2018 10:06:55 -0800 (PST) From: Mathieu Othacehe To: bug-gnu-emacs@gnu.org Subject: [PATCH] Add coreutils 'ls' support for tramp adb Date: Sat, 24 Feb 2018 19:06:40 +0100 Message-Id: <20180224180640.29490-1-m.othacehe@gmail.com> X-Mailer: git-send-email 2.16.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit Cc: Mathieu Othacehe X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Support some Android derived systems where 'ls' binary is provided by GNU Coreutils. * 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'. Force output on one column and long-iso time style to match the behaviour of toybox and busybox 'ls' commands. --- 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 f5c45f68e9..be269aca51 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el @@ -71,7 +71,7 @@ tramp-adb-ls-date-regexp (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 @@ tramp-adb-get-ls-command (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 --help | grep coreutils") + "env COLUMNS=1 ls --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") + "env COLUMNS=1 ls") ;; On CyanogenMod based system BusyBox is used and "ls" output ;; coloring is enabled by default. So we try to disable it when ;; possible. -- 2.16.1 ------------=_1519660382-15317-1--