Closed richlowe closed 8 years ago
The "buildctl" script sources functions.sh (which sources config.sh). Each "build.sh" script ALSO sources functions.sh (which ALSO sources config.sh).
I've had similar problems before (look at the history of kayak's build.sh, e.g.), and I've addressed them this way:
if [[ -z $TMPDIR ]]; then
TMPDIR=/tmp/build_$USER
fi
Solving this way:
bloody(omnios-build/build)[1]% git diff
diff --git a/lib/config.sh b/lib/config.sh
index e1715d8..d68f229 100644
--- a/lib/config.sh
+++ b/lib/config.sh
@@ -43,7 +43,10 @@ PREFIX=/usr
# to avoid collision on shared build systems,
# TMPDIR includes a username
# DTMPDIR is used for constructing the DESTDIR path
-TMPDIR=/tmp/build_$USER
+# Let the environment override TMPDIR.
+if [[ -z $TMPDIR ]]; then
+ TMPDIR=/tmp/build_$USER
+fi
DTMPDIR=$TMPDIR
# Log file for all output
bloody(omnios-build/build)[0]%
Not all of us can put arbitrary build trees in
/tmp
successfully due to memory constraints. The build should honour$TMPDIR
so that we can use/var/tmp
or wherever else.Unfortunately the obvious diff
Doesn't work flawlessly, because config.sh is evaluated twice, so we end up with
/foo/build_richlowe/build_richlowe
.