source: tests/scripts/checkutf8.sh @ 6bb1505d

Last change on this file since 6bb1505d was 683ce32, checked in by kytv <kytv@…>, 7 years ago

testscripts build target: check shell scripts for validity

(also adding missing shebang lines)

  • Property mode set to 100755
File size: 1.2 KB
Line 
1#!/bin/sh
2#
3# Check for UTF-8 problems in all files where they might appear
4# Also check all Java source files
5# Returns nonzero on failure
6#
7# zzz 2010-12
8# public domain
9#
10
11cd `dirname $0`/../..
12
13# apps/routerconsole/jsp/ should only have UTF8 in help_xx.jsp
14
15DIRS="\
16  apps/routerconsole/locale \
17  apps/i2ptunnel/locale \
18  apps/i2psnark/locale \
19  apps/susidns/locale \
20  apps/susimail/locale \
21  apps/desktopgui/locale \
22  debian/po \
23  installer/resources/eepsite/docroot/help \
24  installer/resources/initialNews \
25  installer/resources/proxy \
26  installer/resources/readme \
27  apps/routerconsole/jsp \
28  apps/i2ptunnel/jsp \
29  apps/susidns/src/jsp"
30
31for i in `find $DIRS -maxdepth 1 -type f`
32do
33        echo "Checking $i ..."
34        iconv -f UTF8 -t UTF8 $i -o /dev/null
35        if [ $? -ne 0 ]
36        then
37                echo "********* FAILED CHECK FOR $i *************"
38                FAIL=1
39        fi
40done
41
42echo "Checking all Java files ..."
43for i in `find . -name \*.java -type f`
44do
45        #echo "Checking $i ..."
46        iconv -f UTF8 -t UTF8 $i -o /dev/null
47        if [ $? -ne 0 ]
48        then
49                echo "********* FAILED CHECK FOR $i *************"
50                FAIL=1
51        fi
52done
53
54if [ "$FAIL" != "" ]
55then
56        echo "******** At least one file failed check *********"
57else
58        echo "All files passed"
59fi
60exit $FAIL
Note: See TracBrowser for help on using the repository browser.