#!/bin/bash ## DOC: cran2deb build_some [taskview1 taskview2 ...] ## DOC: build some packages, logging warnings into ./warn/$package ## DOC: and failures into ./fail/$package. with no arguments a random ## DOC: sample of packages is built. the file ./all_pkgs overrides this ## DOC: behaviour and is expected to be a list of packages to build. ## DOC: mkdir -p warn fail shift if [ ! -e all_pkgs ]; then cran2deb cran_pkgs $* >all_pkgs fi for pkg in $(cat all_pkgs | egrep -v '(\.\.|/)') do if [ -e warn/$pkg ]; then echo "skipping $pkg [warned] ..." elif [ -e fail/$pkg ]; then echo "skipping $pkg [fails] ..." else echo -n .. package $pkg if cran2deb build $pkg >fail/$pkg 2>&1; then grep '^[WE]:' fail/$pkg >warn/$pkg # if (~ `{stat -c '%s' warn/$pkg} 0) { # rm -f warn/$pkg # } if grep -q '^E:' warn/$pkg; then echo ' failure' else echo ' success' rm -f fail/$pkg fi else echo " FAILED" fi fi done