]> git.donarmstrong.com Git - cran2deb.git/commitdiff
From Plan 9 shell to BASH. Works.
authormoeller <moeller@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Tue, 8 Feb 2011 15:49:34 +0000 (15:49 +0000)
committermoeller <moeller@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>
Tue, 8 Feb 2011 15:49:34 +0000 (15:49 +0000)
git-svn-id: svn://svn.r-forge.r-project.org/svnroot/cran2deb@339 edb9625f-4e0d-4859-8d74-9fd3b1da38cb

trunk/exec/build_some

index 7b9e96f560be4a54f9cbc23bcf47c6913e2d189d..facf92b3b50096a8b0656b0da292e2986c1928fb 100755 (executable)
@@ -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