gomod: remove gopath check
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
Jakub Sztandera committed
Mar 4, 2019 at 23:16 UTC
21f3dae69668bbbdbf6353878727623bd87d587c
3 files changed
-81
bin/check_go_path
deleted
-30
@@ -1,30 +0,0 @@
1
-#!/usr/bin/env bash
2
-
3
-set -e
4
-
5
-PKG="$1"
6
-
7
-DIR="$(pwd -P)"
8
-GOPATH="$(go env GOPATH)"
9
-
10
-# The path separator is ; on windows.
11
-if [ "$(go env GOOS)" = "windows" ]; then
12
- PATHSEP=';'
13
-else
14
- PATHSEP=':'
15
-fi
16
-
17
-while read -r -d "$PATHSEP" p; do
18
- if ! cd "$p/src/$PKG" 2>/dev/null; then
19
- continue
20
- fi
21
-
22
- if [ "$DIR" = "$(pwd -P)" ]; then
23
- exit 0
24
- fi
25
- cd "$DIR"
26
-done <<< "$GOPATH$PATHSEP"
27
-
28
-echo "go-ipfs must be built from within your \$GOPATH directory."
29
-echo "expected within '$GOPATH' but got '$DIR'"
30
-exit 1
bin/check_gx_program
deleted
-46
@@ -1,46 +0,0 @@
1
-#!/bin/sh
2
-#
3
-# Check if a gx program is installed and if its version is at least
4
-# equal to a minimum version number.
5
-#
6
-# Call it for example like this:
7
-#
8
-# $ check_gx_program "gx-go" "0.2.0" "Use 'make gx_upgrade' to install or upgrade gx-go."
9
-#
10
-# or:
11
-#
12
-# $ check_gx_program "gx" "0.3" "Use 'make gx_upgrade' to install or upgrade gx."
13
-#
14
-
15
-USAGE="$0 GX_PROGRAM_NAME GX_MIN_VERSION UPGRADE_MSG"
16
-
17
-die() {
18
- printf >&2 "fatal: %s\n" "$@"
19
- exit 1
20
-}
21
-
22
-# Get arguments
23
-
24
-test "$#" -eq "3" || die "This program must be passed exactly 3 arguments" "Usage: $USAGE"
25
-
26
-GX_PROGRAM_NAME="$1"
27
-GX_MIN_VERSION="$2"
28
-UPGRADE_MSG="$3"
29
-
30
-# Get path to the directory containing this file
31
-# If $0 has no slashes, uses "./"
32
-PREFIX=$(expr "$0" : "\(.*\/\)") || PREFIX='./'
33
-# Include the 'check_at_least_version' function
34
-. ${PREFIX}check_version
35
-
36
-# Check that the gx program exists
37
-
38
-type "$GX_PROGRAM_NAME" >/dev/null 2>&1 || die_upgrade "Program $GX_PROGRAM_NAME is not installed!"
39
-
40
-# Check the gx program version
41
-
42
-VERS_STR=$($GX_PROGRAM_NAME -v 2>&1) || die "'$GX_PROGRAM_NAME -v' failed with output: $VERS_STR"
43
-
44
-GX_CUR_VERSION=$(expr "$VERS_STR" : ".*$GX_PROGRAM_NAME.* version \(.*\)") || die "Invalid '$GX_PROGRAM_NAME -v' output: $VERS_STR"
45
-
46
-check_at_least_version "$GX_MIN_VERSION" "$GX_CUR_VERSION" "$GX_PROGRAM_NAME"
mk/golang.mk
-5
@@ -71,10 +71,5 @@ check_go_version:
71
.PHONY: check_go_version
72
DEPS_GO += check_go_version
73
74
-check_go_path:
75
- GOPATH="$(GOPATH)" bin/check_go_path github.com/ipfs/go-ipfs
76
-.PHONY: check_go_path
77
-DEPS_GO += check_go_path
78
-
74
TEST += $(TEST_GO)
75
TEST_SHORT += test_go_fmt test_go_short