On 17/12/09 09:50, Jan Larres wrote:
Hi,
trying to delete a directory structure with -r --one-file-system doesn't
work, since it complains about subdirectories being on a different
device, which isn't true.
Simple example:
$ mkdir -p foo/bar
$ rm -r --one-file-system foo
rm: skipping `foo/bar', since it's on a different device
$ rm -r --one-file-system foo/bar/
$ rm -r --one-file-system foo/
Leaving out --one-file-system works as expected.
This is with coreutils 8.1 on Debian unstable.
Oops. This should fix it and will be in the soon to be released 8.3
I'll add a test and commit today after doing a few more checks.
diff --git a/src/remove.c b/src/remove.c
index 5847200..1306e8f 100644
--- a/src/remove.c
+++ b/src/remove.c
@@ -548,7 +548,7 @@ rm_fts (FTS *fts, FTSENT *ent, struct rm_options const *x)
if (ent->fts_info == FTS_DP
&& x->one_file_system
&& FTS_ROOTLEVEL < ent->fts_level
- && ent->fts_statp->st_ino != fts->fts_dev)
+ && ent->fts_statp->st_dev != fts->fts_dev)
{
mark_ancestor_dirs (ent);
error (0, 0, _("skipping %s, since it's on a different device"),