From: <ai...@us...> - 2009-01-06 19:57:53
|
Revision: 9266 http://plplot.svn.sourceforge.net/plplot/?rev=9266&view=rev Author: airwin Date: 2009-01-06 19:57:52 +0000 (Tue, 06 Jan 2009) Log Message: ----------- Make "if" syntax more consistent. [ ] preferred to test, string comparisons done with "=" rather than "==" (that state already exists, but I mention it because that issue did historically occur for files in the plplot-test subdirectory), and uniformly apply quotes to second argument of string comparison. Modified Paths: -------------- trunk/scripts/generate_website.sh trunk/scripts/htdocs-gen_plot-examples.sh trunk/scripts/make_tarball.sh Modified: trunk/scripts/generate_website.sh =================================================================== --- trunk/scripts/generate_website.sh 2009-01-06 19:37:00 UTC (rev 9265) +++ trunk/scripts/generate_website.sh 2009-01-06 19:57:52 UTC (rev 9266) @@ -18,11 +18,11 @@ echo "" echo "Last warning: if you specify 'yes' below, then the '$WEBSITE_PREFIX' directory on the remote host, '$HOSTNAME', will be removed and then replaced." ANSWER= -while test "$ANSWER" != "yes" -a "$ANSWER" != "no"; do +while [ "$ANSWER" != "yes" -a "$ANSWER" != "no" ] ; do echo -n "Continue (yes/no)? " read ANSWER done -if test "$ANSWER" = "no"; then +if [ "$ANSWER" = "no" ] ; then echo "Immediate exit specified!" exit fi Modified: trunk/scripts/htdocs-gen_plot-examples.sh =================================================================== --- trunk/scripts/htdocs-gen_plot-examples.sh 2009-01-06 19:37:00 UTC (rev 9265) +++ trunk/scripts/htdocs-gen_plot-examples.sh 2009-01-06 19:57:52 UTC (rev 9266) @@ -29,22 +29,22 @@ # build=false scripts/htdocs-gen_plot-examples.sh # Sanity checks. -if test -z "$WWW_USER"; then +if [ -z "$WWW_USER" ] ; then echo "must specify non-empty WWW_USER environment variable" exit 1 fi -if test -z "$WWW_GROUP"; then +if [ -z "$WWW_GROUP" ] ; then echo "must specify non-empty WWW_GROUP environment variable" exit 1 fi -if test -z "$WWW_HOST"; then +if [ -z "$WWW_HOST" ] ; then echo "must specify non-empty WWW_HOST environment variable" exit 1 fi -if test -z "$WWW_DIR"; then +if [ -z "$WWW_DIR" ] ; then echo "must specify non-empty WWW_DIR environment variable" exit 1 fi @@ -58,7 +58,7 @@ build=${build:-true} -if test "$build" = true; then +if [ "$build" = "true" ] ; then rm -rf htdocsgen/build_dir htdocsgen/install mkdir -p htdocsgen/build_dir htdocsgen/install cd htdocsgen/build_dir @@ -86,14 +86,14 @@ for exe in 01 02 03 04 05 06 07 08 09 10 11 12 13 15 16 18 19 20 21 22 \ 23 24 25 26 27 28 29 30; do - if test $exe = 08 -o $exe = 16 -o $exe = 20 -o $exe = 30; then + if [ $exe = "08" -o $exe = "16" -o $exe = "20" -o $exe = "30" ] ; then # The default cairo graphics AA looks good for these examples now # since Werner's filled_polygon change to the cairo driver so no need # to explicitly turn graphics AA off any more with # DRIVEROPT='-drvopt graphics_anti_aliasing=1' DRIVEROPT= else - if test $exe = 09 -o $exe = 21; then + if [ $exe = "09" -o $exe = "21" ] ; then # Text clipping. DRIVEROPT='-drvopt text_clipping=1' else @@ -135,7 +135,7 @@ examples/python/xw${exe}.py \ examples/tcl/x${exe}.tcl \ ; do - if test -f $f ; then + if [ -f $f ] ; then $CP $f $EXDIR/demo${exe} else echo Example `basename $f` is not yet available \ Modified: trunk/scripts/make_tarball.sh =================================================================== --- trunk/scripts/make_tarball.sh 2009-01-06 19:37:00 UTC (rev 9265) +++ trunk/scripts/make_tarball.sh 2009-01-06 19:57:52 UTC (rev 9266) @@ -116,7 +116,7 @@ ${PREBUILD_ARG} ${DOC_ARG} \ -DWWW_USER:STRING=${WWW_USER} ../plplot >& cmake.out \ && echo "Making distribution." \ - && (if test "$do_prebuild_dist" = yes; then + && (if [ "$do_prebuild_dist" = "yes" ] ; then make ${make_opt} prebuild_dist >& make_prebuild_dist.out fi) \ && make ${make_opt} package_source >& make_package_source.out \ @@ -125,7 +125,7 @@ && mv $TARBALL .. \ && cd .. \ && echo "distribution tarball: $TARBALL" \ - && test "$do_check" = yes \ + && test "$do_check" = "yes" \ && tar xfz $TARBALL \ && mkdir ctest_build_dir \ && ( cd ctest_build_dir \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2010-10-11 22:56:10
|
Revision: 11259 http://plplot.svn.sourceforge.net/plplot/?rev=11259&view=rev Author: airwin Date: 2010-10-11 22:56:04 +0000 (Mon, 11 Oct 2010) Log Message: ----------- Version of scripts used for first round of commentary style changes (temporarily limited to config.h.cmake + source code in src). Modified Paths: -------------- trunk/scripts/convert_comment.py trunk/scripts/style_source.sh Modified: trunk/scripts/convert_comment.py =================================================================== --- trunk/scripts/convert_comment.py 2010-10-11 22:53:05 UTC (rev 11258) +++ trunk/scripts/convert_comment.py 2010-10-11 22:56:04 UTC (rev 11259) @@ -5,40 +5,117 @@ # stdin, output file is stdout. import sys import re +# Restore default signal handling for SIGPIPE as suggested by +# http://www.velocityreviews.com/forums/t332662-ioerror-errno-32-broken-pipe.html +# so that stdout can be sent (unix-only) to a pipelined process that terminates +# early such as cmp. +import signal +signal.signal(signal.SIGPIPE, signal.SIG_DFL) + ifsingleline = True for line in sys.stdin.readlines(): + start_comment = line.find("/*") + start_special = line.find("//*") + # if start_special corresponds to start_comment, then ignore start_comment + # to deal with issue of recursive changes to an original line of the + # form "/******..." + if start_special >= 0 and start_special == start_comment -1: + start_comment = -1 + end_comment = line.find("*/") - # len(line) includes new line character at end. + # Note trailing "\n" has not (yet) been removed from line so that the next + # to last character is at position len(line) - 3. if end_comment >=0 and end_comment != len(line) - 3: sys.stderr.write(line) - raise RuntimeError, "Trailing garbage after */" + raise RuntimeError, "Cannot handle embedded comment with trailing character(s) after */" - if ifsingleline : - start_comment = line.find("/*") + if ifsingleline and (start_comment >=0 or end_comment >=0): + # strip trailing "\n" (Unix line endings, only) since that might + # cause trouble with stripping trailing white space below. + # This trailing "\n" will be added back at the end. + line = re.sub(r'^(.*)\n$', "\\1", line) if start_comment <0 and end_comment >=0: sys.stderr.write(line) raise RuntimeError, "Trailing */ for a line which is not a comment" - # convert single-line comment. - line = re.sub(r'^(.*)(/\*)(.*) *\*/$', "\\1//\\3", line) + # Convert single-line comment (if it exists). + # \1 corresponds to zero or more leading characters before "/*". + # \3 corresponds to zero or more characters between "/*" and + # "*/". + # N.B. preserves indentation. + line = re.sub(r'^(.*)(/\*)(.*)\*/$', "\\1//\\3", line) + # strip trailing white space (if any). + line = line.rstrip() + # Deal with "/**" case which would be changed to "//*" above. + start_special = line.find("//*") start_comment = line.find("/*") - if start_comment >= 0: + if start_special < 0 and start_comment >= 0: # Convert first line of multiline comment. - line = line.replace("/*", "//") + # N.B. preserves indentation. + line = line.replace("/*", "//", 1) ifsingleline = False - else: - end_comment = line.find("*/") + + # Add back (Unix-only) line ending. + line = line + "\n" + + elif not ifsingleline: + if start_comment >=0: + sys.stderr.write(line) + raise RuntimeError, "*/ in the middle of a comment block" + + # strip trailing "\n" (Unix line endings, only) since that might + # cause trouble with stripping trailing white space below. + # This trailing "\n" will be added back at the end. + line = re.sub(r'^(.*)\n$', "\\1", line) if end_comment < 0: # Convert multiline comment line that is not start line - # or end line of that comment. Look for leading blank asterisk - # standard form of multiline commend line and get rid of it. - line = "//" + re.sub(r'^ \*', "", line) + # or end line of that comment. + # Replace " *" after zero or more blanks (the standard form + # produced by uncrustify) if it is there by "//". + # N.B. preserves indentation. + line = re.sub(r'^( *) \*', "\\1//", line) + start_newcomment = line.find("//") + if start_newcomment < 0: + # If all previous conversion attempts failed.... + line = "//" + line else: # Convert last line of multiline comment. - line = "//" + re.sub(r'^ *(.*)\*/', "\\1", line) + # Try converting vacuous form (initial blanks + " */") + # to initial blanks (if any) + "//". + # This consumes the blank in " */" that is customary as + # the last line of a multi-line block. + # N.B. preserves indentation. + # \1 contains the initial blanks + line = re.sub(r'^( *) \*/$', "\\1//", line) + + # Try converting non-vacuous standard form produced by + # uncrustify (initial blanks + " *" + any string + "*/") + # to initial blanks + "//" + any string. + # N.B. preserves indentation. + # \1 contains the initial blanks + # \2 contains the "any" string preceding "*/". + line = re.sub(r'^( *) \*(.*)\*/$', "\\1//\\2", line) + + # If all previous conversion attempts failed.... + # N.B. Does not preserve indentation. + line = re.sub(r'^(.*)\*/$', "//\\1", line) + + # strip trailing white space (if any). + line = line.rstrip() ifsingleline = True + # Add back (Unix-only) line ending. + line = line + "\n" + + # Special transforms to get rid of left-over "\*" and "*\" forms which + # have historically been used to frame multi-block comments by some + # PLplot developers. + # Replace leading "// \*" ==> "//" + line = re.sub(r'^// \\\*(.*)$', "//\\1", line) + # Remove "*\" from end of comment lines + line = re.sub(r'^//(.*)\*\\$', "//\\1", line) + sys.stdout.write(line) sys.exit() Modified: trunk/scripts/style_source.sh =================================================================== --- trunk/scripts/style_source.sh 2010-10-11 22:53:05 UTC (rev 11258) +++ trunk/scripts/style_source.sh 2010-10-11 22:56:04 UTC (rev 11259) @@ -3,12 +3,16 @@ # $Id$ # This script will run uncrustify on all source files registered in -# the lists below and summarize which uncrustified files are -# different. Also there are options to view the differences in detail +# the lists below (and scripts/convert_comment.py on all C source +# files registerd below) and summarize which uncrustified or +# comment-converted files would be different. (convert_comment.py +# converts /* ... */ style comments to the c99-acceptable // form of +# comments because uncrustify does not (yet) have that configuration +# choice.) Also there are options to view the differences in detail # and/or apply them. This script must be run from the top-level # directory of the PLplot source tree. -# Copyright (C) 2009 Alan W. Irwin +# Copyright (C) 2009-2010 Alan W. Irwin # # This file is part of PLplot. # @@ -110,7 +114,6 @@ echo "Immediate exit specified!" exit fi - fi export csource_LIST @@ -120,6 +123,9 @@ # src directory csource_LIST="$csource_LIST src/*.[ch]" +# 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`" @@ -182,29 +188,47 @@ fi done -uncrustify_source() +# temporary +fi +transform_source() { -# $1 is a list of source files of a particular language. -# $2 is the language identification string for those source files in -# the form needed by uncrustify. From the uncrustify man page those -# language id forms are C, CPP, D, CS, JAVA, PAWN, VALA, OC, OC+ + # $1 is a list of source files of a particular language. + # $2 is the language identification string for those source files in + # the form needed by uncrustify. From the uncrustify man page those + # language id forms are C, CPP, D, CS, JAVA, PAWN, VALA, OC, OC+ + u_command="uncrustify -c uncrustify.cfg -q -l $2" + # $3 is either "comments" to indicate comments will be transformed + # using scripts/convert_comment.py or any other string (or + # nothing) to indicate uncrustify will be used. + if [ "$3" = "comments" ] ; then + c_command="scripts/convert_comment.py" + else + c_command="cat -" + fi + # Process $c_command after $u_command so that comments will be rendered + # in standard form by uncrustify before scripts/convert_comment.py + # is run. + for language_source in $1 ; do - uncrustify -c uncrustify.cfg -q -l $2 < $language_source | cmp --quiet $language_source - + $u_command < $language_source | $c_command | \ + cmp --quiet $language_source - if [ "$?" -ne 0 ] ; then ls $language_source if [ "$diff" = "ON" ] ; then - uncrustify -c uncrustify.cfg -q -l $2 < $language_source | diff $diff_options $language_source - + $u_command < $language_source | $c_command | \ + diff $diff_options $language_source - fi if [ "$apply" = "ON" ] ; then - uncrustify -c uncrustify.cfg -q -l $2 --no-backup $language_source + $u_command < $language_source | $c_command >| /tmp/temporary.file + mv -f /tmp/temporary.file $language_source fi fi done } -uncrustify_source "$csource_LIST" C -uncrustify_source "$cppsource_LIST" CPP -uncrustify_source "$javasource_LIST" JAVA -uncrustify_source "$dsource_LIST" D +transform_source "$csource_LIST" C "comments" +#transform_source "$cppsource_LIST" CPP +#transform_source "$javasource_LIST" JAVA +#transform_source "$dsource_LIST" D This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2014-02-18 21:07:41
|
Revision: 13014 http://sourceforge.net/p/plplot/code/13014 Author: airwin Date: 2014-02-18 21:07:37 +0000 (Tue, 18 Feb 2014) Log Message: ----------- Do long-neglected maintenance of parity_bit_check.sh, a script that checks for non-ascii files in the source tree, i.e., files which include characters with the parity bit set. Note this check does not include files which are already well known to contain non-ascii characters. In other words, this check only looks for unexpected non-ascii characters. Use the "svn export" command to create a clean directory tree that is checked for such files. Update the list of files (scripts/parity_bit_check.exclude) known to contain non-ascii characters. All these changes concerned source files which have been changed from ascii to UTF-8. Modified Paths: -------------- trunk/scripts/parity_bit_check.exclude trunk/scripts/parity_bit_check.sh Modified: trunk/scripts/parity_bit_check.exclude =================================================================== --- trunk/scripts/parity_bit_check.exclude 2014-02-14 19:46:46 UTC (rev 13013) +++ trunk/scripts/parity_bit_check.exclude 2014-02-18 21:07:37 UTC (rev 13014) @@ -1,13 +1,19 @@ -\.svn -~$ +\.shp +\.shx \.jpg$ \.gif$ \.cgm$ \.map$ \.fnt$ +x18 x2[46] +x33 +xw18 xw2[46] +xw33 +xthick18 xthick2[46] +xthick33 lena README.release test_hebrew_diacritic.py @@ -23,3 +29,11 @@ api2text.pl docbook/AUTHORS __pl_pltext.m +plplot_auxiliary.adb +plplot_auxiliary.ads +doc/docbook/README.developers +doc/docbook/src/CMakeLists.txt +doc/docbook/src/advanced.xml +doc/docbook/src/api.xml +examples/python/test_linebreak.py +examples/ocaml/xplot01.ml Modified: trunk/scripts/parity_bit_check.sh =================================================================== --- trunk/scripts/parity_bit_check.sh 2014-02-14 19:46:46 UTC (rev 13013) +++ trunk/scripts/parity_bit_check.sh 2014-02-18 21:07:37 UTC (rev 13014) @@ -6,7 +6,7 @@ # source tree (except those listed below) to discover which of those # files have any character with the eighth (parity) bit set. -# Copyright (C) 2010 Alan W. Irwin +# Copyright (C) 2010-2014 Alan W. Irwin # # This file is part of PLplot. # @@ -50,9 +50,11 @@ # Assumption: top-level source tree is parent directory of where script # is located. SOURCE_TREE="$(dirname ${SCRIPT_PATH})" -cd "${SOURCE_TREE}" #List of all files in source tree other than .svn ones.... +rm -rf /tmp/parity_bit_check +svn --quiet export ${SOURCE_TREE} /tmp/parity_bit_check +cd /tmp/parity_bit_check find -type f >| /tmp/temporary_source_tree_list for FILE in $(grep -v -f "$SOURCE_TREE"/scripts/parity_bit_check.exclude /tmp/temporary_source_tree_list); do @@ -62,4 +64,4 @@ printf "%s %x\n" $FILE $parity_bit_check_rc fi done -rm -f /tmp/temporary_source_tree_list \ No newline at end of file +rm -f /tmp/temporary_source_tree_list This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |