From c372bd89851bbed0cb424e3327096a05f150789f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Mon, 26 Nov 2018 17:56:33 +0200 Subject: [PATCH] Install dependencies in a temporary directory Doing the dependency installation in a temporary directory prevents the pollution of the current working directory. --- BUILD/install_build_deps.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/BUILD/install_build_deps.sh b/BUILD/install_build_deps.sh index a600ce372..beac9fa0c 100755 --- a/BUILD/install_build_deps.sh +++ b/BUILD/install_build_deps.sh @@ -3,6 +3,10 @@ # Do the real building work. This script is executed on build VM and # requires a working installation of CMake. +# Build in a temp directory so we don't pollute cwd +tmpdir=$(mktemp -d) + +cd $tmpdir command -v apt-get @@ -135,6 +139,7 @@ git clone https://github.com/alanxz/rabbitmq-c.git if [ $? != 0 ] then echo "Error cloning rabbitmq-c" + rm -rf $tmpdir exit 1 fi @@ -152,6 +157,7 @@ wget -q --no-check-certificate http://prdownloads.sourceforge.net/tcl/tcl8.6.5-s if [ $? != 0 ] then echo "Error getting tcl" + rm -rf $tmpdir exit 1 fi @@ -167,6 +173,7 @@ git clone https://github.com/akheron/jansson.git if [ $? != 0 ] then echo "Error cloning jansson" + rm -rf $tmpdir exit 1 fi @@ -184,6 +191,7 @@ wget -q -r -l1 -nH --cut-dirs=2 --no-parent -A.tar.gz --no-directories http://mi if [ $? != 0 ] then echo "Error getting avro-c" + rm -rf $tmpdir exit 1 fi avro_filename=`ls -1 avro*.tar.gz` @@ -200,3 +208,5 @@ popd wget --quiet https://nodejs.org/dist/v6.11.2/node-v6.11.2-linux-x64.tar.xz tar -axf node-v6.11.2-linux-x64.tar.xz sudo cp -t /usr -r node-v6.11.2-linux-x64/* + +rm -rf $tmpdir