Fix dependency installation script

The script generates files owned by root so it needs to be removed with
sudo. As the removal of the directory is the last command, its failure
causes the script to fail.
This commit is contained in:
Markus Mäkelä
2018-11-27 23:18:25 +02:00
parent 8f0a85fd46
commit 3047b8b4cf

View File

@ -139,7 +139,7 @@ git clone https://github.com/alanxz/rabbitmq-c.git
if [ $? != 0 ] if [ $? != 0 ]
then then
echo "Error cloning rabbitmq-c" echo "Error cloning rabbitmq-c"
rm -rf $tmpdir sudo rm -rf $tmpdir
exit 1 exit 1
fi fi
@ -157,7 +157,7 @@ wget -q --no-check-certificate http://prdownloads.sourceforge.net/tcl/tcl8.6.5-s
if [ $? != 0 ] if [ $? != 0 ]
then then
echo "Error getting tcl" echo "Error getting tcl"
rm -rf $tmpdir sudo rm -rf $tmpdir
exit 1 exit 1
fi fi
@ -173,7 +173,7 @@ git clone https://github.com/akheron/jansson.git
if [ $? != 0 ] if [ $? != 0 ]
then then
echo "Error cloning jansson" echo "Error cloning jansson"
rm -rf $tmpdir sudo rm -rf $tmpdir
exit 1 exit 1
fi fi
@ -191,7 +191,7 @@ wget -q -r -l1 -nH --cut-dirs=2 --no-parent -A.tar.gz --no-directories http://mi
if [ $? != 0 ] if [ $? != 0 ]
then then
echo "Error getting avro-c" echo "Error getting avro-c"
rm -rf $tmpdir sudo rm -rf $tmpdir
exit 1 exit 1
fi fi
avro_filename=`ls -1 avro*.tar.gz` avro_filename=`ls -1 avro*.tar.gz`
@ -209,4 +209,4 @@ 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 tar -axf node-v6.11.2-linux-x64.tar.xz
sudo cp -t /usr -r node-v6.11.2-linux-x64/* sudo cp -t /usr -r node-v6.11.2-linux-x64/*
rm -rf $tmpdir sudo rm -rf $tmpdir