Index: /bootstrap_libs
===================================================================
--- /bootstrap_libs	(revision 9743)
+++ /bootstrap_libs	(revision 9744)
@@ -1,3 +1,14 @@
-#!/bin/sh
+#!/bin/bash
+
+function catch_errors() {
+   echo "Script aborted, because an unexpected error occured.";
+   exit 1;
+}
+
+if [ ! `which wget` ]; then
+ echo "You need wget for this script. Please install it first, e.g., sudo apt-get install wget. Aborted."
+ exit 1
+fi
+
 mkdir build
 
@@ -6,4 +17,11 @@
 mkdir libs
 cd libs
+
+# now set the error trap so that re-running the script doesn't fail
+# on previous directory commands...
+# this will trap any subsequent errors or commands with non-zero exit status
+# by calling function catch_errors()
+trap catch_errors ERR;
+
 
 # apache runtime
@@ -34,15 +52,18 @@
 
 # boost 1.39.0
-wget http://switch.dl.sourceforge.net/sourceforge/boost/boost_1_39_0.tar.gz
-tar xvvzf boost_1_39_0.tar.gz
-cd boost_1_39_0
-./bootstrap.sh --libdir=$PREFIX/lib --prefix=$PREFIX --with-libraries=date_time,system,thread,test,regex
+boostpkg=boost_1_39_0
+wget http://downloads.sourceforge.net/sourceforge/boost/${boostpkg}.tar.gz || { echo "** Failed to retrieve ${boostpkg}. Please check network connectivity or availability of the package on the server. Stop."; exit 1; }
+echo -n "Unpacking ${boostpkg}... " &&  tar xzf ${boostpkg}.tar.gz && echo " done."
+cd ${boostpkg}
+echo -n "Calling bootstrap.sh ... " && ./bootstrap.sh --libdir=$PREFIX/lib --prefix=$PREFIX --with-libraries="date_time,system,thread,test,regex" >/dev/null && echo " done."
+echo "Calling bjam. This may take a while..."
 ./bjam install
 cd ..
 
 # gnu multiprecision library
-wget ftp://ftp.gmplib.org/pub/gmp-4.3.1/gmp-4.3.1.tar.gz
-tar xvvzf gmp-4.3.1.tar.gz
-cd gmp-4.3.1 
+gmppkg=gmp-4.3.1
+wget ftp://ftp.gmplib.org/pub/${gmppkg}/${gmppkg}.tar.gz || { echo "** Failed to retrieve ${gmppkg}. Please check network connectivity or availability of the package on the server. Stop."; exit 1; }
+echo -n "Unpacking ${gmppkg}... " &&  tar xzf ${gmppkg}.tar.gz  && echo " done."
+cd ${gmppkg}
 ./configure --prefix=$PREFIX
 make && make install 
@@ -53,3 +74,7 @@
 make && make install
 
+echo "Done."
+
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PREFIX/lib
+
+# end of script
