do not use sed for version date processing but rather cut and tr
authorMatthias Kilian <kili@outback.escape.de>
Mon, 18 Apr 2011 21:59:51 +0000 (23:59 +0200)
committerIan Lynagh <igloo@earth.li>
Wed, 20 Apr 2011 21:26:20 +0000 (22:26 +0100)
Based on an idea from Karel Gardas, who had troubles with the original
sed version (which didn't work with /usr/bin/sed on Solaris).

aclocal.m4

index 0e72d22..ed3d006 100644 (file)
@@ -1116,7 +1116,7 @@ if test "$RELEASE" = "NO"; then
         AC_MSG_RESULT(given $PACKAGE_VERSION)
     elif test -d .git; then
         changequote(, )dnl
-        ver_date=`git log -n 1 --date=short --pretty=format:%ci | sed "s/^.*\([0-9][0-9][0-9][0-9]\)-\([0-9][0-9]\)-\([0-9][0-9]\).*$/\1\2\3/"`
+        ver_date=`git log -n 1 --date=short --pretty=format:%ci | cut -d ' ' -f 1 | tr -d -`
         if echo $ver_date | grep '^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]$' 2>&1 >/dev/null; then true; else
         changequote([, ])dnl
                 AC_MSG_ERROR([failed to detect version date: check that git is in your path])