+# func_ln_if_changed SRC DEST
+# Like ln -s, but avoids munging timestamps if the link is correct.
+# Uses also the variables
+# - dry_run true if actions shall only be printed, blank otherwise
+func_ln_if_changed ()
+{
+ if test $# -ne 2; then
+ echo "usage: func_ln_if_changed SRC DEST" >&2
+ fi
+ test -n "$dry_run" && dry=echo
+ if test -L "$2" -a "$1" = "`readlink "$2"`"; then
+ :
+ else
+ $dry rm -f "$2"
+ $dry ln -s "$1" "$2"
+ fi
+}
+