[MPlayer-cvslog] CVS: main/TOOLS checktree.sh,1.3,1.4

Reimar Döffinger CVS syncmail at mplayerhq.hu
Fri Apr 14 12:47:42 CEST 2006


CVS change done by Reimar Döffinger CVS

Update of /cvsroot/mplayer/main/TOOLS
In directory mail:/var2/tmp/cvs-serv11628/TOOLS

Modified Files:
	checktree.sh 
Log Message:
add check for non-ascii charsets used in code and simplify showcont switch handling


Index: checktree.sh
===================================================================
RCS file: /cvsroot/mplayer/main/TOOLS/checktree.sh,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- checktree.sh	7 Dec 2005 18:11:58 -0000	1.3
+++ checktree.sh	14 Apr 2006 10:47:40 -0000	1.4
@@ -22,6 +22,7 @@
 _trailws=no
 _rcsid=no
 _oll=no
+_charset=no
 _showcont=no
 
 _color=yes
@@ -46,6 +47,7 @@
     _trailws=yes
     _rcsid=yes
     _oll=yes
+    _charset=yes
 }
 
 disable_all_tests() {
@@ -55,6 +57,7 @@
     _trailws=no
     _rcsid=no
     _oll=no
+    _charset=no
 }
 
 printoption() {
@@ -101,6 +104,7 @@
         printoption "trailws   " "test for trailing whitespace" "$_trailws"
         printoption "rcsid     " "test for missing RCS Id's" "$_rcsid"
         printoption "oll       " "test for overly long lines" "$_oll"
+        printoption "charset   " "test for wrong charset" "$_charset"
         echo
         printoption "all       " "enable all tests" "no"
         echo
@@ -115,6 +119,12 @@
         echo -e "If there are, -(no)cvs has no effect.\n"
         exit
         ;;
+    -charset)
+        _charset=yes
+        ;;
+    -nocharset)
+        _charset=no
+        ;;
     -oll)
         _oll=yes
         ;;
@@ -210,6 +220,14 @@
 
 filelist=`all_filenames`
 
+if [ "$_showcont" == "yes" ]; then
+  _diffopts="-u"
+  _grepopts="-n -I"
+else
+  _diffopts="-q"
+  _grepopts="-l -I"
+fi
+
 # -----------------------------------------------------------------------------
 
 # DO CHECKS
@@ -232,22 +250,14 @@
 
 if [ "$_crlf" == "yes" ]; then
     printhead "checking for MSDOS line endings ..."
-    if [ "$_showcont" == "yes" ]; then
-        grep -n -I "
" $filelist
-    else
-    grep -l -I "
" $filelist
-    fi
+    grep $_grepopts "
" $filelist
 fi
 
 # -----------------------------------------------------------------------------
 
 if [ "$_trailws" == "yes" ]; then
     printhead "checking for trailing whitespace ..."
-    if [ "$_showcont" == "yes" ]; then
-        grep -n -I "[[:space:]]\+$" $filelist
-    else
-    grep -l -I "[[:space:]]\+$" $filelist
-    fi
+    grep $_grepopts "[[:space:]]\+$" $filelist
 fi
 
 # -----------------------------------------------------------------------------
@@ -261,11 +271,24 @@
 
 if [ "$_oll" == "yes" ]; then
     printhead "checking for overly long lines (over 79 characters) ..."
-    if [ "$_showcont" == "yes" ]; then
-        grep -n -I "^[[:print:]]\{80,\}$" $filelist
-    else
-    grep -l -I "^[[:print:]]\{80,\}$" $filelist
-    fi
+    grep $_grepopts "^[[:print:]]\{80,\}$" $filelist
+fi
+
+# -----------------------------------------------------------------------------
+
+if [ "$_charset" == "yes" ]; then
+    printhead "checking bad charsets ..."
+    for I in $filelist ; do
+      case "$I" in
+        ./help/help_mp-*.h)
+          ;;
+        ./DOCS/*)
+          ;;
+        *.c|*.h)
+          iconv -c -f ascii -t ascii "$I" | diff $_diffopts "$I" -
+          ;;
+      esac
+    done
 fi
 
 # -----------------------------------------------------------------------------




More information about the MPlayer-cvslog mailing list