Commit ffebfac8 authored by Rohit Gupta's avatar Rohit Gupta

Merge branch 'bugfix-96-Fix-build-script-for-16.04-installation-v3' of...

Merge branch 'bugfix-96-Fix-build-script-for-16.04-installation-v3' of https://gitlab.eurecom.fr/oai/openairinterface5g into bugfix-96-Fix-build-script-for-16.04-installation-v3
parents f7d81519 9624232f
...@@ -95,6 +95,18 @@ check_supported_distribution() { ...@@ -95,6 +95,18 @@ check_supported_distribution() {
return 1 return 1
} }
##################
# Error handlers #
##################
handler_EXIT() {
local exit_code=$?
[ "$exit_code" -eq 0 ] || echo_error "build have failed"
exit $exit_code
}
trap handler_EXIT EXIT
########################### ###########################
# Cleaners # Cleaners
########################### ###########################
...@@ -136,6 +148,7 @@ clean_all_files() { ...@@ -136,6 +148,7 @@ clean_all_files() {
compilations() { compilations() {
cd $OPENAIR_DIR/cmake_targets/$1/build cd $OPENAIR_DIR/cmake_targets/$1/build
echo_info "Log file for compilation written in: $dlog/$2.$REL.txt" echo_info "Log file for compilation written in: $dlog/$2.$REL.txt"
set +e
{ {
rm -f $3 rm -f $3
if [ "$VERBOSE_COMPILE" == "1" ]; then if [ "$VERBOSE_COMPILE" == "1" ]; then
...@@ -145,12 +158,14 @@ compilations() { ...@@ -145,12 +158,14 @@ compilations() {
fi fi
} > $dlog/$2.$REL.txt 2>&1 } > $dlog/$2.$REL.txt 2>&1
set -e
echo_info "Log file for compilation has been written to: $dlog/$2.$REL.txt" echo_info "Log file for compilation has been written to: $dlog/$2.$REL.txt"
if [ -s $3 ] ; then if [ -s $3 ] ; then
cp $3 $4 cp $3 $4
echo_success "$2 compiled" echo_success "$2 compiled"
else else
echo_error "$2 compilation failed" echo_error "$2 compilation failed"
exit 1
fi fi
} }
...@@ -213,7 +228,8 @@ install_gnutls_from_source(){ ...@@ -213,7 +228,8 @@ install_gnutls_from_source(){
check_install_usrp_uhd_driver(){ check_install_usrp_uhd_driver(){
#first we remove old installation #first we remove old installation
$SUDO apt-get remove uhd libuhd-dev libuhd003 uhd-host -y $SUDO apt-get remove -y uhd || true
$SUDO apt-get remove libuhd-dev libuhd003 uhd-host -y
v=$(lsb_release -cs) v=$(lsb_release -cs)
$SUDO apt-add-repository --remove "deb http://files.ettus.com/binaries/uhd/repo/uhd/ubuntu/$v $v main" $SUDO apt-add-repository --remove "deb http://files.ettus.com/binaries/uhd/repo/uhd/ubuntu/$v $v main"
#The new USRP repository #The new USRP repository
...@@ -270,8 +286,7 @@ check_install_additional_tools (){ ...@@ -270,8 +286,7 @@ check_install_additional_tools (){
android-tools-adb \ android-tools-adb \
wvdial \ wvdial \
python-numpy \ python-numpy \
sshpass \ sshpass
libxslt1-dev
$SUDO pip install paramiko $SUDO pip install paramiko
$SUDO pip install pyroute2 $SUDO pip install pyroute2
...@@ -355,6 +370,7 @@ check_install_oai_software() { ...@@ -355,6 +370,7 @@ check_install_oai_software() {
libusb-1.0-0-dev \ libusb-1.0-0-dev \
libxml2 \ libxml2 \
libxml2-dev \ libxml2-dev \
libxslt1-dev \
linux-headers-`uname -r` \ linux-headers-`uname -r` \
mscgen \ mscgen \
octave \ octave \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment