fixed build with bundled OpenSSL
[public/netxms.git] / tools / chkmsgs.sh
CommitLineData
cc8ce218
VK
1#!/bin/sh
2
3usage() {
4 echo "usage `basename $0` <dir> <lang> <verbose>";
5 echo "dir: netxms source directory"
6 echo "lang: two-letter abbreviation";
7 echo "verbose: on|off "
8}
9
10compare() {
11 local _dir="$1"
12 local _lang="$2"
13 local _verb="$3"
14 local _name="$4"
15
16 for MFILE in `find "$_dir" -name "$_name" -print`; do
17 BASENAME=`basename $MFILE`
18 PREFIX="${BASENAME%.properties}"
19 DIR=`dirname $MFILE`
20 LFILE=$DIR/$PREFIX"_$_lang.properties"
21 if [ -f $LFILE ]; then
22 LINES_M=`wc -l < $MFILE | tr -d '\n'`
23 LINES_L=`wc -l < $LFILE | tr -d '\n'`
24 if [ "$LINES_M" != "$LINES_L" ]; then
25 echo "$DIR [$LINES_M:$LINES_L] ! $LFILE"
26 else
27 if [ "$_verb" == "on" ]; then
28 echo "$DIR [$LINES_M:$LINES_L]"
29 fi
30 fi
31 else
32 echo "can't find $LFILE"
33 fi
34 done
35}
36
37if [ $# -lt 2 ]; then
38 usage
39 exit
40fi
41
42if [ $# -eq 3 ]; then
43 case "$3" in
44 on)
45 VERB="$3"
46 ;;
47 off)
48 VERB="$3"
49 ;;
50 *)
51 usage
52 exit
53 ;;
54 esac
55else
56 usage
57 exit
58fi
59
60for F in messages bundle compare ; do
61 compare "$1" "$2" "$VERB" "$F.properties"
62done