Change condition to assertion.
[sbcl.git] / tools-for-build / update-unicode-datafiles.sh
blob5ec97e2a5afa109deb32c77158ef77aba9554801
1 #! /bin/bash
3 UCDIR="$1"
4 declare -A SKIP FOUND
6 for file in tools-for-build/*.txt tests/data/*.txt; do
7 f="$(basename "$file")"
8 for dir in "" auxiliary extracted CollationTest emoji; do
9 if [ -z "$dir" ]; then
10 t="$UCDIR/$f"
11 else
12 t="$UCDIR/$dir/$f"
14 if [ -f "$t" ]; then
15 echo "Required file $f found: $t"
16 FOUND[$file]="$t"
17 break
18 elif [ "true" = "${SKIP[$f]}" ]; then
19 echo "Skipping file $f"
20 break
22 done
23 if [ -z "${FOUND[$file]}" -a -z "${SKIP[$f]}" ]; then
24 echo "Required file not found in $UCDIR: $f"
25 exit 1
27 done
29 for file in "${!FOUND[@]}"; do
30 cp "${FOUND[$file]}" "$file"
31 done