@cryptotaxi247 / kubo / commits / 8d857bab3

fix vendoring dependencies when building the source tarball

TMPDIR is a special variable indicating the _system_ temporary directory root. Unfortunately, go refuses to honor `go.mod` files in this directory to prevent random `/tmp/go.mod` files from messing with modules cloned into `/tmp`. The fix is simple: rename TMPDIR to TEMP.

Steven Allen committed May 17, 2019 at 12:34 UTC 8d857bab3e0126805dc51fd1babde9def5e8a2ff
1 file changed +5 -5
bin/maketarball.sh
+5 -5
@@ -13,14 +13,14 @@ fi
13
14 GOCC=${GOCC=go}
15
16 -TMPDIR="$(mktemp -d)"
17 -cp -r . "$TMPDIR"
18 -( cd "$TMPDIR" &&
16 +TEMP="$(mktemp -d)"
17 +cp -r . "$TEMP"
18 +( cd "$TEMP" &&
19 echo $PWD &&
20 $GOCC mod vendor &&
21 (git describe --always --match=NeVeRmAtCh --dirty 2>/dev/null || true) > .tarball &&
22 - chmod -R u=rwX,go=rX "$TMPDIR" # normalize permissions
22 + chmod -R u=rwX,go=rX "$TEMP" # normalize permissions
23 tar -czf "$OUTPUT" --exclude="./.git" .
24 )
25
26 -rm -rf "$TMPDIR"
26 +rm -rf "$TEMP"