diff options
| author | Michael Albinus | 2013-03-03 11:31:01 +0100 |
|---|---|---|
| committer | Michael Albinus | 2013-03-03 11:31:01 +0100 |
| commit | 9a0f9ec39af1433cf9ba180d47351afa0fb78b8e (patch) | |
| tree | 9bcda9ef80a0c8c57b111e100fa9347bd487c37d | |
| parent | 50d8b29da30f41f5ec6c56fd7cbe4c42fa9756ba (diff) | |
| download | emacs-9a0f9ec39af1433cf9ba180d47351afa0fb78b8e.tar.gz emacs-9a0f9ec39af1433cf9ba180d47351afa0fb78b8e.zip | |
* net/tramp-adb.el (tramp-adb-maybe-open-connection): Cache,
whether the "su" command is available on the device.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/net/tramp-adb.el | 11 |
2 files changed, 15 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8b6ffeed01d..a19ebaf473f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-03-03 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp-adb.el (tramp-adb-maybe-open-connection): Cache, | ||
| 4 | whether the "su" command is available on the device. | ||
| 5 | |||
| 1 | 2013-03-01 Michael Albinus <michael.albinus@gmx.de> | 6 | 2013-03-01 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 7 | ||
| 3 | * net/tramp-adb.el (tramp-adb-prompt): Extend regexp. | 8 | * net/tramp-adb.el (tramp-adb-prompt): Extend regexp. |
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el index 910356fbb6c..2d683a4d3d2 100644 --- a/lisp/net/tramp-adb.el +++ b/lisp/net/tramp-adb.el | |||
| @@ -1074,6 +1074,13 @@ connection if a previous connection has died for some reason." | |||
| 1074 | (host (tramp-file-name-host vec)) | 1074 | (host (tramp-file-name-host vec)) |
| 1075 | (user (tramp-file-name-user vec)) | 1075 | (user (tramp-file-name-user vec)) |
| 1076 | (devices (mapcar 'cadr (tramp-adb-parse-device-names nil)))) | 1076 | (devices (mapcar 'cadr (tramp-adb-parse-device-names nil)))) |
| 1077 | |||
| 1078 | ;; Maybe we know already that "su" is not supported. We cannot | ||
| 1079 | ;; use a connection property, because we have not checked yet | ||
| 1080 | ;; whether it is still the same device. | ||
| 1081 | (when (and user (not (tramp-get-file-property vec "" "su-command-p" t))) | ||
| 1082 | (tramp-error vec 'file-error "Cannot switch to user `%s'" user)) | ||
| 1083 | |||
| 1077 | (unless | 1084 | (unless |
| 1078 | (and p (processp p) (memq (process-status p) '(run open))) | 1085 | (and p (processp p) (memq (process-status p) '(run open))) |
| 1079 | (save-match-data | 1086 | (save-match-data |
| @@ -1133,7 +1140,9 @@ connection if a previous connection has died for some reason." | |||
| 1133 | (tramp-adb-send-command vec (format "su %s" user)) | 1140 | (tramp-adb-send-command vec (format "su %s" user)) |
| 1134 | (unless (zerop (tramp-adb-command-exit-status vec nil)) | 1141 | (unless (zerop (tramp-adb-command-exit-status vec nil)) |
| 1135 | (delete-process p) | 1142 | (delete-process p) |
| 1136 | (tramp-error vec 'file-error "Cannot switch to user %s" user))) | 1143 | (tramp-set-file-property vec "" "su-command-p" nil) |
| 1144 | (tramp-error | ||
| 1145 | vec 'file-error "Cannot switch to user `%s'" user))) | ||
| 1137 | 1146 | ||
| 1138 | ;; Set "remote-path" connection property. This is needed | 1147 | ;; Set "remote-path" connection property. This is needed |
| 1139 | ;; for eshell. | 1148 | ;; for eshell. |