From 3a14eb066cef537e52f96c6ad76adab2efe02e05 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Wed, 30 Jul 2014 17:02:04 -0600 Subject: [PATCH] Fix more instances of "dotcloud/docker" in hack/ (and add a DOCKER_PKG environment variable to simplify references to our "package path" in our bundlescripts) Docker-DCO-1.1-Signed-off-by: Andrew Page (github: tianon) --- hack/make.sh | 18 ++++++++++-------- hack/make/dynbinary | 2 +- hack/make/dyntest-integration | 2 +- hack/make/dyntest-unit | 2 +- hack/make/test-integration | 2 +- hack/make/test-unit | 2 +- 6 files changed, 15 insertions(+), 13 deletions(-) diff --git a/hack/make.sh b/hack/make.sh index ca3c775bfd..2d883cd883 100755 --- a/hack/make.sh +++ b/hack/make.sh @@ -23,9 +23,11 @@ set -e set -o pipefail +export DOCKER_PKG='github.com/docker/docker' + # We're a nice, sexy, little shell script, and people might try to run us; # but really, they shouldn't. We want to be in a container! -if [ "$(pwd)" != '/go/src/github.com/docker/docker' ] || [ -z "$DOCKER_CROSSPLATFORMS" ]; then +if [ "$(pwd)" != "/go/src/$DOCKER_PKG" ] || [ -z "$DOCKER_CROSSPLATFORMS" ]; then { echo "# WARNING! I don't seem to be running in the Docker container." echo "# The result of this command might be an incorrect build, and will not be" @@ -77,8 +79,8 @@ fi if [ "$AUTO_GOPATH" ]; then rm -rf .gopath - mkdir -p .gopath/src/github.com/docker - ln -sf ../../../.. .gopath/src/github.com/docker/docker + mkdir -p .gopath/src/"$(dirname "${DOCKER_PKG}")" + ln -sf ../../../.. .gopath/src/"${DOCKER_PKG}" export GOPATH="$(pwd)/.gopath:$(pwd)/vendor" fi @@ -91,8 +93,8 @@ fi # Use these flags when compiling the tests and final binary LDFLAGS=' -w - -X github.com/docker/docker/dockerversion.GITCOMMIT "'$GITCOMMIT'" - -X github.com/docker/docker/dockerversion.VERSION "'$VERSION'" + -X '$DOCKER_PKG'/dockerversion.GITCOMMIT "'$GITCOMMIT'" + -X '$DOCKER_PKG'/dockerversion.VERSION "'$VERSION'" ' LDFLAGS_STATIC='-linkmode external' EXTLDFLAGS_STATIC='-static' @@ -103,7 +105,7 @@ BUILDFLAGS=( -a -tags "netgo static_build $DOCKER_BUILDTAGS" ) EXTLDFLAGS_STATIC_DOCKER="$EXTLDFLAGS_STATIC -lpthread -Wl,--unresolved-symbols=ignore-in-object-files" LDFLAGS_STATIC_DOCKER=" $LDFLAGS_STATIC - -X github.com/docker/docker/dockerversion.IAMSTATIC true + -X $DOCKER_PKG/dockerversion.IAMSTATIC true -extldflags \"$EXTLDFLAGS_STATIC_DOCKER\" " @@ -150,7 +152,7 @@ go_test_dir() { testcover=( -cover -coverprofile "$coverprofile" $coverpkg ) fi ( - echo '+ go test' $TESTFLAGS "github.com/docker/docker${dir#.}" + echo '+ go test' $TESTFLAGS "${DOCKER_PKG}${dir#.}" cd "$dir" go test ${testcover[@]} -ldflags "$LDFLAGS" "${BUILDFLAGS[@]}" $TESTFLAGS ) @@ -178,7 +180,7 @@ go_compile_test_dir() { [ $? -ne 0 ] && return 1 mkdir -p "$(dirname "$out_file")" mv "$dir/$(basename "$dir").test" "$out_file" - echo "Precompiled: github.com/dotcloud/docker${dir#.}" + echo "Precompiled: ${DOCKER_PKG}${dir#.}" } # This helper function walks the current directory looking for directories diff --git a/hack/make/dynbinary b/hack/make/dynbinary index ca7cbdab07..5064a799bd 100644 --- a/hack/make/dynbinary +++ b/hack/make/dynbinary @@ -39,7 +39,7 @@ fi # exported so that "dyntest" can easily access it later without recalculating it ( - export LDFLAGS_STATIC_DOCKER="-X github.com/docker/docker/dockerversion.INITSHA1 \"$DOCKER_INITSHA1\" -X github.com/docker/docker/dockerversion.INITPATH \"$DOCKER_INITPATH\"" + export LDFLAGS_STATIC_DOCKER="-X $DOCKER_PKG/dockerversion.INITSHA1 \"$DOCKER_INITSHA1\" -X $DOCKER_PKG/dockerversion.INITPATH \"$DOCKER_INITPATH\"" export BUILDFLAGS=( "${BUILDFLAGS[@]/netgo /}" ) # disable netgo, since we don't need it for a dynamic binary source "$(dirname "$BASH_SOURCE")/binary" ) diff --git a/hack/make/dyntest-integration b/hack/make/dyntest-integration index 218b65a054..1cc7349aba 100644 --- a/hack/make/dyntest-integration +++ b/hack/make/dyntest-integration @@ -12,7 +12,7 @@ fi ( export TEST_DOCKERINIT_PATH="$INIT" export LDFLAGS_STATIC_DOCKER=" - -X github.com/docker/docker/dockerversion.INITSHA1 \"$DOCKER_INITSHA1\" + -X $DOCKER_PKG/dockerversion.INITSHA1 \"$DOCKER_INITSHA1\" " source "$(dirname "$BASH_SOURCE")/test-integration" ) diff --git a/hack/make/dyntest-unit b/hack/make/dyntest-unit index dfd84cb3b5..cffef98512 100644 --- a/hack/make/dyntest-unit +++ b/hack/make/dyntest-unit @@ -12,7 +12,7 @@ fi ( export TEST_DOCKERINIT_PATH="$INIT" export LDFLAGS_STATIC_DOCKER=" - -X github.com/docker/docker/dockerversion.INITSHA1 \"$DOCKER_INITSHA1\" + -X $DOCKER_PKG/dockerversion.INITSHA1 \"$DOCKER_INITSHA1\" " source "$(dirname "$BASH_SOURCE")/test-unit" ) diff --git a/hack/make/test-integration b/hack/make/test-integration index 9daa8a0a4e..b49ae595e2 100644 --- a/hack/make/test-integration +++ b/hack/make/test-integration @@ -5,7 +5,7 @@ DEST=$1 bundle_test_integration() { LDFLAGS="$LDFLAGS $LDFLAGS_STATIC_DOCKER" go_test_dir ./integration \ - "-coverpkg $(find_dirs '*.go' | sed 's,^\.,github.com/docker/docker,g' | paste -d, -s)" + "-coverpkg $(find_dirs '*.go' | sed 's,^\.,'$DOCKER_PKG',g' | paste -d, -s)" } # this "grep" hides some really irritating warnings that "go test -coverpkg" diff --git a/hack/make/test-unit b/hack/make/test-unit index 1ac3f4aa5b..03172f9eab 100644 --- a/hack/make/test-unit +++ b/hack/make/test-unit @@ -54,7 +54,7 @@ go_run_test_dir() { TESTS_FAILED=() while read dir; do echo - echo '+ go test' $TESTFLAGS "github.com/dotcloud/docker${dir#.}" + echo '+ go test' $TESTFLAGS "${DOCKER_PKG}${dir#.}" precompiled="$DEST/precompiled/$dir.test" if ! ( cd "$dir" && "$precompiled" ); then TESTS_FAILED+=("$dir")