fix Port-O-Launch
[divverent/nexuiz.git] / misc / csqcarchive.sh
1 #!/bin/sh
2
3 set -e
4
5 make crc16
6 crc16=`pwd`/crc16
7 out=`pwd`/csqcarchive.zip
8
9 t=`mktemp -dt csqcarchive.XXXXXX`
10 cd "$t"
11
12 revs()
13 {
14         {
15                 svn log svn://svn.icculus.org/nexuiz/$1/data/qcsrc/common
16                 echo
17                 svn log svn://svn.icculus.org/nexuiz/$1/data/qcsrc/client
18         } | {
19                 while IFS= read -r LINE; do
20                         if [ "$LINE" = "------------------------------------------------------------------------" ]; then
21                                 read -r REV REST
22                                 case "$REV" in
23                                         r*)
24                                                 echo ${REV#r}
25                                                 ;;
26                                 esac
27                         fi
28                 done
29         } | sort -n
30 }
31
32 rm -f "$out"
33 for repo in branches/nexuiz-2.0 trunk; do
34         for rev in `revs $repo`; do
35                 if [ "$rev" -lt 3789 ]; then
36                         continue
37                 fi
38                 svn checkout -r"$rev" svn://svn.icculus.org/nexuiz/$repo/data/qcsrc
39                 rm -f Makefile csprogs.dat
40                 wget -OMakefile "http://svn.icculus.org/*checkout*/nexuiz/$repo/data/Makefile?revision=$rev" || continue
41                 make csprogs.dat || continue
42                 nm="csprogs.dat.`$crc16 < csprogs.dat`"
43                 mv csprogs.dat "$nm"
44                 zip -9r "$out" "$nm"
45         done
46 done