# HG changeset patch # Parent d90c3d4786da4cfa7944c9009a0071e3ea6f8581 diff -r d90c3d4786da configure.ac --- a/configure.ac Wed Jun 13 11:43:31 2012 +0900 +++ b/configure.ac Wed Jun 13 11:44:38 2012 +0900 @@ -464,20 +464,26 @@ AC_DEFINE_UNQUOTED(STONITH_PLUGIN_DIR,"$STONITH_PLUGIN_DIR", Location for Stonith plugins) AC_SUBST(STONITH_PLUGIN_DIR) -AC_PATH_PROGS(HG, hg false) +AC_PATH_PROGS(GIT, git false) AC_MSG_CHECKING(build version) -BUILD_VERSION=unknown -if test -f $srcdir/.hg_archival.txt; then - BUILD_VERSION=`cat $srcdir/.hg_archival.txt | awk '/node:/ { print $2 }'` -elif test -x $HG -a -d .hg; then - BUILD_VERSION=`$HG id -itb` - if test $? != 0; then - BUILD_VERSION=unknown - fi + +BUILD_VERSION=$Format:%H$ +if test $BUILD_VERSION != ":%H$"; then + AC_MSG_RESULT(archive hash: $BUILD_VERSION) + +elif test -x $GIT -a -d .git; then + BUILD_VERSION=`$GIT log --pretty="format:%h" -n 1` + AC_MSG_RESULT(git hash: $BUILD_VERSION) + +else + # The current directory name make a reasonable default + # Most generated archives will include the hash or tag + BASE=`basename $PWD` + BUILD_VERSION=`echo $BASE | sed s:.*[[Pp]]acemaker-::` + AC_MSG_RESULT(directory based hash: $BUILD_VERSION) fi AC_DEFINE_UNQUOTED(BUILD_VERSION, "$BUILD_VERSION", Build version) -AC_MSG_RESULT($BUILD_VERSION) AC_SUBST(BUILD_VERSION) dnl ===============================================