tmpreaper --protect can't protect directories. I emailed paul@debian.org (the apparent upstream maintainer) two weeks ago but haven't heard back. I'll attach a relatively trivial patch. I discovered this issue when tmpreaper was blowing my OpenAFS cache away. Is a patch of this form (which arguably isn't a bugfix but adds functionality) appropriate for Gentoo, or should I just keep bugging Paul? To reproduce this issue, do: (Look for the line "Pretending to remove file `bar/baz'." -- that IMHO shouldn't have happened.) # touch foo # mkdir bar # touch bar/baz # tmpreaper -t --protect=bar 0d . (PID 4573) Pretending to clean up directory `.'. (PID 4574) Pretending to clean up directory `bar'. Pretending to remove file `bar/baz'. (PID 4574) Back from recursing down `bar'. Entry matching `--protect' pattern skipped. `bar' Pretending to remove file `./foo'. Reproducible: Always Steps to Reproduce: To reproduce this issue, do: (Look for the line "Pretending to remove file `bar/baz'." -- that IMHO shouldn't have happened.) # touch foo # mkdir bar # touch bar/baz # tmpreaper -t --protect=bar 0d . (PID 4573) Pretending to clean up directory `.'. (PID 4574) Pretending to clean up directory `bar'. Pretending to remove file `bar/baz'. (PID 4574) Back from recursing down `bar'. Entry matching `--protect' pattern skipped. `bar' Pretending to remove file `./foo'. Expected Results: I expected this: (PID 10796) Pretending to clean up directory `.'. Pretending to remove file `./foo'. Entry matching `--protect' pattern skipped. `bar' The patched version does this.
Created attachment 73914 [details, diff] A proposed "fix" I think that this is correct (it just moves the check for protection before the recursion down the directory tree).
Ping?
Thanks, fixed in CVS
This doesn't seem to work, when I emerge I get this: >>> Unpacking source... >>> Unpacking tmpreaper_1.6.6.tar.gz to /debian/var/tmp/portage/tmpreaper-1.6.6-r1/work /usr/portage/app-admin/tmpreaper/tmpreaper-1.6.6-r1.ebuild: line 19: epatch: command not found If I try to apply the patch manually, it is rejected. Thanks.
bump, as I never got an email before, and presumably no one else did either.
(In reply to comment #5) > bump, as I never got an email before, and presumably no one else did either. Sorry for the screw-up - I'm working on it...
Created attachment 103406 [details, diff] Rediffed patch against 1.6.6 This one applies to 1.6.6. It's the same fix (moving the test up). It seems to work, too.
Reopening b/c this isn't actually fixed.
(In reply to comment #7) > Created an attachment (id=103406) [edit] > Rediffed patch against 1.6.6 > > This one applies to 1.6.6. It's the same fix (moving the test up). It seems > to work, too. > Thanks again, please ignore my reply to your mail - I didn't notice this bugzie mail :\ Should be fixed in CVS now