From: Timo Heister Date: Thu, 9 Nov 2017 18:58:51 +0000 (-0500) Subject: fix dos formatted files in contrib/utilities/indent X-Git-Tag: v9.0.0-rc1~791^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F5434%2Fhead;p=dealii.git fix dos formatted files in contrib/utilities/indent --- diff --git a/contrib/utilities/indent b/contrib/utilities/indent index 89382adeb9..64d2f0c98a 100755 --- a/contrib/utilities/indent +++ b/contrib/utilities/indent @@ -63,6 +63,18 @@ find tests include source examples \( -name '*.cc' -o -name '*.h' -o -name '*.cu # use the same process to set file permissions for all source files find tests include source examples \( -name '*.cc' -o -name '*.h' -o -name '*.cu' -o -name '*.cuh' \) -print | xargs -n 50 -P 10 chmod 644 +# convert dos formatted files to unix file format by stripping out +# carriage returns (15=0x0D): +dos_to_unix() +{ + f=$1 + tr -d '\015' <$f >$f.tmp + diff -q $f $f.tmp >/dev/null || mv $f.tmp $f + rm -f $f.tmp +} +export -f dos_to_unix +find tests include source examples \( -name '*.cc' -o -name '*.h' -o -name '*.cu' -o -name '*.cuh' \) -print | xargs -n 1 -P 10 -I {} bash -c 'dos_to_unix "$@"' _ {} + # format .inst.in files. We need to replace \{ and \} because it confuses # astyle. format_inst()