From: <ai...@us...> - 2010-10-22 00:16:05
|
Revision: 11267 http://plplot.svn.sourceforge.net/plplot/?rev=11267&view=rev Author: airwin Date: 2010-10-22 00:15:59 +0000 (Fri, 22 Oct 2010) Log Message: ----------- Extend C source that is checked for new comment style to all of include/*.h except for qt.h. Change internals of script so that run-time errors in scripts/convert_comment.py (generated by pathological commentary style that cannot be parsed by that script) causes a useful error message and immediate exit that allows you to hand-edit the file to replace the pathological commentary style by a mainstream commentary style that the script can understand. Modified Paths: -------------- trunk/scripts/style_source.sh Modified: trunk/scripts/style_source.sh =================================================================== --- trunk/scripts/style_source.sh 2010-10-22 00:07:24 UTC (rev 11266) +++ trunk/scripts/style_source.sh 2010-10-22 00:15:59 UTC (rev 11267) @@ -123,12 +123,12 @@ # src directory csource_LIST="$csource_LIST src/*.[ch]" +# All C source (i.e., exclude qt.h) in include directory. +csource_LIST="$csource_LIST `ls include/*.h include/*.h.in include/*.h.cmake |grep -v qt.h`" + # temporary exclude_c=ON if [ -z "$exclude_c" ] ; then -# All C source (i.e., exclude qt.h) in include directory. -csource_LIST="$csource_LIST `ls include/*.h include/*.h.in include/*.h.cmake |grep -v qt.h`" - # Every subdirectory of lib. csource_LIST="$csource_LIST lib/*/*.[ch] lib/qsastime/qsastimeP.h.in" @@ -190,6 +190,7 @@ # temporary fi + transform_source() { # $1 is a list of source files of a particular language. @@ -202,6 +203,21 @@ # nothing) to indicate uncrustify will be used. if [ "$3" = "comments" ] ; then c_command="scripts/convert_comment.py" + # Check all files for run-time errors with the python script. + # These run-time errors signal that there is some comment + # style which the script cannot handle. The reason we do this + # complete independent check here is that run-time errors can + # be lost in the noise if a large conversion is being done. + # Also, run-time errors will not occur for the usual case + # below where cmp finds an early difference. + for language_source in $1 ; do + $c_command < $language_source >/dev/null + c_command_rc=$? + if [ $c_command_rc -ne 0 ] ; then + echo "ERROR: $c_command failed for file $language_source" + exit 1 + fi + done else c_command="cat -" fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |