From: Timo Heister Date: Tue, 1 Sep 2015 14:23:50 +0000 (-0400) Subject: simplify indent script X-Git-Tag: v8.4.0-rc2~495^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c54c38c5bf48ef06b7c0bc425299ad6b529e71bc;p=dealii.git simplify indent script - find can filter by extension - xargs does parallel invocation - fair grouping improves performance --- diff --git a/contrib/utilities/indent b/contrib/utilities/indent index c9e299a6e9..ca5c34f32f 100755 --- a/contrib/utilities/indent +++ b/contrib/utilities/indent @@ -40,17 +40,9 @@ fi -# loop over all directories in which we may have source files; -# collect a list of files and then spawn a parallel process to -# indent all of them +# collect all header and source files and process them in batches of 50 files +# with up to 10 in parallel echo "--- Indenting all deal.II header and source files" -for dir in tests include/deal.II/* source/* examples ; do - files=`find $dir | egrep '\.(cc|h)$'` ; - if test -n "$files" ; then - (astyle --options=contrib/utilities/astyle.rc $files ) & - fi -done - -# now wait for all of these processes to finish -wait + +find tests include source examples \( -name '*.cc' -o -name '*.h' \) -print | xargs -n 50 -P 10 astyle --options=contrib/utilities/astyle.rc