Project

General

Profile

« Previous | Next » 

Revision 252

test/map: Changed to work on both nimoy and vegbiendev by selecting the appropriate MySQL user and password

View differences:

map
11 11
testMode=
12 12
test -n "$n" || export n="$tests_n" testMode=1
13 13

  
14
. ../util/env_password in_password
14
test "$(hostname)" = nimoy && isNimoy=t || isNimoy=
15
test -n "$isNimoy" && . ../util/env_password mysql_password "your MySQL"
16

  
15 17
bien_password="$(cat ../util/bien_password)"
16 18

  
17 19
make --directory=../../mappings
18

  
19 20
mkdir -p output
20 21

  
21 22
function trace()
......
34 35
    for map in "../../mappings/$src-$out_fmt."$table".csv"; do
35 36
        table="${map%.*}" # remove extension
36 37
        table="${table##*.}" # after last "."
37
        (
38
        {
38 39
            if test "$ext" == "sh"; then
39 40
                trace . "$in"
40
                (. "$in"; "$1")
41
                (
42
                    . "$in"
43
                    if test "$in_host" = localhost -a "$in_user" = bien; then
44
                        export in_password="$bien_password"
45
                        test -n "$isNimoy" -a "$in_engine" = MySQL && \
46
                            in_user="$USER" in_password="$mysql_password"
47
                    fi
48
                    "$1"
49
                )
41 50
            else
42 51
                (_in="$in"; trace)
43 52
                "$1" <"$in"
44 53
            fi
45
        ) || exit # abort tester
54
        } || exit # abort tester
46 55
    done
47 56
}
48 57

  

Also available in: Unified diff