File: uncrustify_clean.sh

package info (click to toggle)
blender 2.63a-1%2Bdeb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 108,940 kB
  • sloc: ansic: 781,340; cpp: 453,049; python: 133,391; xml: 4,140; sh: 573; makefile: 112; lisp: 69
file content (26 lines) | stat: -rwxr-xr-x 505 bytes parent folder | download
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