testprogs: Remove dnshostname related test from test_net_ads.sh
[samba4-gss.git] / buildtools / compare_generated.sh
blobe626579581397fa20dacd5c70e56d50918a5716a
1 #!/bin/sh
3 # compare the generated files from a waf
5 old_build=$HOME/samba_old
7 gen_files=$(cd bin/default && find . -type f -name '*.[ch]')
9 2>&1
11 strip_file()
13 in_file=$1
14 out_file=$2
15 cat $in_file |
16 grep -v 'The following definitions come from' |
17 grep -v 'Automatically generated at' |
18 grep -v 'Generated from' |
19 sed 's|/home/tnagy/samba/source4||g' |
20 sed 's|/home/tnagy/samba/|../|g' |
21 sed 's|bin/default/source4/||g' |
22 sed 's|bin/default/|../|g' |
23 sed 's/define _____/define ___/g' |
24 sed 's/define __*/define _/g' |
25 sed 's/define _DEFAULT_/define _/g' |
26 sed 's/define _SOURCE4_/define ___/g' |
27 sed 's/define ___/define _/g' |
28 sed 's/ifndef ___/ifndef _/g' |
29 sed 's|endif /* ____|endif /* __|g' |
30 sed s/__DEFAULT_SOURCE4/__/ |
31 sed s/__DEFAULT_SOURCE4/__/ |
32 sed s/__DEFAULT/____/ >$out_file
35 compare_file()
37 f=$f
38 bname=$(basename $f)
39 t1=/tmp/$bname.old.$$
40 t2=/tmp/$bname.new.$$
41 strip_file $old_build/$f $t1
42 strip_file bin/default/$f $t2
43 diff -u -b $t1 $t2 2>&1
44 rm -f $t1 $t2
47 for f in $gen_files; do
48 compare_file $f
49 done