On Tuesday 25 January 2005 13:06, Sam Watkins wrote: | On Mon, Jan 24, 2005 at 11:24:47PM +0100, Florian Ernst wrote | | (on debain-user): | > cleanlinks is dangerous, it wasn't never meant for general system | > maintenance and doesn't work as advertised in its manpage. | | Rather than fixing cleanlinks to work better, which is apparently not | happening, the manpage at least should be corrected to warn of this bug | in big flashing red letters. (cleanlinks deletes all symlinks to | anything that isn't a regular file, e.g. symlinks to directories)
Attached is a patch for the manpage. Also attached are 2 Perl scripts that do remove dangling symlinks and empty directories. They seem to work, but are not systematically tested. Cleanlinks is in xc/util because it is a utility that is used by X, i think. When i 'grep -n -d recurse /my/source/X/xfree86-4.3.0.dfsg.1`, i do not see it being called anywhere, but then how can it break xterm ? Maybe this is because i 'apt-get source'd sarge and not testing ? have fun ! Siward de Groot <http://home.wanadoo.nl/siward>
--- cleanlinks.man.patched 2005-01-29 22:23:58.000000000 +0100 +++ cleanlinks.man 2002-10-12 18:06:40.000000000 +0200 @@ -1,13 +1,13 @@ .TH cleanlinks 1 __vendorversion__ .SH NAME -cleanlinks \- undo effects of lndir +cleanlinks \- remove dangling symbolic links and empty directories .SH SYNOPSIS .B cleanlinks .SH DESCRIPTION The .I cleanlinks program searches the directory tree descended from the current directory for -symbolic links whose targets are not ordinary files, and removes them. +symbolic links whose targets do not exist, and removes them. It then removes all empty directories in that directory tree. .PP .I cleanlinks
rmdanglinks
Description: Perl program
rmemptydirs
Description: Perl program