[MPlayer-dev-eng] [PATCH] charset checking for TOOLS/checktree.sh

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Thu Nov 10 22:22:07 CET 2005


Hi,
since I was told that source files are supposed to be ascii-only, I
decided to find out what that would actually mean.
Apply attached patch and then run
TOOLS/checktree.sh -charset
Have much fun :-P

Greetings,
Reimar Döffinger

P.S.: should I apply this?
-------------- next part --------------
Index: TOOLS/checktree.sh
===================================================================
RCS file: /cvsroot/mplayer/main/TOOLS/checktree.sh,v
retrieving revision 1.2
diff -u -r1.2 checktree.sh
--- TOOLS/checktree.sh	6 Sep 2005 15:30:12 -0000	1.2
+++ TOOLS/checktree.sh	10 Nov 2005 21:21:56 -0000
@@ -22,6 +22,7 @@
 _trailws=no
 _rcsid=no
 _oll=no
+_charset=no
 
 _color=yes
 _head=yes
@@ -45,6 +46,7 @@
     _trailws=yes
     _rcsid=yes
     _oll=yes
+    _charset=yes
 }
 
 disable_all_tests() {
@@ -54,6 +56,7 @@
     _trailws=no
     _rcsid=no
     _oll=no
+    _charset=no
 }
 
 printoption() {
@@ -100,6 +103,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
@@ -111,6 +115,12 @@
         echo -e "If there are, -(no)cvs has no effect.\n"
         exit
         ;;
+    -charset)
+        _charset=yes
+        ;;
+    -nocharset)
+        _charset=no
+        ;;
     -oll)
         _oll=yes
         ;;
@@ -248,5 +258,22 @@
 
 # -----------------------------------------------------------------------------
 
+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 -u "$I" -
+          ;;
+      esac
+    done
+fi
+
+# -----------------------------------------------------------------------------
+
 # End
 


More information about the MPlayer-dev-eng mailing list