From b20d8092a8b34f852351d7345951318a218e38c0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 17 Apr 2016 22:26:22 +0300 Subject: Simplify ci scripts. --- tools/ci/scripts/init.sh | 54 +++++++++++++----------------------------------- 1 file changed, 14 insertions(+), 40 deletions(-) (limited to 'tools/ci') diff --git a/tools/ci/scripts/init.sh b/tools/ci/scripts/init.sh index 5db38aa02..77b72f36e 100755 --- a/tools/ci/scripts/init.sh +++ b/tools/ci/scripts/init.sh @@ -39,22 +39,20 @@ function aptget_install { fi } -function run_configure_simple { - rm $ERRFILE - autoreconf -i 2>$ERRFILE - result=$? - if [ "$result" != 0 ]; then +function check_error { + if [ "$1" != 0 ]; then cat $ERRFILE exit $result fi +} +function run_configure_simple { + rm $ERRFILE + autoreconf -i 2>$ERRFILE + check_error $? rm $ERRFILE ./configure $* 2>$ERRFILE - result=$? - if [ "$result" != 0 ]; then - cat $ERRFILE - exit $result - fi + check_error $? } function run_configure { @@ -63,42 +61,26 @@ function run_configure { rm $ERRFILE cd po make update-gmo 2>$ERRFILE - result=$? - if [ "$result" != 0 ]; then - cat $ERRFILE - exit $result - fi + check_error $? cd .. rm $ERRFILE cd po make update-po 2>$ERRFILE - result=$? - if [ "$result" != 0 ]; then - cat $ERRFILE - exit $result - fi + check_error $? cd .. } function run_cmake { rm $ERRFILE cmake . 2>$ERRFILE - result=$? - if [ "$result" != 0 ]; then - cat $ERRFILE - exit $result - fi + check_error $? } function run_make { rm $ERRFILE make -j2 V=0 $* 2>$ERRFILE - result=$? - if [ "$result" != 0 ]; then - cat $ERRFILE - exit $result - fi + check_error $? } function run_check_warnings { @@ -124,11 +106,7 @@ function run_h { function run_tarball { rm $ERRFILE make dist-xz 2>$ERRFILE - result=$? - if [ "$result" != 0 ]; then - cat $ERRFILE - exit $result - fi + check_error $? mkdir $1 cd $1 @@ -139,11 +117,7 @@ function run_tarball { function run_mplint { rm $ERRFILE mplint/src/mplint $* >$ERRFILE - result=$? - if [ "$result" != 0 ]; then - cat $ERRFILE - exit $result - fi + check_error $? } aptget_update -- cgit v1.2.3-70-g09d2