add wannabuild_merge.sh
[debian-r-master.git] / wannabuild_merge.sh
1 #!/bin/bash
2 #set -x
3 PATH="$PATH:/usr/local/bin"
4 for dist in squeeze sid; do
5     packages_all=""
6     sources="Sources_r_${dist}.gz"
7     wget -q -O Sources_r_${dist}.gz http://debian-r.int.donarmstrong.com/debian-r/dists/${dist}/main/source/Sources.gz
8     wget -q -O Packages_r_all_${dist}.gz http://debian-r.int.donarmstrong.com/debian-r/dists/${dist}/main/binary-all/Packages.gz
9     packages_all="Packages_r_all_${dist}.gz"
10     if [ "$dist" != "stable" ]; then
11         wget -q -O Packages_all_${dist}.gz http://debian.int.donarmstrong.com/debian/dists/${dist}/main/binary-all/Packages.gz
12         packages_all="$packages_all Packages_all_${dist}.gz"
13     fi;
14     for arch in amd64 i386; do
15         packages_arch=""
16         wget -q -O Packages_r_${arch}_${dist}.gz http://debian-r.int.donarmstrong.com/debian-r/dists/${dist}/main/binary-${arch}/Packages.gz
17         packages_arch="$packages_arch Packages_r_${arch}_${dist}.gz"
18         wget -q -O Packages_${arch}_${dist}.gz http://debian.int.donarmstrong.com/debian/dists/${dist}/main/binary-${arch}/Packages.gz
19         packages_arch="$packages_arch Packages_${arch}_${dist}.gz"
20         # wanna-build --verbose -A ${arch} -d ${dist} --merge-v3 Packages_r_all_${dist}.gz Packages_all_${dist}.gz Packages_${arch}_${dist}.gz Packages_r_${arch}_${dist}.gz . Sources_r_${dist}.gz
21         wanna-build -A ${arch} -d ${dist} --merge-v3 $packages_all $packages_arch . $sources >/dev/null 2>&1
22         rm -f $packages_arch
23     done;
24     rm -f $packages_all $sources
25 done;
26 for arch in amd64 i386; do
27 #       wanna-build -l build-attempted -A $arch|awk '/_/{print $1}'|awk -F/ '{print $2}'|xargs wanna-build --give-back -A $arch --override >/dev/null 2>&1
28         for state in built building build-attempted; do
29                 wanna-build -l $state -A $arch --min-age 10 |awk '/_/{print $1}'|awk -F/ '{print $2}'|xargs wanna-build --give-back -A $arch --override >/dev/null 2>&1
30         done;
31 done;