diff options
author | Jakob Unterwurzacher | 2016-10-30 16:10:40 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2016-10-30 16:17:00 +0100 |
commit | c7385b3681248d5935743c007d17fda724cc142f (patch) | |
tree | a9bc57758aa553d3acd3d194138cd6a6da4c5067 | |
parent | 85f1fd0b0f16ea47e038584e7ff53894d508604a (diff) |
build.bash: abort if we hit a known-bad go-fuse version
Also, standardize to "if [[ ]] ; then" style.
-rwxr-xr-x | build.bash | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -11,13 +11,21 @@ GOPATH2=$(echo $GOPATH | cut -f1 -d:) GITVERSION=$(git describe --tags --dirty) # go-fuse version according to git +# Note: git in CentOS 7 does not have "git -C" yet. That's why we use +# plain "cd" in a subshell. GITVERSIONFUSE=$( cd $GOPATH2/src/github.com/hanwen/go-fuse SHORT=$(git rev-parse --short HEAD) + if [[ $SHORT == 5e829bc ]] ; then + echo "Error: The version $SHORT of the go-fuse library has a known crasher that" >&2 + echo "has been fixed by https://github.com/hanwen/go-fuse/pull/131 . Please upgrade." >&2 + exit 1 + fi + # Check if the tree is dirty, adapted from # http://stackoverflow.com/a/2659808/1380267 - if ! git diff-index --quiet HEAD; then + if ! git diff-index --quiet HEAD ; then echo $SHORT-dirty else echo $SHORT @@ -33,8 +41,7 @@ go version > /dev/null # "go version go1.6.2 linux/amd64" -> "1.6" V=$(go version | cut -d" " -f3 | cut -c3-5) -if [ $V == "1.3" -o $V == "1.4" ] -then +if [[ $V == "1.3" || $V == "1.4" ]] ; then go build -ldflags="-X main.GitVersion $GITVERSION -X main.GitVersionFuse $GITVERSIONFUSE -X main.BuildTime $BUILDTIME" $@ else # Go 1.5 wants an "=" here |