From 8157bab5922bc3af751bc4c8c98878bd52042dad Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Sun, 8 Dec 2013 18:40:05 -0700 Subject: [PATCH] Unify dyntest/test and dynbinary/binary hack bundlescripts further by cross-invocation and keeping all the logic in one place, taking advantage of LDFLAGS_STATIC that is the only bit that gets replaced for dyntest/dynbinary Upstream-commit: ca405786f468a18859684dc13d43a293d47b89bd Component: engine --- components/engine/hack/make/dynbinary | 6 ++++-- components/engine/hack/make/dyntest | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/components/engine/hack/make/dynbinary b/components/engine/hack/make/dynbinary index 96ce482674..100c00eed5 100644 --- a/components/engine/hack/make/dynbinary +++ b/components/engine/hack/make/dynbinary @@ -11,5 +11,7 @@ ln -sf dockerinit-$VERSION $DEST/dockerinit export DOCKER_INITSHA1="$(sha1sum $DEST/dockerinit-$VERSION | cut -d' ' -f1)" # exported so that "dyntest" can easily access it later without recalculating it -go build -o $DEST/docker-$VERSION -ldflags "$LDFLAGS -X github.com/dotcloud/docker/utils.INITSHA1 \"$DOCKER_INITSHA1\"" $BUILDFLAGS ./docker -echo "Created binary: $DEST/docker-$VERSION" +( + export LDFLAGS_STATIC="-X github.com/dotcloud/docker/utils.INITSHA1 \"$DOCKER_INITSHA1\"" + source "$(dirname "$BASH_SOURCE")/binary" +) diff --git a/components/engine/hack/make/dyntest b/components/engine/hack/make/dyntest index cea3ba4e06..eb5c2b73ed 100644 --- a/components/engine/hack/make/dyntest +++ b/components/engine/hack/make/dyntest @@ -10,7 +10,8 @@ if [ ! -x "$INIT" ]; then false fi -export TEST_DOCKERINIT_PATH="$INIT" - -LDFLAGS_STATIC="-X github.com/dotcloud/docker/utils.INITSHA1 \"$DOCKER_INITSHA1\"" \ +( + export TEST_DOCKERINIT_PATH="$INIT" + export LDFLAGS_STATIC="-X github.com/dotcloud/docker/utils.INITSHA1 \"$DOCKER_INITSHA1\"" source "$(dirname "$BASH_SOURCE")/test" +)