summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-06-12 19:52:00 -0600
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-06-16 22:12:40 -0600
commit9ea7be252eb359fa8d42eb74897b216158736f56 (patch)
tree034eb1a4a096f208a3db19db3dc88f41aedfd318
parent5ba4756a52e8f1280d4dbcff62dec4a4aeb47d1c (diff)
fix TMPDIR
-rw-r--r--db-functions2
-rw-r--r--test/lib/common.inc17
2 files changed, 14 insertions, 5 deletions
diff --git a/db-functions b/db-functions
index 4029abf..01629bc 100644
--- a/db-functions
+++ b/db-functions
@@ -16,7 +16,7 @@ restore_umask () {
}
# set up general environment
-WORKDIR=$(mktemp -d "${TMPDIR}/${0##*/}.XXXXXXXXXX")
+WORKDIR=$(mktemp -dt "${0##*/}.XXXXXXXXXX")
if [ -n "${SVNUSER}" ]; then
setfacl -m u:"${SVNUSER}":rwx "${WORKDIR}"
setfacl -m d:u:"${USER}":rwx "${WORKDIR}"
diff --git a/test/lib/common.inc b/test/lib/common.inc
index 2d6140f..bf9d28e 100644
--- a/test/lib/common.inc
+++ b/test/lib/common.inc
@@ -1,8 +1,16 @@
set -E
-. "$(dirname ${BASH_SOURCE[0]})/../../config"
# override the default TMPDIR
-TMPDIR="$(mktemp -d /tmp/${0##*/}.XXXXXXXXXX)"
+init_tmpdir() {
+ [[ -n $MASTER_TMPDIR ]] || export MASTER_TMPDIR="$(mktemp -dqt ${0##*/}.XXXXXXXXXX)"
+ export TMPDIR=$MASTER_TMPDIR
+}
+
+_TMPDIR=$TMPDIR
+. "$(dirname ${BASH_SOURCE[0]})/../../config"
+TMPDIR=$_TMPDIR
+init_tmpdir
+
. "$(dirname ${BASH_SOURCE[0]})/../../db-functions"
arches() (
@@ -35,7 +43,7 @@ oneTimeSetUp() {
local pkgarch
local pkgversion
local build
- pkgdir="$(mktemp -d /tmp/${0##*/}.XXXXXXXXXX)"
+ pkgdir="$(mktemp -dqt ${0##*/}.XXXXXXXXXX)"
cp -Lr $(dirname ${BASH_SOURCE[0]})/../packages/* "${pkgdir}"
msg 'Building packages...'
for d in "${pkgdir}"/*; do
@@ -82,7 +90,8 @@ setUp() {
local a
[ -f "$(dirname ${BASH_SOURCE[0]})/../../config.local" ] && die "$(dirname ${BASH_SOURCE[0]})/../../config.local exists"
- TMP="$(mktemp -d /tmp/${0##*/}.XXXXXXXXXX)"
+ init_tmpdir
+ TMP="$(mktemp -dqt ${0##*/}.XXXXXXXXXX)"
#msg "Using ${TMP}"
PKGREPOS=('core' 'extra' 'testing')