From: Thomas Graf Date: Tue, 26 Aug 2014 10:24:04 +0000 (+0200) Subject: build: Use errtrace to simplify travis-ci failure detection X-Git-Tag: v2.4.0~1580 X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Fovs.git;a=commitdiff_plain;h=de0ae686654559644f91d5100d1026dd2c51ca67 build: Use errtrace to simplify travis-ci failure detection Causes the build script to fail if any command inside the script returns nonzero. Signed-off-by: Thomas Graf Signed-off-by: Ben Pfaff --- diff --git a/.travis/build.sh b/.travis/build.sh index e9bb9e26f..a9e565830 100755 --- a/.travis/build.sh +++ b/.travis/build.sh @@ -1,40 +1,37 @@ #!/bin/bash +set -o errexit + KERNELSRC="" function install_kernel() { - wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.7.tar.gz \ - && tar xzvf linux-3.14.7.tar.gz > /dev/null \ - && cd linux-3.14.7 \ - && make allmodconfig \ - && make net/openvswitch/ \ - && KERNELSRC=$(pwd) \ - && echo "Installed kernel source in $(pwd)" \ - && cd .. - - [ $? != 0 ] && exit 1 + wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.7.tar.gz + tar xzvf linux-3.14.7.tar.gz > /dev/null + cd linux-3.14.7 + make allmodconfig + make net/openvswitch/ + KERNELSRC=$(pwd) + echo "Installed kernel source in $(pwd)" + cd .. } function install_dpdk() { - wget http://www.dpdk.org/browse/dpdk/snapshot/dpdk-1.7.0.tar.gz \ - && tar xzvf dpdk-1.7.0.tar.gz > /dev/null \ - && cd dpdk-1.7.0 \ - && find ./ -type f | xargs sed -i 's/max-inline-insns-single=100/max-inline-insns-single=400/' \ - && make config CC=gcc T=x86_64-native-linuxapp-gcc \ - && make CC=gcc RTE_KERNELDIR=$KERNELSRC \ - && sudo make install CC=gcc T=x86_64-native-linuxapp-gcc RTE_KERNELDIR=$KERNELSRC \ - && echo "Installed DPDK source in $(pwd)" \ - && cd .. - - [ $? != 0 ] && exit 1 + wget http://www.dpdk.org/browse/dpdk/snapshot/dpdk-1.7.0.tar.gz + tar xzvf dpdk-1.7.0.tar.gz > /dev/null + cd dpdk-1.7.0 + find ./ -type f | xargs sed -i 's/max-inline-insns-single=100/max-inline-insns-single=400/' + make config CC=gcc T=x86_64-native-linuxapp-gcc + make CC=gcc RTE_KERNELDIR=$KERNELSRC + sudo make install CC=gcc T=x86_64-native-linuxapp-gcc RTE_KERNELDIR=$KERNELSRC + echo "Installed DPDK source in $(pwd)" + cd .. } function configure_ovs() { ./boot.sh && ./configure $* - [ $? != 0 ] && exit 1 } if [ "$KERNEL" ] || [ "$DPDK" ]; then @@ -48,7 +45,7 @@ configure_ovs $* if [ $CC = "clang" ]; then make CFLAGS="-Werror -Wno-error=unused-command-line-argument" else - make CFLAGS="-Werror" C=1 || exit 1 + make CFLAGS="-Werror" C=1 [ "$TESTSUITE" ] && make check fi