| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | |
| 3 | failscip-shell shell shell-project 0.0.0 fail().() |
| 4 | { |
| 5 | [scip-shell system . . `[`. -n "$1" ] && echoscip-shell system . . echo. "$1" |
| 6 | exit 2 |
| 7 | } |
| 8 | |
| 9 | generatescip-shell shell shell-project 0.0.0 generate().() { |
| 10 | local ver= |
| 11 | |
| 12 | while IFS= read -r line; do |
| 13 | local len=${#line} |
| 14 | |
| 15 | |
| 16 | if [scip-shell system . . `[`. "${line:0:11}" = "CRYPTSETUP_" ]; then |
| 17 | local i=12 |
| 18 | while [scip-shell system . . `[`. $i -lt $len ]; do |
| 19 | if [scip-shell system . . `[`. "${line:$i:1}" = "{" ]; then |
| 20 | ver=${line:0:$i} |
| 21 | break |
| 22 | fi |
| 23 | i=$((i+1)) |
| 24 | done |
| 25 | elif [scip-shell system . . `[`. "${line:0:6}" = "crypt_" -a -n "$ver" ]; then |
| 26 | printfscip-shell system . . printf. 'CHECK_SYMBOL(%s, %s)\n' $line $ver |
| 27 | fi |
| 28 | done < <(trscip-shell system . . tr. -d '[:blank:];' < $1) |
| 29 | } |
| 30 | |
| 31 | testscip-shell system . . test. $# -ge 1 || failscip-shell shell shell-project 0.0.0 fail(). "usage: $0 <symbol_file>" |
| 32 | |
| 33 | testscip-shell system . . test. -f $1 || failscip-shell shell shell-project 0.0.0 fail(). "$1 is not a file." |
| 34 | |
| 35 | generatescip-shell shell shell-project 0.0.0 generate(). $1 |