1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
#!/bin/bash
CFG="source/tools/uncrustify.cfg"
if [ ! -f $CFG ]
then
echo "Run this from the blender source directory: " $CFG " not found, aborting"
exit 0
fi
for fn in "$@"
do
# without this, the script simply undoes whitespace changes.
uncrustify -c $CFG --no-backup --replace "$fn"
cp "$fn" "$fn.NEW"
svn revert "$fn" 1> /dev/null
diff "$fn" "$fn.NEW" -u --ignore-trailing-space --ignore-blank-lines > "$fn.DIFF"
patch -p0 < "$fn.DIFF" 1> /dev/null
rm "$fn.NEW"
rm "$fn.DIFF"
done
|