Install dependencies in a temporary directory

Doing the dependency installation in a temporary directory prevents the
pollution of the current working directory.
This commit is contained in:
Markus Mäkelä 2018-11-26 17:56:33 +02:00
parent a15aab610a
commit c372bd8985
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -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