]> git.donarmstrong.com Git - cran2deb.git/blob - trunk/exec/build_some
From Plan 9 shell to BASH. Works.
[cran2deb.git] / trunk / exec / build_some
1 #!/bin/bash
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 ]; then
12     cran2deb cran_pkgs $* >all_pkgs
13 fi
14
15 for pkg in $(cat all_pkgs | egrep -v '(\.\.|/)')
16 do
17     if [ -e warn/$pkg ]; then
18         echo "skipping $pkg [warned] ..."
19     elif [ -e fail/$pkg ]; then
20         echo "skipping $pkg [fails] ..."
21     else 
22         echo -n .. package $pkg
23         if cran2deb build $pkg >fail/$pkg 2>&1; then
24             grep '^[WE]:' fail/$pkg >warn/$pkg
25 #            if (~ `{stat -c '%s' warn/$pkg} 0) {
26 #                rm -f warn/$pkg
27 #            }
28            if grep -q '^E:' warn/$pkg; then
29                echo ' failure'
30            else
31                echo ' success'
32                rm -f fail/$pkg
33            fi
34         else
35             echo " FAILED"
36         fi
37     fi
38 done