From: SourceForge.net <no...@so...> - 2007-05-13 05:05:54
|
Bugs item #1645851, was opened at 2007-01-27 05:51 Message generated for change (Comment added) made by superdma You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1645851&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: msys Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Cesar Strauss (cstrauss) Assigned to: Cesar Strauss (cstrauss) Summary: rm -r ../testdir fails to remove testdir Initial Comment: The following recursive rm invocation fails to remove the top-level directory. The failure appears to be linked somehow with a '..' in the directory name. $ mkdir test $ cd test $ mkdir ../testdir $ touch ../testdir/testfile $ du -a .. 0 ../test 0 ../testdir/testfile 0 ../testdir 0 .. $ rm -r ../testdir rm: cannot remove directory `../testdir': No such file or directory $ du -a .. 0 ../test 0 ../testdir 0 .. $ rm --version rm (GNU coreutils) 5.97 $ /bin/ls -l /bin/rm -rwxr-xr-x 1 cstrauss Administradores 37888 Jan 20 00:27 /bin/rm System info: Windows XP Home SP 2 MinGW installer: manual (tar -zxf) $ uname -a MINGW32_NT-5.1 CESAR 1.0.11(0.46/3/2) 2007-01-12 12:05 i686 Msys MinGW runtime version: 3.11 w32api version: 3.8 ---------------------------------------------------------------------- Comment By: Dave Anderson (superdma) Date: 2007-05-13 00:05 Message: Logged In: YES user_id=1791930 Originator: NO I have also had this same problem with rm -rf for as long as I can remember. I've been using the latest snapshot with the exact same md5sum's cstrauss mentioned. $ mkdir test $ rm -rf test rm: cannot remove directory `test': No such file or directory $ rm -rf test/* $ ls -l drwxr-xr-x 2 Main Administrators 0 May 13 00:52 test Adding the /* stopped it from complaining but that's because it's a different command that works on nothing (no subdirectories of test). As you can imagine this cramps and/or breaks some Makefiles and configure scripts and is becomingly increasingly irritating. I find it unlikely that every user of mingw has this problem. Could there be some insidious corruption in my filesystem? ---------------------------------------------------------------------- Comment By: Cesar Strauss (cstrauss) Date: 2007-05-12 22:52 Message: Logged In: YES user_id=1369729 Originator: YES > $ which rm > /mingw/bin/rm.exe Please try this: $ /mingw/bin/rm.exe -rf a/b/* If it works, try this: $ hash -r $ mkdir -p a/b/c $ rm -rf a/b/* You seem to have unpacked the coreutils in the MinGW root. You may consider installing coreutils in the MSYS root, instead. Cesar ---------------------------------------------------------------------- Comment By: pachiburke (pachiburke) Date: 2007-05-10 20:18 Message: Logged In: YES user_id=1790157 Originator: NO It's very weird, as it doesn't work either, but I seem to have that same versions, both for the coreutils and the rm binary: $ mkdir temp $ cd temp $ mkdir -p a/b/c $ rm -rf a/b/* rm: cannot remove directory `a/b/c': No such file or directory $ which rm /mingw/bin/rm.exe $ md5sum.exe /mingw/bin/rm.exe d907a9463a1960266029bb1da6f779c9 */mingw/bin/rm.exe $ md5sum.exe /e/temp/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2 8a18fe1d5f8f706da8519dd77b10efa2 */e/temp/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2 ---------------------------------------------------------------------- Comment By: Cesar Strauss (cstrauss) Date: 2007-05-10 19:55 Message: Logged In: YES user_id=1369729 Originator: YES Thanks for testing the snapshots. Please, try this: mkdir -p a/b/c rm -rf a/b/* Does it fails? If it does, it means your upgrade failed, somehow, and you still have the old bugged version. Please, make sure you downloaded the latest coreutils package. It has the exact same name as the version it replaced, so you may need to clear your browser's cache. Here is the md5sum output: 8a18fe1d5f8f706da8519dd77b10efa2 *coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz And for rm.exe: d907a9463a1960266029bb1da6f779c9 */bin/rm.exe Regards, Cesar ---------------------------------------------------------------------- Comment By: pachiburke (pachiburke) Date: 2007-05-10 11:28 Message: Logged In: YES user_id=1790157 Originator: NO Even after upgrading to the latest MsysCore and later to the coreutils snapshot (2007-02-05) I'm still having problems with 'rm -rf' not being able to work fine. $ rm -v --version rm (GNU coreutils) 5.97 Copyright (C) 2006 Free Software Foundation, Inc. This is free software. You may redistribute copies of it under the terms of the GNU General Public License <http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the extent permitted by law. Written by Paul Rubin, David MacKenzie, Richard Stallman, and Jim Meyering. $ make clean find . -name "*~" -or -name "*.sw?" -or -name "*.pyc" -exec rm {} ';' rm -rf Site/Local/* rm: cannot remove directory `Site/Local/album': No such file or directory rm: cannot remove `Site/Local/cirugia': No such file or directory rm: cannot remove `Site/Local/consejos': No such file or directory rm: cannot remove `Site/Local/consulta': No such file or directory rm: cannot remove `Site/Local/curriculum': No such file or directory rm: cannot remove `Site/Local/dossier': No such file or directory rm: cannot remove `Site/Local/faq': No such file or directory rm: cannot remove `Site/Local/favicon.ico': No such file or directory rm: cannot remove `Site/Local/hemeroteca': No such file or directory rm: cannot remove `Site/Local/img': No such file or directory rm: cannot remove `Site/Local/index-en.htm': No such file or directory rm: cannot remove `Site/Local/index-fr.htm': No such file or directory rm: cannot remove `Site/Local/index-pt.htm': No such file or directory rm: cannot remove `Site/Local/index.htm': No such file or directory rm: cannot remove `Site/Local/main.css': No such file or directory rm: cannot remove `Site/Local/noticias': No such file or directory rm: cannot remove `Site/Local/opinion': No such file or directory rm: cannot remove `Site/Local/web': No such file or directory make: *** [clean] Error 1 $ msysinfo msysinfo-1.3: Send this to the MSYS support list: MSYS 1.0.11(0.46/3/2) 2007-01-12 12:05 i686 unknown; targ=MINGW32 GNU bash, version 2.04.0(1)-release (i686-pc-msys); ENV=.profile GNU Make version 3.79.1,Built for i686-pc-msys; MAKE_MODE=unix gcc.exe (GCC) 3.4.2 (mingw-special); targ=MINGW32 GNU ld version 2.15.91 20040904 4 2007-01-12 21:00:58.000000000 +0000 /bin/msys-1.0.dll 4 2003-01-02 06:05:27.000000000 +0000 /bin/msysltdl-3.dll 0 2003-06-30 13:20:16.000000000 +0000 /mingw/bin/make.exe 2004-09-21 09:15:22.000000000 +0000 /mingw/bin/gcc.exe 8 2004-09-05 00:45:43.000000000 +0000 /mingw/bin/ld.exe HOME=/home/pachi Sysname=MINGW32_NT-5.1 OSTYPE=msys TERM=cygwin PATH=.:/usr/local/bin:/mingw/bin:/bin:/c/winp/GTK/bin:/c/WINDOWS /system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/winp/Mercurial: /c/winp/gtk/2.0/lib:/c/winp/OpenSSH:/c/winp/OpenSSH/bin:/c/winp/ bin:/c/winp/OpenOffice.org_2.0_SDK/windows/bin:/c/winp/OpenOffic e.org 2.0/program:/c/winp/PuTTY:/c/winp/python24:/c/winp/python2 4/Scripts:/c/winp/Vim/vim70/:/c/winp/Mercurial:/c/winp/upx ---------------------------------------------------------------------- Comment By: Earnie Boyd (earnie) Date: 2007-02-13 23:03 Message: Logged In: YES user_id=15438 Originator: NO Not somewhere, load it to the MSYS Snapshot using the FRS technique. Use ``ftp uploads.sf.net'', ``cd incoming'', ``put'' the file. Then do the file releases under the admin menu above. Let me know if you need help. ---------------------------------------------------------------------- Comment By: Cesar Strauss (cstrauss) Date: 2007-02-13 21:16 Message: Logged In: YES user_id=1369729 Originator: YES Earnie wrote: > Do you think you can manage a snapshot update? Sure. >Make sure that your MSYS libraries are built with ``-s -O2 >-mcpu=pentium'' and make sure that you build the coreutils package >with the same switches. Done. I will place the snapshot at an accessible location soon. Cesar ---------------------------------------------------------------------- Comment By: Earnie Boyd (earnie) Date: 2007-02-13 07:33 Message: Logged In: YES user_id=15438 Originator: NO Cesar, I've not had time to look. Do you think you can manage a snapshot update? Make sure that your MSYS libraries are built with ``-s -O2 -mcpu=pentium'' and make sure that you build the coreutils package with the same switches. I typically will set the afore mentioned flags in a variable ccflags and then on then do ``make CFLAGS="$ccflags" CXXFLAGS="$ccflags"''. Ping me at my SF address if you need help. ---------------------------------------------------------------------- Comment By: Cesar Strauss (cstrauss) Date: 2007-01-27 15:53 Message: Logged In: YES user_id=1369729 Originator: YES Hello, Earnie You are right, the issues are related. The attached patch solves both cases. I don't think your fix addressed the core of the matter, however, so I also reverted it in my patch. I suspect the MSYS version of fchdir may not be working correctly, instead. It is used for changing to the original working directory, as the final directory is removed. The fchdir call is in lib/save-cwd.c (restore_cwd). There was already a fallback using file names instead of descriptors, so I used that. The next thing to do would be making a test case against fchdir and possibly filling a bug report. However, I will travel on vacation, starting tomorrow, so expect a one week delay. Cesar File Added: rm-r.patch ---------------------------------------------------------------------- Comment By: Earnie Boyd (earnie) Date: 2007-01-27 09:38 Message: Logged In: YES user_id=15438 Originator: NO Cesar will you take a look please? The change I made before was to ensure that the directory level had changed back to the starting point before trying to remove the last directory entry. The recurse points didn't back up to remove the last directory before my change so the directory was still open and being windows it can't remove or rename an open directory. You should be able to determine the diff from the CVS. TIA, Earnie. ---------------------------------------------------------------------- Comment By: Earnie Boyd (earnie) Date: 2007-01-27 09:17 Message: Logged In: YES user_id=15438 Originator: NO Sorry, this is different. The difference is the .. directory but is probably related to the other issue. ---------------------------------------------------------------------- Comment By: Earnie Boyd (earnie) Date: 2007-01-27 09:16 Message: Logged In: YES user_id=15438 Originator: NO I thought I fixed that all ready. There is a closed ticket for this same error. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1645851&group_id=2435 |