]> https://gitweb.dealii.org/ - dealii.git/commitdiff
simplify indent script 1503/head
authorTimo Heister <timo.heister@gmail.com>
Tue, 1 Sep 2015 14:23:50 +0000 (10:23 -0400)
committerTimo Heister <timo.heister@gmail.com>
Tue, 1 Sep 2015 14:24:41 +0000 (10:24 -0400)
- find can filter by extension
- xargs does parallel invocation
- fair grouping improves performance

contrib/utilities/indent

index c9e299a6e9716035f58df5e4b599845bb09159e2..ca5c34f32f31bae00966e64ec4397388d71170b9 100755 (executable)
@@ -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
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.