Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1412 from endocode/tixxdz/fleet-27-01-2016
Browse files Browse the repository at this point in the history
fleet:build: remove build warnings on go1.5
  • Loading branch information
tixxdz committed Jan 27, 2016
2 parents ad01314 + dc96695 commit 189dacf
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion build
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
#!/bin/bash -e

# The -X format changed from go1.4 -> go1.5
function go_linker_dashX {
local version=$(go version)
local regex="go([0-9]+).([0-9]+)."
if [[ $version =~ $regex ]]; then
if [ ${BASH_REMATCH[1]} -eq "1" -a ${BASH_REMATCH[2]} -le "4" ]; then
echo "$1 \"$2\""
else
echo "$1=$2"
fi
else
echo "could not determine Go version"
exit 1
fi
}

ORG_PATH="github.com/coreos"
REPO_PATH="${ORG_PATH}/fleet"
VERSION=$(git describe --dirty)
GLDFLAGS="-X github.com/coreos/fleet/version.Version \"${VERSION}\""
GLDFLAGS="-X $(go_linker_dashX github.com/coreos/fleet/version.Version ${VERSION})"

if [ ! -h gopath/src/${REPO_PATH} ]; then
mkdir -p gopath/src/${ORG_PATH}
Expand Down

0 comments on commit 189dacf

Please sign in to comment.