-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Andreas Schwab on 2/19/2008 8:37 AM:
| Jim Meyering <[EMAIL PROTECTED]> writes:
|
|> +# Remove dangling symlinks in gnulib-populated directories.
|> +# This depends on GNU find, and a relatively recent version at that.
|> +# Ignore any failure for now, since it's only to avoid the relatively
|> +# unusual case in which a symlinked-to file in gnulib/ or gl/ is removed.
|> +find -L m4 lib build-aux -depth -lname '*' -delete > /dev/null 2>&1
|
| Why do you need -depth?  Also, find 4.1 does not support -L nor -delete.

Because -delete implies -depth, and new enough findutils warns and does
nothing rather than deleting a possibly different set of files than what
you tested with (the use case that prompted the change was something like
"find -name '*.txt'" as the dry run, then "find -delete -name '*.txt'"
which proceeded to delete everything in `.').

| A more portable predicate is -xtype l.

The goal here is not to delete all symlinks, just symlinks that are
broken.  Under the influence of -L, does -xtype l work like -lname '*' in
detecting just the broken symlinks?

- --
Don't work too hard, make some time for fun as well!

Eric Blake             [EMAIL PROTECTED]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHuzgX84KuGfSFAYARAlCmAKDUxWGgIJ8Vy9QxRLbSXf4JdCPvmwCgmgV6
Rb+jT8xFrKlHjTxs0YRM4h4=
=Dp4r
-----END PGP SIGNATURE-----


Reply via email to