Browse code

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 <kencochrane@gmail.com>

Ken Cochrane authored on 2016/03/30 03:39:28
Showing 1 changed files
... ...
@@ -19,15 +19,29 @@ for d in "$CROSS/"*/*; do
19 19
 	mkdir -p "$DEST/$GOOS/$GOARCH"
20 20
 	TGZ="$DEST/$GOOS/$GOARCH/$BINARY_NAME.tgz"
21 21
 
22
-	mkdir -p "$DEST/build/usr/local/bin"
23
-	cp -L "$d/$BINARY_FULLNAME" "$DEST/build/usr/local/bin/docker$BINARY_EXTENSION"
24
-	copy_containerd "$DEST/build/usr/local/bin/"
22
+	# The staging directory for the files in the tgz
23
+	BUILD_PATH="$DEST/build"
25 24
 
26
-	tar --numeric-owner --owner 0 -C "$DEST/build" -czf "$TGZ" usr
25
+	# The directory that is at the root of the tar file
26
+	TAR_BASE_DIRECTORY="docker"
27
+
28
+	# $DEST/build/docker
29
+	TAR_PATH="$BUILD_PATH/$TAR_BASE_DIRECTORY"
30
+
31
+	# Copy the correct docker binary
32
+	mkdir -p $TAR_PATH
33
+	cp -L "$d/$BINARY_FULLNAME" "$TAR_PATH/docker$BINARY_EXTENSION"
34
+
35
+	# copy over all the containerd binaries
36
+	copy_containerd $TAR_PATH
37
+
38
+	echo "Creating tgz from $BUILD_PATH and naming it $TGZ"
39
+	tar --numeric-owner --owner 0 -C "$BUILD_PATH" -czf "$TGZ" $TAR_BASE_DIRECTORY
27 40
 
28 41
 	hash_files "$TGZ"
29 42
 
30
-	rm -rf "$DEST/build"
43
+	# cleanup after ourselves
44
+	rm -rf "$BUILD_PATH"
31 45
 
32 46
 	echo "Created tgz: $TGZ"
33 47
 done