summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-17 22:26:22 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-17 22:26:22 +0300
commitb20d8092a8b34f852351d7345951318a218e38c0 (patch)
treeacc2bb93b9a4ba99b4af9260345efd7741b0fb02 /tools
parentef9e8793c77683b46a99daf6a57ca05facc44752 (diff)
downloadplus-b20d8092a8b34f852351d7345951318a218e38c0.tar.gz
plus-b20d8092a8b34f852351d7345951318a218e38c0.tar.bz2
plus-b20d8092a8b34f852351d7345951318a218e38c0.tar.xz
plus-b20d8092a8b34f852351d7345951318a218e38c0.zip
Simplify ci scripts.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/ci/scripts/init.sh54
1 files changed, 14 insertions, 40 deletions
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