[commit: ghc] master: do not use sed for version date processing but rather cut and tr (3c28748)

Ian Lynagh igloo at earth.li
Thu Apr 21 00:44:45 CEST 2011


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/3c287486b41b5f99b20f700a61f5897940403aaf

>---------------------------------------------------------------

commit 3c287486b41b5f99b20f700a61f5897940403aaf
Author: Matthias Kilian <kili at outback.escape.de>
Date:   Mon Apr 18 23:59:51 2011 +0200

    do not use sed for version date processing but rather cut and tr
    
    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 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/aclocal.m4 b/aclocal.m4
index 0e72d22..ed3d006 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -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])





More information about the Cvs-ghc mailing list