From f849e2c414622a8e5ec7a53a47e0fe19ebbf43b5 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Tue, 31 Jan 2017 11:30:54 +0400 Subject: [PATCH] copy instead of move (Fixes #385) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` mv: cannot move ‘./build/dist/windows_386.zip’ to ‘./build/dist/tendermint_0.8.0_windows_386.zip’: Permission denied ``` --- scripts/dist.sh | 6 ++++-- scripts/dist_build.sh | 11 ++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/scripts/dist.sh b/scripts/dist.sh index 8da29299a..14f0fef12 100755 --- a/scripts/dist.sh +++ b/scripts/dist.sh @@ -31,9 +31,11 @@ docker build -t tendermint/tendermint-builder scripts/tendermint-builder/ docker run --rm -e "BUILD_TAGS=$BUILD_TAGS" -v "$(pwd)":/go/src/github.com/tendermint/tendermint tendermint/tendermint-builder ./scripts/dist_build.sh # Add "tendermint" and $VERSION prefix to package name. -for FILENAME in $(find ./build/dist -mindepth 1 -maxdepth 1 -type f); do +rm -rf ./build/dist +mkdir -p ./build/dist +for FILENAME in $(find ./build/pkg -mindepth 1 -maxdepth 1 -type f); do FILENAME=$(basename "$FILENAME") - mv "./build/dist/${FILENAME}" "./build/dist/tendermint_${VERSION}_${FILENAME}" + cp "./build/pkg/${FILENAME}" "./build/dist/tendermint_${VERSION}_${FILENAME}" done # Make the checksums. diff --git a/scripts/dist_build.sh b/scripts/dist_build.sh index 947a3202b..f75faee58 100755 --- a/scripts/dist_build.sh +++ b/scripts/dist_build.sh @@ -20,8 +20,8 @@ XC_OS=${XC_OS:-"solaris darwin freebsd linux windows"} # Delete the old dir echo "==> Removing old directory..." -rm -rf build/dist/* -mkdir -p build/dist +rm -rf build/pkg +mkdir -p build/pkg # Make sure build tools are available. make tools @@ -36,13 +36,13 @@ echo "==> Building..." -arch="${XC_ARCH}" \ -osarch="!darwin/arm !solaris/amd64 !freebsd/amd64" \ -ldflags "-X ${GIT_IMPORT}.GitCommit='${GIT_COMMIT}' -X ${GIT_IMPORT}.GitDescribe='${GIT_DESCRIBE}'" \ - -output "build/dist/{{.OS}}_{{.Arch}}/tendermint" \ + -output "build/pkg/{{.OS}}_{{.Arch}}/tendermint" \ -tags="${BUILD_TAGS}" \ github.com/tendermint/tendermint/cmd/tendermint # Zip all the files. echo "==> Packaging..." -for PLATFORM in $(find ./build/dist -mindepth 1 -maxdepth 1 -type d); do +for PLATFORM in $(find ./build/pkg -mindepth 1 -maxdepth 1 -type d); do OSARCH=$(basename "${PLATFORM}") echo "--> ${OSARCH}" @@ -51,7 +51,4 @@ for PLATFORM in $(find ./build/dist -mindepth 1 -maxdepth 1 -type d); do popd >/dev/null 2>&1 done -# Remove build/dist/{{.OS}}_{{.Arch}} directories. -rm -rf build/dist/*/ - exit 0