From 26d54994c4d8a30d09a77c7fa0fed3499f328f92 Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Wed, 9 Jan 2008 16:51:27 +0100 Subject: [PATCH] autogen.sh: update package version when necessary Force update of PACKAGE_VERSION from "git describe" when necessary. --- autogen.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/autogen.sh b/autogen.sh index 5fea0bac..9fde36dd 100755 --- a/autogen.sh +++ b/autogen.sh @@ -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 && \