Jim Meyering wrote:
mwoehlke <[EMAIL PROTECTED]> wrote:
...
Did you try with 5.97? I haven't tried 6.2 yet (will try to do that
No, since rm in that release is so different, and since
I don't plan to make a 5.98 release.
soon)... Um, actually, I am probably not going to try until someone can
tell me how the *&($ to test the exit code of 'make check' after I've
piped it through 'tee' :-) - tips would be most welcome!
Easiest test is on coreutils itself...
$ uname -srvmpio
Darwin 7.9.0 Darwin Kernel Version 7.9.0: Wed Mar 30 20:11:17 PST 2005;
root:xnu/xnu-517.12.7.obj~1/RELEASE_PPC Power Macintosh powerpc
RackMac3,1 Darwin
$ rm --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.
$ ls coreutils-5.97
ls: coreutils-5.97: No such file or directory
$ tar xzf coreutils-5.97.tar.gz
$ find coreutils-5.97/ | wc -l
2788
$ rm -rf coreutils-5.97
rm: cannot remove directory `coreutils-5.97/m4': Directory not empty
rm: cannot remove directory `coreutils-5.97/lib': Di0rectory not empty
$ find coreutils-5.97/ | wc -l
173
$ rm -rf coreutils-5.97
$ find coreutils-5.97/ | wc -l
find: coreutils-5.97/: No such file or directory
0
$
Thanks. That's probably all I needed.
From those numbers and the number of files in lib and m4, I deduce
that your system's readdir is mistakenly returning NULL when there
are around 190 entries in a directory.
Would you please try this, to confirm the theory:
#!/bin/bash
for i in $(seq 150 200); do
echo i=$i
mkdir b; (cd b; mkdir $(seq $i) ); Rm -r b || { echo bug at i=$i; break; }
done
That should find the minimum number of entries for which rm fails.
Nope, that didn't work. I also
Once you find that number, say 190, change the enum in your
copy of coreutils' src/remove.c that looks like this:
[snip]
CONSECUTIVE_READDIR_UNLINK_THRESHOLD = 189
Then recompile, and "rm -r" should work.
However...
# using THRESHOLD = 150
$ tar xzf coreutils-6.3.tar.gz
$ until /path-to-rm -rf coreutils-6.3 ; do : ; done
# using THRESHOLD = 200 (default)
$ tar xzf coreutils-6.3.tar.gz
$ until /path-to-rm -rf coreutils-6.3 ; do : ; done
/path-to-rm: cannot remove directory `coreutils-6.3/m4':
Directory not empty
/path-to-rm: cannot remove directory `coreutils-6.3/lib':
Directory not empty
...so that is definitely the problem. Trying a few more values, I see:
150 - works
200 - broken
175 - works
190 - broken (but only in m4, not lib)
185 - works
188 - broken (same as 190)
187 - works
Honestly, I would probably go with 160-ish to be safe. :-)
--
Matthew
Download. Untar. Configure. Make. Install. Lather. Rinse. Repeat.