Fix crash when get_gpo_info returns incorrect data.
[Samba.git] / buildtools / mktowscript / rebuild_all.sh
blob23622b2abedb6a90e1c55958d7c312fa2159d494
1 #!/bin/bash
3 cat mklist.txt |
4 while read line; do
5 ws=""
6 list=""
7 for f in $line; do
8 echo "Processing $f"
9 f="../../$f"
10 test -f $f || {
11 echo "$f doesn't exist"
12 exit 1
14 ws="$(dirname $f)/wscript_build"
15 if [ -f $ws ]; then
16 if test -s $ws && ! grep "AUTOGENERATED.by.mktowscript" $ws > /dev/null; then
17 echo "Skipping manually edited file $ws"
18 continue
21 list="$list $f"
22 done
23 if [ "$list" = "" ]; then
24 continue
26 ./mktowscript.pl $list > wscript_build.$$ || {
27 echo "Failed on $f"
28 rm -f wscript_build.$$
29 exit 1
31 if cmp wscript_build.$$ $ws > /dev/null 2>&1; then
32 rm -f wscript_build.$$
33 else
34 mv wscript_build.$$ $ws || exit 1
36 #exit 1
37 done