]> git.donarmstrong.com Git - cran2deb.git/blob - trunk/exec/build_some
7b9e96f560be4a54f9cbc23bcf47c6913e2d189d
[cran2deb.git] / trunk / exec / build_some
1 #!/usr/bin/rc
2 ## DOC: cran2deb build_some [taskview1 taskview2 ...]
3 ## DOC:     build some packages, logging warnings into ./warn/$package
4 ## DOC:     and failures into ./fail/$package. with no arguments a random
5 ## DOC:     sample of packages is built.  the file ./all_pkgs overrides this
6 ## DOC:     behaviour and is expected to be a list of packages to build.
7 ## DOC:
8
9 mkdir -p warn fail
10 shift
11 if ([ ! -e all_pkgs ]) {
12     cran2deb cran_pkgs $* >all_pkgs
13 }
14
15 for (pkg in `{cat all_pkgs}) {
16     if (~ $pkg *..* */*) {
17         echo bad name $pkg >>fail/ERROR
18     } else if ([ -e warn/$pkg ]) {
19         echo skipping $pkg...
20     } else if ([ -e fail/$pkg ]) {
21         echo skipping failed $pkg...
22     } else {
23         echo -n .. package $pkg
24         fail=0
25         cran2deb build $pkg >fail/$pkg >[2=1] || fail=1
26         if (~ $fail 0) {
27             grep '^[WE]:' fail/$pkg >warn/$pkg
28 #            if (~ `{stat -c '%s' warn/$pkg} 0) {
29 #                rm -f warn/$pkg
30 #            }
31            if ( grep -q '^E:' warn/$pkg) {
32                echo ' failure'
33            } else {
34                echo ' success'
35                rm -f fail/$pkg
36            }
37         } else {
38             echo " FAILED"
39         }
40     }
41 }