* lisp/net/tramp-adb.el (tramp-adb-execute-adb-command)
* lisp/net/tramp-cmds.el (tramp-append-tramp-buffers)
* lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file):
Cosmetic changes.
* lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band):
Use local `default-directory'. Simplify command to send.
Don't check return code, this was already done in
`tramp-process-actions'.
(tramp-get-inline-coding): Don't set `default-directory'.
* lisp/net/tramp.el (tramp-action-out-of-band):
Throw `out-of-band-failed'.
(tramp-process-actions): Handle `out-of-band-failed'.
(tramp-call-process, tramp-call-process-region):
Use local `default-directory'.
"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.
"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
(setq args (append (list "-s" (tramp-adb-get-device vec)) args)))
(with-temp-buffer
(prog1
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).")
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)
(set-buffer-modified-p nil)
(setq buffer-read-only t)
'tramp-gvfs-send-command v gvfs-operation
(append
(and (eq op 'copy) (or keep-date preserve-uid-gid)
'tramp-gvfs-send-command v gvfs-operation
(append
(and (eq op 'copy) (or keep-date preserve-uid-gid)
(list
(tramp-gvfs-url-file-name filename)
(tramp-gvfs-url-file-name newname))))
(list
(tramp-gvfs-url-file-name filename)
(tramp-gvfs-url-file-name newname))))
;; Use an asynchronous process. By this, password can
;; be handled. We don't set a timeout, because the
;; 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)
(tramp-set-connection-property p "vector" orig-vec)
(set-process-query-on-exit-flag p nil)
;; sending the password.
(let ((tramp-local-end-of-line tramp-rsh-end-of-line))
(tramp-process-actions
;; 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)
;; Reset the transfer process properties.
(tramp-set-connection-property v "process-name" nil)
`(lambda (beg end)
(,coding beg end)
(let ((coding-system-for-write 'binary)
`(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)
(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
(apply
'tramp-call-process-region ,vec beg end
(car (split-string ,compress)) t t nil
(tramp-message vec 3 "Process has finished.")
(throw 'tramp-action 'ok))
(tramp-message vec 3 "Process has died.")
(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:
(t nil)))
;;; Functions for processing the actions:
(tramp-get-connection-buffer vec) vec 'file-error
(cond
((eq exit 'permission-denied) "Permission denied")
(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
((eq exit 'process-died)
(substitute-command-keys
(concat
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."
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 ((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))
(vector tramp-current-method tramp-current-user
tramp-current-host nil nil)))
(destination (if (eq destination t) (current-buffer) destination))
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."
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 ((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))
(vector tramp-current-method tramp-current-user
tramp-current-host nil nil)))
(buffer (if (eq buffer t) (current-buffer) buffer))