all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#15737: 24.3; copy-directory ignores copy-contents when using tramp
@ 2013-10-27 16:58 Kyle Mahan
  2013-10-28  8:23 ` Michael Albinus
  0 siblings, 1 reply; 4+ messages in thread
From: Kyle Mahan @ 2013-10-27 16:58 UTC (permalink / raw)
  To: 15737

[-- Attachment #1: Type: text/plain, Size: 3820 bytes --]

Hello,
Trying to copy the contents of a local directory to a remote one (trying
to get behavior like "scp -r src/* user@host:dest/") , I noticed that
the "copy-contents" flag is (silently?) ignored when the destination is
remote. So the directory, rather than its contents is copied to the
destination. To reproduce:

;; terminal:
;; [kmahan@lemur ~]$ mkdir /tmp/source /tmp/dest-local /tmp/dest-remote
;; [kmahan@lemur ~]$ touch /tmp/source/file

(copy-directory "/tmp/source" "/tmp/dest-local" nil nil t)
(copy-directory "/tmp/source" "/kmahan@localhost:/tmp/dest-remote" nil nil
t)

;; terminal:
;; [kmahan@lemur ~]$ ls /tmp/dest-local/
;; file
;; [kmahan@lemur ~]$ ls /tmp/dest-remote/
;; source/

Thanks :)


In GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.8.2)
 of 2013-08-06 on -mnt-storage-buildroots-staging-x86_64-eric
Windowing system distributor `The X.Org Foundation', version 11.0.11403000
Configured using:
 `configure '--prefix=/usr' '--sysconfdir=/etc' '--libexecdir=/usr/lib'
 '--localstatedir=/var' '--with-x-toolkit=gtk3' '--with-xft'
 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector
 --param=ssp-buffer-size=4'
 'LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro'
 'CPPFLAGS=-D_FORTIFY_SOURCE=2''

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  shell-dirtrack-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<return> <down> <down> <down> <down> C-j C-y <up> <up>
<up> <up> <up> C-k C-k ; ; SPC <left> <down> <left>
<left> ; ; SPC <left> <down> <left> <left> ; ; SPC
<left> <down> <left> <left> ; ; SPC <C-left> <C-left>
<C-left> <C-left> <C-right> <backspace> <backspace>
<backspace> <C-down> C-SPC <C-up> <C-up> <C-up> M-w
C-g M-x r e p r o t <C-backspace> M-x r e p o r t <tab>
<return>

Recent messages:

Tramp: Waiting for prompts from remote shell
Tramp: Process has finished.
Tramp: Opening connection for kmahan@localhost using scpc...done
nil
byte-code: End of buffer [2 times]

Tramp: Waiting for prompts from remote shell
Tramp: Process has finished.
Quit
completing-read-default: Command attempted to use minibuffer while in
minibuffer

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rfc822 mml easymenu mml-sec
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils tramp-cache
tramp-sh tramp tramp-compat auth-source eieio byte-opt bytecomp
byte-compile cconv gnus-util mm-util mail-prsvr password-cache
tramp-loaddefs shell pcomplete comint ansi-color ring format-spec advice
help-fns cl-lib advice-preload time-date tooltip ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment lisp-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
make-network-process dbusbind dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)

[-- Attachment #2: Type: text/html, Size: 4581 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#15737: 24.3; copy-directory ignores copy-contents when using tramp
  2013-10-27 16:58 bug#15737: 24.3; copy-directory ignores copy-contents when using tramp Kyle Mahan
@ 2013-10-28  8:23 ` Michael Albinus
  2013-10-28 19:13   ` Kyle Mahan
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Albinus @ 2013-10-28  8:23 UTC (permalink / raw)
  To: Kyle Mahan; +Cc: 15737

Kyle Mahan <kyle.mahan@gmail.com> writes:

> Hello,

Hi,

> Trying to copy the contents of a local directory to a remote one
> (trying to get behavior like "scp -r src/* user@host:dest/") , I
> noticed that the "copy-contents" flag is (silently?) ignored when the
> destination is remote. So the directory, rather than its contents is
> copied to the destination.

Thanks for the report, I could reproduce it here. Could you, please,
check the following patch:

--8<---------------cut here---------------start------------->8---
*** /usr/local/src/emacs-24/lisp/net/tramp-sh.el.~111399~	2013-10-28 09:18:09.197122236 +0100
--- /usr/local/src/emacs-24/lisp/net/tramp-sh.el	2013-10-28 09:17:24.648901345 +0100
***************
*** 1912,1918 ****
    (let ((t1 (tramp-tramp-file-p dirname))
  	(t2 (tramp-tramp-file-p newname)))
      (with-parsed-tramp-file-name (if t1 dirname newname) nil
!       (if (and (tramp-get-method-parameter method 'tramp-copy-recursive)
  	       ;; When DIRNAME and NEWNAME are remote, they must have
  	       ;; the same method.
  	       (or (null t1) (null t2)
--- 1912,1919 ----
    (let ((t1 (tramp-tramp-file-p dirname))
  	(t2 (tramp-tramp-file-p newname)))
      (with-parsed-tramp-file-name (if t1 dirname newname) nil
!       (if (and (not copy-contents)
! 	       (tramp-get-method-parameter method 'tramp-copy-recursive)
  	       ;; When DIRNAME and NEWNAME are remote, they must have
  	       ;; the same method.
  	       (or (null t1) (null t2)
***************
*** 1935,1941 ****
  	     'copy dirname newname keep-date))
  	;; We must do it file-wise.
  	(tramp-run-real-handler
! 	 'copy-directory (list dirname newname keep-date parents)))
  
        ;; When newname did exist, we have wrong cached values.
        (when t2
--- 1936,1945 ----
  	     'copy dirname newname keep-date))
  	;; We must do it file-wise.
  	(tramp-run-real-handler
! 	 'copy-directory
! 	 (if copy-contents
! 	     (list dirname newname keep-date parents copy-contents)
! 	   (list dirname newname keep-date parents))))
  
        ;; When newname did exist, we have wrong cached values.
        (when t2
--8<---------------cut here---------------end--------------->8---

> Thanks :)

Best regards, Michael.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#15737: 24.3; copy-directory ignores copy-contents when using tramp
  2013-10-28  8:23 ` Michael Albinus
@ 2013-10-28 19:13   ` Kyle Mahan
  2013-10-28 19:37     ` Michael Albinus
  0 siblings, 1 reply; 4+ messages in thread
From: Kyle Mahan @ 2013-10-28 19:13 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 15737

[-- Attachment #1: Type: text/plain, Size: 682 bytes --]

On Mon, Oct 28, 2013 at 1:23 AM, Michael Albinus <michael.albinus@gmx.de>wrote:

> Kyle Mahan <kyle.mahan@gmail.com> writes:
>
> > Trying to copy the contents of a local directory to a remote one
> > (trying to get behavior like "scp -r src/* user@host:dest/") , I
> > noticed that the "copy-contents" flag is (silently?) ignored when the
> > destination is remote. So the directory, rather than its contents is
> > copied to the destination.
>
> Thanks for the report, I could reproduce it here. Could you, please,
> check the following patch:
>
>
Confirming that this patch fixes the issue for (my use-case). Wow, that was
fast!

Thanks,
Kyle

-- 
Kyle Mahan
kyle.mahan@gmail.com

[-- Attachment #2: Type: text/html, Size: 1247 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#15737: 24.3; copy-directory ignores copy-contents when using tramp
  2013-10-28 19:13   ` Kyle Mahan
@ 2013-10-28 19:37     ` Michael Albinus
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Albinus @ 2013-10-28 19:37 UTC (permalink / raw)
  To: Kyle Mahan; +Cc: 15737-done

Kyle Mahan <kyle.mahan@gmail.com> writes:

> Confirming that this patch fixes the issue for (my use-case). Wow,
> that was fast!

Thanks for confirmation. I've committed the patch to Emacs' trunk,
closing this bug report.

> Thanks,
> Kyle

Best regards, Michael.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-10-28 19:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-27 16:58 bug#15737: 24.3; copy-directory ignores copy-contents when using tramp Kyle Mahan
2013-10-28  8:23 ` Michael Albinus
2013-10-28 19:13   ` Kyle Mahan
2013-10-28 19:37     ` Michael Albinus

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.