xref: /freebsd/tools/diag/localeck/docheck.sh (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1#!/bin/sh
2#
3# Validate all locales installed in specified directory
4# (by default check system locales)
5#
6#
7
8LOCALEDIR=/usr/share/locale
9
10if [ "$1" != "" ]; then
11	LOCALEDIR=$1
12fi
13
14if [ ! -x ./localeck ]; then
15	echo "ERROR: build test program first."
16	exit 1
17fi
18
19PATH_LOCALE=$LOCALEDIR
20LOCALES=0
21ERRORS=0
22
23echo "Validating locales in $LOCALEDIR"
24echo
25
26for i in `ls -1 $LOCALEDIR`
27do
28	LOCALES=$(($LOCALES + 1))
29	./localeck $i || ERRORS=$(($ERRORS + 1))
30done
31
32echo
33echo "Validation test complete"
34echo "$LOCALES locales were checked"
35echo "$ERRORS invalid locales were found"
36
37