From 7fc7fb0c59266664b8c700e21859a7fbcc3d5052 Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Fri, 12 Jun 2015 21:31:12 +0200 Subject: reproducible: define $TEMPDIR as /tmp/reproducible and teach all the to create temporary files under TEMPDIR (except for builders, they have their own TMPDIR), to avoid polluting /tmp --- bin/reproducible_common.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'bin/reproducible_common.sh') diff --git a/bin/reproducible_common.sh b/bin/reproducible_common.sh index 75f32c3a..2b0ad523 100755 --- a/bin/reproducible_common.sh +++ b/bin/reproducible_common.sh @@ -53,6 +53,10 @@ declare -A SPOKENTARGET BASE="/var/lib/jenkins/userContent/reproducible" mkdir -p "$BASE" +# to hold reproducible temporary files/directories without polluting /tmp +TEMPDIR="/tmp/reproducible" +mkdir -p "$TMPDIR" + # create subdirs for suites for i in $SUITES ; do mkdir -p "$BASE/$i" @@ -95,7 +99,7 @@ schedule_packages() { HOURS=$(echo "$(date +'%H')*2"|bc) MINS=$(date +'%M') # schedule on the full hour so we can recognize them easily DATE=$(date +'%Y-%m-%d %H:%M' -d "$DAYS day ago - $HOURS hours - $MINS minutes") - TMPFILE=$(mktemp) + TMPFILE=$(mktemp --tmpdir=$TEMPDIR) for PKG_ID in $@ ; do echo "REPLACE INTO schedule (package_id, date_scheduled, date_build_started, save_artifacts, notify) VALUES ('$PKG_ID', '$DATE', '', '$ARTIFACTS', '$NOTIFY');" >> $TMPFILE done -- cgit v1.2.3-54-g00ecf