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