autogen.sh: update package version when necessary

Force update of PACKAGE_VERSION from "git describe" when necessary.
This commit is contained in:
Hans Ulrich Niedermann 2008-01-09 16:51:27 +01:00 committed by Julien Danjou
parent b55774c0e0
commit 26d54994c4
1 changed files with 13 additions and 0 deletions

View File

@ -4,6 +4,19 @@
srcdir=`dirname "$0"`
[ -z "$srcdir" ] || cd "$srcdir"
# sed program
SED=${SED-sed}
# Check whether the version needs to be updated from git infos
if [ -d ".git" ] && [ -d "autom4te.cache" ]; then
git_describe=`git describe 2>/dev/null || echo devel`
for f in autom4te.cache/output.*; do
[ -f "$f" ] || continue
pkg_ver=`${SED} -n "s/^PACKAGE_VERSION='\(.*\)'\$/\1/p" "$f"`
[ "x$pkg_ver" = "x$git_describe" ] || rm -rf "autom4te.cache"
done
fi
echo "Generating configure files... may take a while."
autoreconf --install --force && \