misc: Small fixes for makedeps script

- install Go distribution package only if no go binary found
This commit is contained in:
Oliver Frommel
2018-02-22 01:57:46 +01:00
committed by James Shubin
parent 5597183391
commit 318fe4a5dc

View File

@@ -11,6 +11,7 @@ fi
sudo_command=$(command -v sudo) sudo_command=$(command -v sudo)
GO=`command -v go 2>/dev/null`
YUM=`command -v yum 2>/dev/null` YUM=`command -v yum 2>/dev/null`
DNF=`command -v dnf 2>/dev/null` DNF=`command -v dnf 2>/dev/null`
APT=`command -v apt-get 2>/dev/null` APT=`command -v apt-get 2>/dev/null`
@@ -56,17 +57,22 @@ fi
if [ $travis -eq 0 ]; then if [ $travis -eq 0 ]; then
if [ ! -z "$YUM" ]; then if [ ! -z "$YUM" ]; then
if [ -z "$GO" ]; then
$sudo_command $YUM install -y golang golang-googlecode-tools-stringer
fi
# some go dependencies are stored in mercurial # some go dependencies are stored in mercurial
$sudo_command $YUM install -y golang golang-googlecode-tools-stringer hg $sudo_command $YUM install -y hg
fi fi
if [ ! -z "$APT" ]; then if [ ! -z "$APT" ]; then
$sudo_command $APT update $sudo_command $APT update
$sudo_command $APT install -y golang make gcc packagekit mercurial if [ -z "$GO" ]; then
$sudo_command $APT install -y golang
# one of these two golang tools packages should work on debian # one of these two golang tools packages should work on debian
$sudo_command $APT install -y golang-golang-x-tools || true $sudo_command $APT install -y golang-golang-x-tools || true
$sudo_command $APT install -y golang-go.tools || true $sudo_command $APT install -y golang-go.tools || true
fi fi
$sudo_command $APT install -y build-essential packagekit mercurial
fi
if [ ! -z "$PACMAN" ]; then if [ ! -z "$PACMAN" ]; then
$sudo_command $PACMAN -S --noconfirm --asdeps --needed go gcc pkg-config $sudo_command $PACMAN -S --noconfirm --asdeps --needed go gcc pkg-config
fi fi
@@ -85,8 +91,7 @@ echo "done running 'go get -v -t -d ./...'"
[ -e "$GOBIN/mgmt" ] && rm -f "$GOBIN/mgmt" # the `go get` version has no -X [ -e "$GOBIN/mgmt" ] && rm -f "$GOBIN/mgmt" # the `go get` version has no -X
# vet is built-in in go 1.6 - we check for go vet command # vet is built-in in go 1.6 - we check for go vet command
go vet 1> /dev/null 2>&1 go vet 1> /dev/null 2>&1
ret=$? if [[ $? != 0 ]]; then
if [[ $ret != 0 ]]; then
go get golang.org/x/tools/cmd/vet # add in `go vet` for travis go get golang.org/x/tools/cmd/vet # add in `go vet` for travis
fi fi
go get github.com/blynn/nex # for lexing go get github.com/blynn/nex # for lexing