Debian Codegraph @

sw/qa/writerfilter/ooxml/watch-generated-code.sh

raw
1 #!/usr/bin/env bash
2
3 if [ ! -e bin/get_config_variables ]; then
4 cd ../../..
5 fi
6
7 . bin/get_config_variables SRCDIR
8
9 if [ "$PWD" != "$SRCDIR" ]; then
10 echo "error: not in the expected SRCDIR"
11 exit 1
12 fi
13
14 cd writerfilter
15 echo 'include Makefile' > watch.mk
16 echo 'watch:' >> watch.mk
17 echo $'\techo $(writerfilter_ALL)' >> watch.mk
18 mydir=workdir/CustomTarget/writerfilter
19 writerfilter_ALL=$(make -sr -f watch.mk watch|sed "s|$SRCDIR/$mydir/||g")
20 rm watch.mk
21 cd - >/dev/null
22
23 case $1 in
24 reference)
25 rm -rf $mydir-reference
26 mkdir -p $mydir-reference/source/ooxml
27 for i in $writerfilter_ALL
28 do
29 cp $mydir/"$i" $mydir-reference/"$i"
30 done
31 ;;
32 compare)
33 for i in $writerfilter_ALL
34 do
35 if [ "$(basename "$i")" == "model_preprocessed.xml" ]; then
36 continue
37 fi
38 diff -u $mydir-reference/"$i" $mydir/"$i"
39 done
40 ;;
41 *)
42 echo "usage: $0 [ reference | compare ]"
43 echo
44 echo "$0 first saves a reference output of all generated files by writerfilter, then"
45 echo "allows comparing against it. This helps seeing the effect of changes made on"
46 echo "the code generator scripts."
47 ;;
48 esac
49
50 # vi:set shiftwidth=4 expandtab: