Correctly detect GIT in a subtree
authorSylvain Henry <sylvain@haskus.fr>
Mon, 29 Oct 2018 18:02:45 +0000 (19:02 +0100)
committerKrzysztof Gogolewski <krz.gogolewski@gmail.com>
Mon, 29 Oct 2018 22:12:05 +0000 (23:12 +0100)
When we use a git subtree, .git is a file, not a directory.
The script was already fixed for the commit ID but not for its date.

PR: https://github.com/ghc/ghc/pull/212/

aclocal.m4

index 55b4162..18e0d7e 100644 (file)
@@ -1536,7 +1536,7 @@ if test "$RELEASE" = "NO"; then
     if test -f VERSION_DATE; then
         PACKAGE_VERSION=${PACKAGE_VERSION}.`cat VERSION_DATE`
         AC_MSG_RESULT(given $PACKAGE_VERSION)
-    elif test -d .git; then
+    elif test -e .git; then
         changequote(, )dnl
         ver_posixtime=`git log -1 --pretty=format:%ct`
         ver_date=`perl -MPOSIX -e "print strftime('%Y%m%d', gmtime($ver_posixtime));"`