aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Ferrell <major@homeonderanged.org>2012-07-10 09:04:06 -0500
committerMark Ferrell <major@homeonderanged.org>2012-07-10 09:04:06 -0500
commit81ea40d667d283f08008e8e4df393eb1e3d39500 (patch)
tree578148fdc110f1049b6f083c3c8c692ea83001cd
parent38d5f499671cf86f05e8daa152671c9b9ce1042b (diff)
Make BUILDER_TMPDIR less of a hassle.
* Changed the BUILDER_TMPDIR to based on ${TMPDIR}. This seems a more appropriate way to go and doesn't require any special privs to setup a build environment to use tmpfs on platforms which support it.
-rwxr-xr-xscripts/build12
1 files changed, 11 insertions, 1 deletions
diff --git a/scripts/build b/scripts/build
index c6f32e2..03b4259 100755
--- a/scripts/build
+++ b/scripts/build
@@ -212,8 +212,18 @@ BUILDER_TOPDIR="${TOPDIR}"
BUILDER_PKGDIR="${TOPDIR}/packages"
BUILDER_SRCDIR="${TOPDIR}/sources"
BUILDER_ATFDIR="${TOPDIR}/artifacts"
-BUILDER_TMPDIR="${TOPDIR}/tmp"
BUILDER_LIBDIR="${TOPDIR}/scripts/builder"
+
+BUILDER_TMPDIR=
+for dir in "${TMP}" "${TMPDIR}" "/tmp"; do
+ if test -d "${dir}"; then
+ BUILDER_TMPDIR="${dir}/.builder_${USER}"
+ if ! test -d "${BUILDER_TMPDIR}"; then
+ mkdir -p "${BUILDER_TMPDIR}"
+ fi
+ fi
+done
+
export BUILDER_CFGDIR BUILDER_PKGDIR BUILDER_SRCDIR
export BUILDER_ATFDIR BUILDER_LIBDIR BUILDER_TOPDIR
export BUILDER_TMPDIR