Skip to content

Commit

Permalink
Cross-platform version of date -Iseconds in configure (#568)
Browse files Browse the repository at this point in the history
* Cross-platform version of date -Iseconds

* date on MacOS 10.14 does not support %:z

* misreplaced string

* misreplaced string
  • Loading branch information
HuidaeCho committed Apr 28, 2020
1 parent ca90310 commit 1b89aee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions configure
Expand Up @@ -1313,8 +1313,8 @@ LIB_VER=`echo ${GRASS_VERSION_NUMBER} | sed 's/^\([0-9.]*\).*$/\1/'`
GRASS_VERSION_GIT="exported"
# get git short hash + date of last change in GRASS headers
# (and anything else in include)
GRASS_HEADERS_GIT_HASH=`date -u -Iseconds`
GRASS_HEADERS_GIT_DATE=`date -u -Iseconds`
GRASS_HEADERS_GIT_HASH=`date -u +%FT%T%z | sed 's/\(..\)$/:\1/'`
GRASS_HEADERS_GIT_DATE=`date -u +%FT%T%z | sed 's/\(..\)$/:\1/'`
# Extract the first word of "git", so it can be a program name with args.
set dummy git; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
Expand Down Expand Up @@ -1355,11 +1355,11 @@ if test "$GIT" != "no" ; then
fi
GRASS_HEADERS_GIT_HASH=`$GIT log -1 --pretty=format:"%h" -- "${SRCDIR}/include" 2>/dev/null`
if test -z "$GRASS_HEADERS_GIT_HASH"; then
GRASS_HEADERS_GIT_HASH=`date -u -Iseconds`
GRASS_HEADERS_GIT_HASH=`date -u +%FT%T%z | sed 's/\(..\)$/:\1/'`
fi
GRASS_HEADERS_GIT_DATE=`date -d $($GIT log -1 --pretty=format:"%cI" -- "${SRCDIR}/include") -u -Iseconds` 2>/dev/null
GRASS_HEADERS_GIT_DATE=`date -d $($GIT log -1 --pretty=format:"%cI" -- "${SRCDIR}/include") -u +%FT%T%z | sed 's/\(..\)$/:\1/'` 2>/dev/null
if test -z "$GRASS_HEADERS_GIT_DATE"; then
GRASS_HEADERS_GIT_DATE=`date -u -Iseconds`
GRASS_HEADERS_GIT_DATE=`date -u +%FT%T%z | sed 's/\(..\)$/:\1/'`
fi
fi

Expand Down
10 changes: 5 additions & 5 deletions configure.in
Expand Up @@ -142,8 +142,8 @@ changequote([,])
GRASS_VERSION_GIT="exported"
# get git short hash + date of last change in GRASS headers
# (and anything else in include)
GRASS_HEADERS_GIT_HASH=`date -u -Iseconds`
GRASS_HEADERS_GIT_DATE=`date -u -Iseconds`
GRASS_HEADERS_GIT_HASH=`date -u +%FT%T%z | sed 's/\(..\)$/:\1/'`
GRASS_HEADERS_GIT_DATE=`date -u +%FT%T%z | sed 's/\(..\)$/:\1/'`
AC_PATH_PROG(GIT, git, no)
if test "$GIT" != "no" ; then
GRASS_VERSION_GIT=`$GIT rev-parse --short HEAD 2>/dev/null`
Expand All @@ -152,11 +152,11 @@ if test "$GIT" != "no" ; then
fi
GRASS_HEADERS_GIT_HASH=`$GIT log -1 --pretty=format:"%h" -- "${SRCDIR}/include" 2>/dev/null`
if test -z "$GRASS_HEADERS_GIT_HASH"; then
GRASS_HEADERS_GIT_HASH=`date -u -Iseconds`
GRASS_HEADERS_GIT_HASH=`date -u +%FT%T%z | sed 's/\(..\)$/:\1/'`
fi
GRASS_HEADERS_GIT_DATE=`date -d $($GIT log -1 --pretty=format:"%cI" -- "${SRCDIR}/include") -u -Iseconds` 2>/dev/null
GRASS_HEADERS_GIT_DATE=`date -d $($GIT log -1 --pretty=format:"%cI" -- "${SRCDIR}/include") -u +%FT%T%z | sed 's/\(..\)$/:\1/'` 2>/dev/null
if test -z "$GRASS_HEADERS_GIT_DATE"; then
GRASS_HEADERS_GIT_DATE=`date -u -Iseconds`
GRASS_HEADERS_GIT_DATE=`date -u +%FT%T%z | sed 's/\(..\)$/:\1/'`
fi
fi

Expand Down

0 comments on commit 1b89aee

Please sign in to comment.