Skip to content

Commit

Permalink
use time of last git commit for version time
Browse files Browse the repository at this point in the history
  • Loading branch information
John Ellson committed May 17, 2015
1 parent 5c388fb commit ff14e5b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions autogen.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
#! /bin/sh

# Use "now" if we can't get time of last commit
GRAPHVIZ_VERSION_DATE=$( date -u +%Y%m%d.%H%M )
GRAPHVIZ_VERSION_DATE=$( git log -n 1 --format=%ct )
if test $? -eq 0; then
GRAPHVIZ_VERSION_DATE=$( date -u +%Y%m%d.%H%M -d @$GRAPHVIZ_VERSION_DATE )
echo "Version date is based on time of last commit: $GRAPHVIZ_VERSION_DATE"
else
GRAPHVIZ_VERSION_DATE=$( date -u +%Y%m%d.%H%M )
echo "Warning: we do not appear to be running in a git clone."
echo "Version date is based on time now: $GRAPHVIZ_VERSION_DATE"
fi

# initialize version for a "stable" build
cat >./version.m4 <<EOF
Expand Down

0 comments on commit ff14e5b

Please sign in to comment.