Skip to content
Permalink
Browse files

Drop Hostname + introduce git commit timestamp on clean git-tree builds

  • Loading branch information...
lynxis committed Mar 6, 2015
1 parent d23eba6 commit 487ef74fc6cb1b1020fb25c9bb3f166602ca926c
Showing with 8 additions and 2 deletions.
  1. +8 −2 scripts/buildversion.sh
@@ -2,16 +2,22 @@
# Script to generate a C file with version information.
OUTFILE="$1"
VAR16MODE="$2"

DATE=""
# Extract version info
if [ -d .git -o -f .git ]; then
VERSION="`git describe --tags --long --dirty`"
if git update-index -q --refresh >/dev/null; \
git diff-index --quiet HEAD; then
DATE=$(git log --date=local --pretty=format:%ct -1)
else
DATE=$(date +%s)
fi
elif [ -f .version ]; then
VERSION="`cat .version`"
else
VERSION="?"
fi
VERSION="${VERSION}-`date +"%Y%m%d_%H%M%S"`-`hostname`"
VERSION="${VERSION}-`date -d @$DATE +"%Y%m%d_%H%M%S"`-buildhost"
echo "Version: ${VERSION}"

# Build header file

0 comments on commit 487ef74

Please sign in to comment.
You can’t perform that action at this time.