From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.bugs Subject: bug#5343: 23.1.91; recursive directory copying is broken Date: Sun, 10 Jan 2010 03:14:48 +0100 Message-ID: References: <87fx6gkx3h.fsf@escher.home> <878wc754i1.fsf@escher.home> Reply-To: Lennart Borgman , 5343@debbugs.gnu.org NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1263089959 29727 80.91.229.12 (10 Jan 2010 02:19:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 10 Jan 2010 02:19:19 +0000 (UTC) To: Stephen Berman , 5343@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 10 03:19:11 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NTnOY-0005f6-Qp for geb-bug-gnu-emacs@m.gmane.org; Sun, 10 Jan 2010 03:19:11 +0100 Original-Received: from localhost ([127.0.0.1]:43411 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NTnOZ-0006Pa-Bx for geb-bug-gnu-emacs@m.gmane.org; Sat, 09 Jan 2010 21:19:11 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NTnOU-0006Nt-8q for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2010 21:19:06 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NTnOP-0006Gr-EV for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2010 21:19:05 -0500 Original-Received: from [199.232.76.173] (port=52891 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NTnOP-0006Gg-CC for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2010 21:19:01 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34871) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NTnOP-0007PC-3f for bug-gnu-emacs@gnu.org; Sat, 09 Jan 2010 21:19:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NTnLW-0001Tc-9K; Sat, 09 Jan 2010 21:16:02 -0500 X-Loop: bug-gnu-emacs@gnu.org Mail-Followup-To: Lennart Borgman , 5343@debbugs.gnu.org Resent-From: Lennart Borgman Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Jan 2010 02:16:02 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: followup 5343 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 5343-submit@debbugs.gnu.org id=B5343.12630897195669 (code B ref 5343); Sun, 10 Jan 2010 02:16:02 +0000 Original-Received: (at 5343) by debbugs.gnu.org; 10 Jan 2010 02:15:19 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NTnKp-0001TO-CG for submit@debbugs.gnu.org; Sat, 09 Jan 2010 21:15:19 -0500 Original-Received: from mail-fx0-f226.google.com ([209.85.220.226]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NTnKn-0001TG-P1 for 5343@debbugs.gnu.org; Sat, 09 Jan 2010 21:15:18 -0500 Original-Received: by fxm26 with SMTP id 26so18139177fxm.39 for <5343@debbugs.gnu.org>; Sat, 09 Jan 2010 18:15:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=5GJiFxuMyO/7vyvA9hjUN1S8JpaWp9K+Q+OmnkxkE/w=; b=SSO9ilickQY5gADKTdLuTYm+yzo+nDSGzz+mkNZxCvip0d9S/NuCZx7Gny8KR1zD4X qJfPRC33hX8OSmgmAn1kBwOuAKfqKgUTA4C1P1MuYuUg3zq9Kv5dUjvytcplbKnPidk/ PcQErwZHfpIjdndSDVDxDhehCac+tdsZX78h4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=nEq25iZt0tn+bIeoKUgNgT4HYbAmdFgAEW1pFb10I5GQd40y5pFMFnahUcfdsIN17r VUHxaEBZvvAaZtLHo6pTNveKlRnR26FbFTXbl7+zx8lu9SCPAHYiu+yxNmTDyE60KR0c E8C0gHmEZ6u21WBxPnaZwtQD4ZmL2lzT/BRBc= Original-Received: by 10.239.237.193 with SMTP id k1mr413790hbp.173.1263089708156; Sat, 09 Jan 2010 18:15:08 -0800 (PST) In-Reply-To: <878wc754i1.fsf@escher.home> X-Spam-Score: -2.5 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list X-Spam-Score: -2.5 (--) Resent-Date: Sat, 09 Jan 2010 21:16:02 -0500 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:34146 Archived-At: On Sat, Jan 9, 2010 at 10:53 PM, Stephen Berman wr= ote: > On Sat, 09 Jan 2010 00:14:58 +0100 Stephen Berman wrote: > >> 1. emacs -Q >> 2. Make a directory /tmp/test, add to it a file named "a" and a >> =C2=A0 =C2=A0directory named "test", and add to /tmp/test/test a file na= med "b". >> 3. Type `M-x copy-directory RET /tmp/test RET ~ RET' to copy /tmp/test >> =C2=A0 =C2=A0recursively to ~. >> 4. Type `C-x d' and at the prompt `~' to visit ~ in Dired, put the >> =C2=A0 =C2=A0cursor on the directory "test" and type `i' to open "test" = as a >> =C2=A0 =C2=A0subdirectory. =C2=A0This is the result: >> >> =C2=A0 /home/steve/test: >> =C2=A0 total used in directory 16 available 7794948 >> =C2=A0 -rw-r--r-- =C2=A01 steve users =C2=A0 =C2=A04 2010-01-08 23:57 a >> =C2=A0 -rw-r--r-- =C2=A01 steve users =C2=A0 =C2=A07 2010-01-08 23:57 b > > This is due to the following code in copy-directory: > > =C2=A0 =C2=A0(if (and (file-directory-p newname) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (not (string-equal (file-name-n= ondirectory directory) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(file-name-nondirectory newname)))) > =C2=A0 =C2=A0 =C2=A0 =C2=A0(setq newname > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(expand-file-name (file-n= ame-nondirectory directory) newname))) > > Specifically, the equality check prevents newname from being changed > from "home/steve/test" to "home/steve/test/test". =C2=A0Removing this che= ck, > as in the below patch, fixes the above breakage. =C2=A0I don't see any re= al > problem this check prevents, but maybe I'm overlooking something. The check looks strange to me. I wonder if the intention really was to prevent copying a directory tree into a subdirectory below itself? But if so, should not the check be a bit different? BTW, I looked at the variable `directory-files-no-dot-files-regexp'. I minor issue, but should it not be (defconst directory-files-no-dot-files-regexp "^\\(?:[^.]\\|\\.\\(?:[^.]\\|\\..\\)\\)" "Regexp of file names excluging \".\" an \"..\".")