Do use readlink if available
authorBernd Jendrissek <bernd.jendrissek@gmail.com>
Wed, 20 Jun 2012 23:04:28 +0000 (01:04 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 21 Jun 2012 09:42:23 +0000 (11:42 +0200)
commitc6599399ec36c941bbd2c504f1aebf2b45816ace
treeb31738990803d48b85a61f31917fdf82d573d740
parentadff17f337187985ea8c62b961fde5c9544911aa
Do use readlink if available

The main effect of this patch is to make gnulib-tool not spam the
terminal with failures from ls. Despite the copious stderr output,
files still get linked correctly.

gnulib-tool: Use readlink if it is available.
* gnulib-tool (func_readlink): Choose function more appropriately.

Running under dash, type -p readlink fails because dash doesn't
understand -p. That causes gnulib-tool to fall back to ls to read
symlinks, despite readlink being available. That, in turn, spams the
terminal when func_ln_if_changed's DEST argument doesn't exist.

The output from type goes to /dev/null anyway, so asking for -p has no
purpose.
ChangeLog
gnulib-tool