Forráskód Böngészése

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

Tianon Gravi 11 éve
szülő
commit
ca405786f4
2 módosított fájl, 8 hozzáadás és 5 törlés
  1. 4 2
      hack/make/dynbinary
  2. 4 3
      hack/make/dyntest

+ 4 - 2
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"
+)

+ 4 - 3
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"
+)