From: <ai...@us...> - 2012-01-13 02:06:09
|
Revision: 12127 http://plplot.svn.sourceforge.net/plplot/?rev=12127&view=rev Author: airwin Date: 2012-01-13 02:06:02 +0000 (Fri, 13 Jan 2012) Log Message: ----------- For the --apply option change the shell script logic to do the following steps: 1. List all files (and diffs all files if the --diff option is used as well) that will be changed. 2. Ask whether you want to apply those changes. If no, immediate exit. If yes, proceed with the further steps. 3. Apply the changes. 4. List all files (and diffs all files if the --diff option is used as well) that required further styling after the current style changes were made. Normally, this step does not list anything, but it does warn you when further runs of the script are required on those rare occasions where uncrustify has to be applied iteratively. Modified Paths: -------------- trunk/scripts/style_source.sh Modified: trunk/scripts/style_source.sh =================================================================== --- trunk/scripts/style_source.sh 2012-01-11 23:07:23 UTC (rev 12126) +++ trunk/scripts/style_source.sh 2012-01-13 02:06:02 UTC (rev 12127) @@ -110,16 +110,28 @@ # quotes) after the $c_command to correct introduced swig styling # errors (if in fact you are styling swig source). + # N.B. for the --apply option, transform_source is called twice; + # once with apply=OFF and once with it on. For the first call + # with apply=OFF the logic below lists all files (and diffs all + # files if that option is used) that will be changed. For the + # second call with apply=ON, the logic below changes the source + # files and then lists (and diffs if that option is set) any + # remaining changes that still have to be done. (On rare + # occasions, uncrustify has to be applied iteratively.) + for language_source in $1 ; do + if [ "$apply" = "ON" ] ; then + $u_command < $language_source | $c_command | eval $s_command | \ + cmp --quiet $language_source - + if [ "$?" -ne 0 ] ; then + $u_command < $language_source | $c_command | eval $s_command >| /tmp/temporary.file + mv -f /tmp/temporary.file $language_source + fi + fi $u_command < $language_source | $c_command | eval $s_command | \ cmp --quiet $language_source - if [ "$?" -ne 0 ] ; then ls $language_source - if [ "$apply" = "ON" ] ; then - $u_command < $language_source | $c_command | eval $s_command >| /tmp/temporary.file - mv -f /tmp/temporary.file $language_source - fi - if [ "$diff" = "ON" ] ; then $u_command < $language_source | $c_command | eval $s_command | \ diff $diff_options $language_source - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |