Sync with Tramp repository
* lisp/net/tramp.el (tramp-message): Dump connection buffer error messages. (tramp-handle-make-auto-save-file-name): When calling `make-auto-save-file-name' internally, make sure it uses Unix-like behavior, not Windows-like behavior. * lisp/net/tramp-sh.el (tramp-set-file-uid-gid): Add a timeout for the local case, because "chown" might fail on w32. * lisp/net/trampver.el (tramp-repository-get-version): Don't run for XEmacs.
This commit is contained in:
parent
40b33be830
commit
e3a0f3daf1
3 changed files with 30 additions and 17 deletions
|
@ -1459,12 +1459,14 @@ be non-negative integers."
|
|||
(tramp-shell-quote-argument localname))))))
|
||||
|
||||
;; We handle also the local part, because there doesn't exist
|
||||
;; `set-file-uid-gid'. On W32 "chown" might not work.
|
||||
(let ((uid (or (and (natnump uid) uid) (tramp-get-local-uid 'integer)))
|
||||
(gid (or (and (natnump gid) gid) (tramp-get-local-gid 'integer))))
|
||||
(tramp-call-process
|
||||
nil "chown" nil nil nil
|
||||
(format "%d:%d" uid gid) (tramp-shell-quote-argument filename))))))
|
||||
;; `set-file-uid-gid'. On W32 "chown" might not work. We add a
|
||||
;; timeout for this.
|
||||
(with-timeout (5 nil)
|
||||
(let ((uid (or (and (natnump uid) uid) (tramp-get-local-uid 'integer)))
|
||||
(gid (or (and (natnump gid) gid) (tramp-get-local-gid 'integer))))
|
||||
(tramp-call-process
|
||||
nil "chown" nil nil nil
|
||||
(format "%d:%d" uid gid) (tramp-shell-quote-argument filename)))))))
|
||||
|
||||
(defun tramp-remote-selinux-p (vec)
|
||||
"Check, whether SELINUX is enabled on the remote host."
|
||||
|
|
|
@ -1530,6 +1530,12 @@ applicable)."
|
|||
(let ((tramp-verbose 0))
|
||||
(setq vec-or-proc
|
||||
(tramp-get-connection-property vec-or-proc "vector" nil))))
|
||||
;; Append connection buffer for error messages.
|
||||
(when (= level 1)
|
||||
(let ((tramp-verbose 0))
|
||||
(with-current-buffer (tramp-get-connection-buffer vec-or-proc)
|
||||
(setq fmt-string (concat fmt-string "\n%s")
|
||||
arguments (append arguments (list (buffer-string)))))))
|
||||
;; Do it.
|
||||
(when (vectorp vec-or-proc)
|
||||
(apply 'tramp-debug-message
|
||||
|
@ -4020,8 +4026,11 @@ this file, if that variable is non-nil."
|
|||
(file-exists-p tramp-auto-save-directory))
|
||||
(make-directory tramp-auto-save-directory t))
|
||||
|
||||
(let ((auto-save-file-name-transforms
|
||||
(if (null tramp-auto-save-directory) auto-save-file-name-transforms))
|
||||
(let ((system-type 'not-windows)
|
||||
(auto-save-file-name-transforms
|
||||
(if (and (null tramp-auto-save-directory)
|
||||
(boundp 'auto-save-file-name-transforms))
|
||||
(symbol-value 'auto-save-file-name-transforms)))
|
||||
(buffer-file-name
|
||||
(if (null tramp-auto-save-directory)
|
||||
buffer-file-name
|
||||
|
|
|
@ -40,15 +40,17 @@
|
|||
|
||||
(defun tramp-repository-get-version ()
|
||||
"Try to return as a string the repository revision of the Tramp sources."
|
||||
(let ((dir (funcall 'locate-dominating-file (locate-library "tramp") ".git")))
|
||||
(when dir
|
||||
(with-temp-buffer
|
||||
(let ((default-directory (file-name-as-directory dir)))
|
||||
(and (zerop
|
||||
(ignore-errors
|
||||
(call-process "git" nil '(t nil) nil "rev-parse" "HEAD")))
|
||||
(not (zerop (buffer-size)))
|
||||
(replace-regexp-in-string "\n" "" (buffer-string))))))))
|
||||
(unless (featurep 'xemacs)
|
||||
(let ((dir
|
||||
(funcall 'locate-dominating-file (locate-library "tramp") ".git")))
|
||||
(when dir
|
||||
(with-temp-buffer
|
||||
(let ((default-directory (file-name-as-directory dir)))
|
||||
(and (zerop
|
||||
(ignore-errors
|
||||
(call-process "git" nil '(t nil) nil "rev-parse" "HEAD")))
|
||||
(not (zerop (buffer-size)))
|
||||
(replace-regexp-in-string "\n" "" (buffer-string)))))))))
|
||||
|
||||
;; Check for (X)Emacs version.
|
||||
(let ((x (if (or (>= emacs-major-version 22)
|
||||
|
|
Loading…
Add table
Reference in a new issue