source: branches/help/SH/arb_macro_compatibility.sh

Last change on this file was 18339, checked in by westram, 5 years ago
  • Property svn:executable set to *
File size: 960 bytes
Line 
1#!/bin/bash
2#
3# called from arb after startup.
4# tests if perl code works.
5# if not -> signal problem via arb_message.
6
7show_error() {
8    local TEXT=$*
9    arb_message "${TEXT}"
10    false
11}
12
13something_wrong_with_perl() {
14    show_error "Incompatibility detected between installed arb build and perl version:\n" \
15               "* arb macro playback will not work and\n" \
16               "* other arb perl scripts wont work either."
17}
18
19main() {
20    if [ -d "${ARBHOME}" ]; then
21        # -> ../PERL_SCRIPTS/ARBTOOLS/TESTS/automatic.pl
22        local TESTSCRIPT=${ARBHOME}/PERL_SCRIPTS/ARBTOOLS/TESTS/automatic.pl
23        if [ -x ${TESTSCRIPT} ]; then
24            local TESTCALL="${TESTSCRIPT} -db ${ARBHOME}/demo.arb -client arb"
25            ${TESTCALL} || something_wrong_with_perl
26        else
27            show_error "not executable: '${TESTSCRIPT}'"
28        fi
29    else
30        echo "incorrect value: \$ARBHOME (='${ARBHOME}')"
31        false
32    fi
33}
34
35main
Note: See TracBrowser for help on using the repository browser.