From 7df5b32834237eac4c338f0ce1cba65b86bbe642 Mon Sep 17 00:00:00 2001 From: Ken Cochrane Date: Tue, 29 Mar 2016 14:39:28 -0400 Subject: [PATCH] Change the directory inside of tgz files. Currently the directory inside of the tgz files is /usr/local/bin and this is causing some confusion, and problems with people who already have stuff in those directories. This commit changes the directory to /docker to help remove the confusion. Signed-off-by: Ken Cochrane --- hack/make/tgz | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/hack/make/tgz b/hack/make/tgz index 68ef207390..859266564a 100644 --- a/hack/make/tgz +++ b/hack/make/tgz @@ -19,15 +19,29 @@ for d in "$CROSS/"*/*; do mkdir -p "$DEST/$GOOS/$GOARCH" TGZ="$DEST/$GOOS/$GOARCH/$BINARY_NAME.tgz" - mkdir -p "$DEST/build/usr/local/bin" - cp -L "$d/$BINARY_FULLNAME" "$DEST/build/usr/local/bin/docker$BINARY_EXTENSION" - copy_containerd "$DEST/build/usr/local/bin/" + # The staging directory for the files in the tgz + BUILD_PATH="$DEST/build" - tar --numeric-owner --owner 0 -C "$DEST/build" -czf "$TGZ" usr + # The directory that is at the root of the tar file + TAR_BASE_DIRECTORY="docker" + + # $DEST/build/docker + TAR_PATH="$BUILD_PATH/$TAR_BASE_DIRECTORY" + + # Copy the correct docker binary + mkdir -p $TAR_PATH + cp -L "$d/$BINARY_FULLNAME" "$TAR_PATH/docker$BINARY_EXTENSION" + + # copy over all the containerd binaries + copy_containerd $TAR_PATH + + echo "Creating tgz from $BUILD_PATH and naming it $TGZ" + tar --numeric-owner --owner 0 -C "$BUILD_PATH" -czf "$TGZ" $TAR_BASE_DIRECTORY hash_files "$TGZ" - rm -rf "$DEST/build" + # cleanup after ourselves + rm -rf "$BUILD_PATH" echo "Created tgz: $TGZ" done