Merge pull request #6349 from ipfs/fix/mk-source-tarball-tempdir

fix vendoring dependencies when building the source tarball
This commit is contained in:
Steven Allen 2019-05-20 09:17:09 -07:00 committed by GitHub
commit 501001ff79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,14 +13,14 @@ fi
GOCC=${GOCC=go}
TMPDIR="$(mktemp -d)"
cp -r . "$TMPDIR"
( cd "$TMPDIR" &&
TEMP="$(mktemp -d)"
cp -r . "$TEMP"
( cd "$TEMP" &&
echo $PWD &&
$GOCC mod vendor &&
(git describe --always --match=NeVeRmAtCh --dirty 2>/dev/null || true) > .tarball &&
chmod -R u=rwX,go=rX "$TMPDIR" # normalize permissions
chmod -R u=rwX,go=rX "$TEMP" # normalize permissions
tar -czf "$OUTPUT" --exclude="./.git" .
)
rm -rf "$TMPDIR"
rm -rf "$TEMP"