build.bash: check if the go-fuse tree is dirty

If it is, append "-dirty" to the hash.
This commit is contained in:
Jakob Unterwurzacher 2016-06-19 20:34:54 +02:00
parent 930e597f5a
commit af07866e08
1 changed files with 13 additions and 1 deletions

View File

@ -6,8 +6,20 @@ cd "$(dirname "$0")"
# gocryptfs version according to git
GITVERSION=$(git describe --tags --dirty)
# go-fuse version according to git
GITVERSIONFUSE=$(cd $GOPATH/src/github.com/hanwen/go-fuse && git rev-parse --short HEAD)
GITVERSIONFUSE=$(
cd $GOPATH/src/github.com/hanwen/go-fuse
SHORT=$(git rev-parse --short HEAD)
# Check if the tree is dirty, adapted from
# http://stackoverflow.com/a/2659808/1380267
if ! git diff-index --quiet HEAD; then
echo $SHORT-dirty
else
echo $SHORT
fi
)
# Make sure we have the go binary
go version > /dev/null