From 61bf05a93ecf098a5c449ea384468f2a0c6ea46b Mon Sep 17 00:00:00 2001 From: moeller Date: Tue, 8 Feb 2011 15:49:34 +0000 Subject: [PATCH] From Plan 9 shell to BASH. Works. git-svn-id: svn://svn.r-forge.r-project.org/svnroot/cran2deb@339 edb9625f-4e0d-4859-8d74-9fd3b1da38cb --- trunk/exec/build_some | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/trunk/exec/build_some b/trunk/exec/build_some index 7b9e96f..facf92b 100755 --- a/trunk/exec/build_some +++ b/trunk/exec/build_some @@ -1,4 +1,4 @@ -#!/usr/bin/rc +#!/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 @@ -8,34 +8,31 @@ mkdir -p warn fail shift -if ([ ! -e all_pkgs ]) { +if [ ! -e all_pkgs ]; then cran2deb cran_pkgs $* >all_pkgs -} +fi -for (pkg in `{cat all_pkgs}) { - if (~ $pkg *..* */*) { - echo bad name $pkg >>fail/ERROR - } else if ([ -e warn/$pkg ]) { - echo skipping $pkg... - } else if ([ -e fail/$pkg ]) { - echo skipping failed $pkg... - } else { +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 - fail=0 - cran2deb build $pkg >fail/$pkg >[2=1] || fail=1 - if (~ $fail 0) { + 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) { + if grep -q '^E:' warn/$pkg; then echo ' failure' - } else { + else echo ' success' rm -f fail/$pkg - } - } else { + fi + else echo " FAILED" - } - } -} + fi + fi +done -- 2.39.2