From 6132d9e2782454e0ed7a88631f5d3cafa3630434 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 2 Mar 2015 09:06:55 -0600 Subject: [PATCH] Accelerate indentation of all files from 7 to 1.1 seconds. --- contrib/utilities/indent | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/contrib/utilities/indent b/contrib/utilities/indent index aa3bb296cd..bdd99afc40 100755 --- a/contrib/utilities/indent +++ b/contrib/utilities/indent @@ -1,7 +1,7 @@ #!/bin/bash ## --------------------------------------------------------------------- ## -## Copyright (C) 2012 - 2013 by the deal.II authors +## Copyright (C) 2012 - 2013, 2015 by the deal.II authors ## ## This file is part of the deal.II library. ## @@ -24,8 +24,18 @@ if test ! -f contrib/utilities/astyle.rc ; then exit 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 echo "--- Indenting all deal.II header and source files" -astyle --options=contrib/utilities/astyle.rc \ - include/deal.II/*/*.h \ - source/*/*.cc \ - examples/*/*.cc +for dir in 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 + -- 2.39.5