#! /bin/sh
FL="$1"
DIR="$2"
TMPFL=$FL.tmp$$
(cd $DIR && find -L ../functions -name '.*' -prune -o -name '*~' -prune -o -type f -print | env LANG= LC_COLLATE= LC_ALL= sort | xargs cksum ) > $TMPFL
if cmp $FL $TMPFL >/dev/null 2>&1; then
        rm -f $TMPFL
else
        echo "File $FL updated."
        mv $TMPFL $FL
fi
