From c58a98d4eac3ee55647b6aa551ca23c795885ae0 Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Wed, 15 Jan 2014 11:01:58 +0100 Subject: [PATCH] Add script name to temporary files. This allows to track down left-over temporary files to their sources. --- extract_storage_kernel+modules.sh | 2 +- liveboot-dbg-tar/create_debug_archive.sh | 2 +- liveboot_build.sh | 2 +- liveboot_gw_autotest.sh | 2 +- liveboot_pserver1301_deploy.sh | 2 +- liveboot_pserver_reset.sh | 2 +- liveboot_set_test_state.sh | 2 +- puppet_lint_run.sh | 2 +- pxe_install.sh | 2 +- pxe_riserver_setup.sh | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/extract_storage_kernel+modules.sh b/extract_storage_kernel+modules.sh index 3696aa9..b77494d 100755 --- a/extract_storage_kernel+modules.sh +++ b/extract_storage_kernel+modules.sh @@ -76,7 +76,7 @@ export TARGET_DIR=$TARGET_BASE/$TARGET_NAME/$BUILD_NUMBER export JOB_HOME=$JENKINS_HOME/jobs/$JOB_NAME/builds SCRIPTSDIR=$(dirname $0) -BUILD_SCRIPT=$(mktemp) +BUILD_SCRIPT=$(mktemp -t ${0##*/}.XXXXXXXXXX) cat > $BUILD_SCRIPT <<-EOF #/bin/bash set -e diff --git a/liveboot-dbg-tar/create_debug_archive.sh b/liveboot-dbg-tar/create_debug_archive.sh index 64cb22e..671377a 100755 --- a/liveboot-dbg-tar/create_debug_archive.sh +++ b/liveboot-dbg-tar/create_debug_archive.sh @@ -3,7 +3,7 @@ set -eux script_dir="$( cd "$( dirname "$0" )" && pwd )" -workdir="$(mktemp -d)" +workdir="$(mktemp -d -t ${0##*/}.XXXXXXXXXX)" liveboot_id="$LIVEBOOT_BUILD_NUMBER" assembledir="$workdir/liveboot-$liveboot_id-kernel-dbg" diff --git a/liveboot_build.sh b/liveboot_build.sh index 871a7f2..02bc3b2 100755 --- a/liveboot_build.sh +++ b/liveboot_build.sh @@ -32,7 +32,7 @@ export DIST=squeeze export PB_SUITE=production-proposed-updates SCRIPTSDIR=$(dirname $0) -BUILD_SCRIPT=$(mktemp) +BUILD_SCRIPT=$(mktemp -t ${0##*/}.XXXXXXXXXX) cat > $BUILD_SCRIPT <<-EOF cd /srv/build rm liveboot -rf diff --git a/liveboot_gw_autotest.sh b/liveboot_gw_autotest.sh index 1aeacdb..5f8159d 100755 --- a/liveboot_gw_autotest.sh +++ b/liveboot_gw_autotest.sh @@ -22,7 +22,7 @@ echo "AUTOTEST_CONFIG: ${AUTOTEST_CONFIG}" # # prepare ssh # -TMPFILE=$(mktemp) +TMPFILE=$(mktemp -t ${0##*/}.XXXXXXXXXX) ssh-agent > $TMPFILE source $TMPFILE ssh-add ~/.ssh/id_ritest diff --git a/liveboot_pserver1301_deploy.sh b/liveboot_pserver1301_deploy.sh index 36847fe..966f58e 100755 --- a/liveboot_pserver1301_deploy.sh +++ b/liveboot_pserver1301_deploy.sh @@ -114,7 +114,7 @@ echo # # add jenkins user and sudoers.d/jenkins for it # -TMPFILE=$(mktemp) +TMPFILE=$(mktemp -t ${0##*/}.XXXXXXXXXX) cat > $TMPFILE <<-EOF addgroup --system jenkins adduser --system --home /home/jenkins --shell /bin/bash --ingroup jenkins --disabled-password --gecos "Profitbricks jenkins user" jenkins diff --git a/liveboot_pserver_reset.sh b/liveboot_pserver_reset.sh index 3789b0d..7da7b14 100755 --- a/liveboot_pserver_reset.sh +++ b/liveboot_pserver_reset.sh @@ -72,7 +72,7 @@ echo # # add jenkins user and sudoers.d/jenkins for it # -TMPFILE=$(mktemp) +TMPFILE=$(mktemp -t ${0##*/}.XXXXXXXXXX) cat > $TMPFILE <<-EOF addgroup --system jenkins adduser --system --home /home/jenkins --shell /bin/bash --ingroup jenkins --disabled-password --gecos "Profitbricks jenkins user" jenkins diff --git a/liveboot_set_test_state.sh b/liveboot_set_test_state.sh index 7d25cef..a0d793d 100755 --- a/liveboot_set_test_state.sh +++ b/liveboot_set_test_state.sh @@ -21,7 +21,7 @@ then fi # Checkout liveboot repo -BUILD_SCRIPT=$(mktemp) +BUILD_SCRIPT=$(mktemp -t ${0##*/}.XXXXXXXXXX) cat > $BUILD_SCRIPT <<-EOF cd /srv/build rm /srv/build/liveboot_test_state -rf diff --git a/puppet_lint_run.sh b/puppet_lint_run.sh index 141442e..d977ce9 100755 --- a/puppet_lint_run.sh +++ b/puppet_lint_run.sh @@ -1,7 +1,7 @@ #!/bin/bash # copyright 2012 Holger Levsen GPL2 licenced, holger@layer-acht.org -OUTPUT=$(mktemp) +OUTPUT=$(mktemp -t ${0##*/}.XXXXXXXXXX) for file in $(find . -iname '*.pp') ; do echo -n "parsing $file: " diff --git a/pxe_install.sh b/pxe_install.sh index 239f08d..db66033 100755 --- a/pxe_install.sh +++ b/pxe_install.sh @@ -72,7 +72,7 @@ echo "successfully installed" # # prepare ssh # -TMPFILE=$(mktemp) +TMPFILE=$(mktemp -t ${0##*/}.XXXXXXXXXX) ssh-agent > $TMPFILE source $TMPFILE ssh-add ~/.ssh/id_ritest diff --git a/pxe_riserver_setup.sh b/pxe_riserver_setup.sh index d07f2c2..340768e 100755 --- a/pxe_riserver_setup.sh +++ b/pxe_riserver_setup.sh @@ -28,7 +28,7 @@ echo echo echo -TMPFILE=$(mktemp) +TMPFILE=$(mktemp -t ${0##*/}.XXXXXXXXXX) cat > $TMPFILE <<-EOF # Generated automatically by jenkins - don't edit manually, it will be overwritten TIMEOUT 100 -- 2.39.5