]>
Commit | Line | Data |
---|---|---|
45516216 | 1 | #!/bin/bash -ex |
2 | ||
3 | eval $(grep ^FILE= reduce-ice) | |
4 | ||
5 | [[ -z ${FILE} ]] && echo unable to find FILE && exit 1 | |
6 | ||
7 | if ! ./reduce-ice ; then | |
8 | echo "ERROR: compiling code did not find string!?" | |
9 | exit 1 | |
10 | fi | |
11 | ||
dbff64cb | 12 | if false ; then |
45516216 | 13 | echo "initial whitespace/preproc filter" |
14 | cp ${FILE} ${FILE}.unfiltered | |
15 | sed -i \ | |
dbff64cb | 16 | -e 's:[[:space:]]*::' \ |
45516216 | 17 | -e '/^$/d' \ |
18 | -e '/^#/d' \ | |
45516216 | 19 | ${FILE} |
20 | if cmp -s ${FILE} ${FILE}.unfiltered ; then | |
21 | rm -f ${FILE}.unfiltered | |
22 | elif ! ./reduce-ice ; then | |
23 | echo "ERROR: filtered version breaks things !?" | |
24 | exit 1 | |
25 | fi | |
dbff64cb | 26 | fi |
45516216 | 27 | |
dbff64cb MF |
28 | dir=$(mktemp -d -t reduce-ice.XXXXXX) |
29 | cp $FILE $dir/ | |
30 | ln -s $PWD/reduce-ice $dir/ | |
31 | pushd $dir | |
45516216 | 32 | for x in ${@:-0 0 1 1 2 2 5 5 10 10} ; do |
33 | multidelta -level=$x ./reduce-ice $FILE | |
34 | done | |
dbff64cb MF |
35 | popd |
36 | cp $dir/$FILE $FILE | |
37 | rm -rf $dir | |
45516216 | 38 | |
39 | case $FILE in | |
40 | *.i|*.ii|*.c|*.cxx) Lindent $FILE;; | |
41 | *) exit 0 | |
42 | esac | |
43 | if ! ./reduce-ice ; then | |
44 | echo "ERROR: lindent fucked it up!" | |
45 | mv "${FILE}~" "${FILE}" | |
46 | exit 1 | |
47 | fi |