diff options
author | Mattia Rizzolo <mattia@mapreri.org> | 2015-06-12 21:31:12 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-06-14 21:55:26 +0200 |
commit | 7fc7fb0c59266664b8c700e21859a7fbcc3d5052 (patch) | |
tree | a18c9e48228f06f39c2679208f88008cd5c8a502 /bin/reproducible_common.sh | |
parent | ed7f36ad6ac69972414ff11eea911a22a25d26f1 (diff) | |
download | jenkins.debian.net-7fc7fb0c59266664b8c700e21859a7fbcc3d5052.tar.xz |
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
Diffstat (limited to 'bin/reproducible_common.sh')
-rwxr-xr-x | bin/reproducible_common.sh | 6 |
1 files changed, 5 insertions, 1 deletions
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 |