GNU bug report logs - #15737
24.3; copy-directory ignores copy-contents when using tramp

Previous Next

Package: emacs;

Reported by: Kyle Mahan <kyle.mahan <at> gmail.com>

Date: Sun, 27 Oct 2013 18:44:01 UTC

Severity: normal

Tags: confirmed

Found in version 24.3

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 15737 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Kyle Mahan <kyle.mahan <at> gmail.com>
Cc: 15737 <at> debbugs.gnu.org
Subject: Re: bug#15737: 24.3;
 copy-directory ignores copy-contents when using tramp
Date: Mon, 28 Oct 2013 09:23:15 +0100
Kyle Mahan <kyle.mahan <at> 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 <at> 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.




This bug report was last modified 11 years and 209 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.