]> https://gitweb.dealii.org/ - dealii.git/commitdiff
run astyle .inst.in files
authorTimo Heister <timo.heister@gmail.com>
Sat, 6 Aug 2016 18:43:05 +0000 (14:43 -0400)
committerTimo Heister <timo.heister@gmail.com>
Sat, 6 Aug 2016 21:12:08 +0000 (17:12 -0400)
contrib/utilities/indent

index 492d3717bd19b6950e4855b87c1e7a0d649e1644..b633c43bea32d95771b6a59312c6dfc60d48266b 100755 (executable)
@@ -44,3 +44,23 @@ fi
 # with up to 10 in parallel
 find tests include source examples \( -name '*.cc' -o -name '*.h' \) -print | xargs -n 50 -P 10 astyle --options=contrib/utilities/astyle.rc
 
+# format .inst.in files. We need to replace \{ and \} because it confuses
+# astyle.
+format_inst()
+{
+    f=$1
+    cp $f $f.tmp
+    sed -i 's#\\{#{ //#g' $f.tmp
+    sed -i 's#\\}#} //#g' $f.tmp
+    astyle --quiet $f.tmp
+    sed -i 's#{ //#\\{#g' $f.tmp
+    sed -i 's#} //#\\}#g' $f.tmp
+    if ! diff -q $f $f.tmp >/dev/null
+    then
+       cp $f.tmp $f
+    fi
+    rm $f.tmp
+}
+
+export -f format_inst
+find source -name '*.inst.in' | xargs -n 1 -P 10 -I % bash -c 'format_inst "$@"' _ %

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.