summaryrefslogtreecommitdiff
path: root/buildtools/mktowscript/rebuild_all.sh
blob: 5209eee50bdf4921c72e1a860193147068476d6f (plain)
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
27
28
29
#!/bin/bash

cat mklist.txt |
while read f; do
    echo "Processing $f"
    f="../../$f"
    test -f $f || {
	echo "$f doesn't exist"
	exit 1
    }
    ws="$(dirname $f)/wscript_build"
    if [ -f $ws ]; then
	if ! grep "AUTOGENERATED.by.mktowscript" $ws > /dev/null; then
	    echo "Skipping manually edited file $ws"
	    continue
	fi
    fi
    ./mktowscript.pl $f > wscript_build.$$ || {
	echo "Failed on $f"
	rm -f wscript_build.$$
	exit 1
    }
    if cmp wscript_build.$$ $ws > /dev/null 2>&1; then
	rm -f wscript_build.$$
    else
	mv wscript_build.$$ $ws || exit 1
    fi
    #exit 1
done