summaryrefslogtreecommitdiff
path: root/lisp/net
diff options
context:
space:
mode:
authorK. Handa <handa@gnu.org>2016-06-05 20:49:55 +0900
committerK. Handa <handa@gnu.org>2016-06-05 20:49:55 +0900
commit4ffe265b5192fd93137cd49fb204efdc4bda2887 (patch)
tree054528efc2f8deb55396df2c871d093ae270be5d /lisp/net
parent096d1347654803ee04771516c58701ddf210d898 (diff)
parent75de3640f147fad8bf1c4a7e393c8e294b9851f6 (diff)
downloademacs-4ffe265b5192fd93137cd49fb204efdc4bda2887.tar.gz
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/tramp-adb.el2
-rw-r--r--lisp/net/tramp-cmds.el2
-rw-r--r--lisp/net/tramp-gvfs.el2
-rw-r--r--lisp/net/tramp-sh.el51
-rw-r--r--lisp/net/tramp.el12
5 files changed, 27 insertions, 42 deletions
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index 1281dbbd72d..f77e44e79ce 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -1045,7 +1045,7 @@ E.g. a host name \"192.168.1.1#5555\" returns \"192.168.1.1:5555\"
"Returns nil on success error-output on failure."
(when (and (> (length (tramp-file-name-host vec)) 0)
;; The -s switch is only available for ADB device commands.
- (not (member (car args) (list "connect" "disconnect"))))
+ (not (member (car args) '("connect" "disconnect"))))
(setq args (append (list "-s" (tramp-adb-get-device vec)) args)))
(with-temp-buffer
(prog1
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el
index 856011fc0ee..45f30042ad8 100644
--- a/lisp/net/tramp-cmds.el
+++ b/lisp/net/tramp-cmds.el
@@ -345,7 +345,7 @@ names. Passwords will never be included there.")
Please note that you have set `tramp-verbose' to a value of at
least 6. Therefore, the contents of files might be included in
the debug buffer(s).")
- (add-text-properties start (point) (list 'face 'italic))))
+ (add-text-properties start (point) '(face italic))))
(set-buffer-modified-p nil)
(setq buffer-read-only t)
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index ac390e5d5a6..0e874d6c586 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -680,7 +680,7 @@ file names."
'tramp-gvfs-send-command v gvfs-operation
(append
(and (eq op 'copy) (or keep-date preserve-uid-gid)
- (list "--preserve"))
+ '("--preserve"))
(list
(tramp-gvfs-url-file-name filename)
(tramp-gvfs-url-file-name newname))))
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index e9f78b7d1ce..19f687c3433 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -2517,19 +2517,18 @@ The method used must be an out-of-band method."
;; Use an asynchronous process. By this, password can
;; be handled. We don't set a timeout, because the
- ;; copying of large files can last longer than 60
- ;; secs.
- (let ((p (apply 'start-process-shell-command
- (tramp-get-connection-name v)
- (tramp-get-connection-buffer v)
- copy-program
- (append
- copy-args
- (list "&&" "echo" "tramp_exit_status" "0"
- "||" "echo" "tramp_exit_status" "1")))))
- (tramp-message
- orig-vec 6 "%s"
- (mapconcat 'identity (process-command p) " "))
+ ;; copying of large files can last longer than 60 secs.
+ (let* ((command
+ (mapconcat
+ 'identity (append (list copy-program) copy-args)
+ " "))
+ (p (let ((default-directory
+ (tramp-compat-temporary-file-directory)))
+ (start-process-shell-command
+ (tramp-get-connection-name v)
+ (tramp-get-connection-buffer v)
+ command))))
+ (tramp-message orig-vec 6 "%s" command)
(tramp-set-connection-property p "vector" orig-vec)
(set-process-query-on-exit-flag p nil)
@@ -2537,23 +2536,7 @@ The method used must be an out-of-band method."
;; sending the password.
(let ((tramp-local-end-of-line tramp-rsh-end-of-line))
(tramp-process-actions
- p v nil tramp-actions-copy-out-of-band))
-
- ;; Check the return code.
- (goto-char (point-max))
- (unless
- (re-search-backward "tramp_exit_status [0-9]+" nil t)
- (tramp-error
- orig-vec 'file-error
- "Couldn't find exit status of `%s'"
- (mapconcat 'identity (process-command p) " ")))
- (skip-chars-forward "^ ")
- (unless (zerop (read (current-buffer)))
- (forward-line -1)
- (tramp-error
- orig-vec 'file-error
- "Error copying: `%s'"
- (buffer-substring (point-min) (point-at-eol))))))
+ p v nil tramp-actions-copy-out-of-band))))
;; Reset the transfer process properties.
(tramp-set-connection-property v "process-name" nil)
@@ -5597,18 +5580,14 @@ function cell is returned to be applied on a buffer."
`(lambda (beg end)
(,coding beg end)
(let ((coding-system-for-write 'binary)
- (coding-system-for-read 'binary)
- (default-directory
- (tramp-compat-temporary-file-directory)))
+ (coding-system-for-read 'binary))
(apply
'tramp-call-process-region ,vec (point-min) (point-max)
(car (split-string ,compress)) t t nil
(cdr (split-string ,compress)))))
`(lambda (beg end)
(let ((coding-system-for-write 'binary)
- (coding-system-for-read 'binary)
- (default-directory
- (tramp-compat-temporary-file-directory)))
+ (coding-system-for-read 'binary))
(apply
'tramp-call-process-region ,vec beg end
(car (split-string ,compress)) t t nil
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index e3755533b9d..b02760bff80 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3445,7 +3445,7 @@ The terminal type can be configured with `tramp-terminal-type'."
(tramp-message vec 3 "Process has finished.")
(throw 'tramp-action 'ok))
(tramp-message vec 3 "Process has died.")
- (throw 'tramp-action 'process-died))))
+ (throw 'tramp-action 'out-of-band-failed))))
(t nil)))
;;; Functions for processing the actions:
@@ -3506,6 +3506,10 @@ connection buffer."
(tramp-get-connection-buffer vec) vec 'file-error
(cond
((eq exit 'permission-denied) "Permission denied")
+ ((eq exit 'out-of-band-failed)
+ (format-message
+ "Copy failed, see buffer `%s' for details"
+ (tramp-get-connection-buffer vec)))
((eq exit 'process-died)
(substitute-command-keys
(concat
@@ -4003,7 +4007,8 @@ ALIST is of the form ((FROM . TO) ...)."
It always returns a return code. The Lisp error raised when
PROGRAM is nil is trapped also, returning 1. Furthermore, traces
are written with verbosity of 6."
- (let ((v (or vec
+ (let ((default-directory (tramp-compat-temporary-file-directory))
+ (v (or vec
(vector tramp-current-method tramp-current-user
tramp-current-host nil nil)))
(destination (if (eq destination t) (current-buffer) destination))
@@ -4033,7 +4038,8 @@ are written with verbosity of 6."
It always returns a return code. The Lisp error raised when
PROGRAM is nil is trapped also, returning 1. Furthermore, traces
are written with verbosity of 6."
- (let ((v (or vec
+ (let ((default-directory (tramp-compat-temporary-file-directory))
+ (v (or vec
(vector tramp-current-method tramp-current-user
tramp-current-host nil nil)))
(buffer (if (eq buffer t) (current-buffer) buffer))