| 1 | #! /bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | # |
| 3 | # Test for Japanese encoding |
| 4 | # |
| 5 | LOG=`pwdscip-shell system . . pwd.`/test-log |
| 6 | echoscip-shell system . . echo. ' *** starting ' $0 >>$LOG |
| 7 | TARGET=$srcdir/data/ja-spec |
| 8 | IDX=ja-idx1 |
| 9 | |
| 10 | EXEC=no |
| 11 | |
| 12 | lc_all=$LC_ALL |
| 13 | lc_ctype=$LC_CTYPE |
| 14 | lang=$LANG |
| 15 | |
| 16 | for ctype in "$lc_all" "$lc_ctype" "$lang"; do |
| 17 | if testscip-shell system . . test. -n "$ctype" -a "$ctype" = "C"; then |
| 18 | ctype="en" |
| 19 | break |
| 20 | fi |
| 21 | cand=`echoscip-shell system . . echo. "$ctype" | LC_ALL="C" perlscip-shell system . . perl. -nle 'print $1 if /^(..)/'` |
| 22 | if testscip-shell system . . test. -n "$cand"; then |
| 23 | ctype=$cand |
| 24 | break |
| 25 | fi |
| 26 | done |
| 27 | |
| 28 | case $ctype in |
| 29 | ja*) |
| 30 | EXEC=yes |
| 31 | ;; |
| 32 | esac |
| 33 | if [scip-shell system . . `[`. $EXEC = 'no' ] |
| 34 | then |
| 35 | echoscip-shell system . . echo. "Skipping because of LANG does not begin with ja: $0" >> $LOG |
| 36 | exit 77 |
| 37 | fi |
| 38 | |
| 39 | if testscip-shell system . . test. ! -d $IDX; then |
| 40 | mkdirscip-shell system . . mkdir. $IDX |
| 41 | else |
| 42 | rmscip-shell system . . rm. -f $IDX/NMZ.* |
| 43 | fi |
| 44 | |
| 45 | ../scripts/mknmz -O $IDX $TARGET >> $LOG |
| 46 | exit $? |