parse file line by line rather than loading entire file into memory.
[build-farm.git] / revs.sh
diff --git a/revs.sh b/revs.sh
index b4ec6a6e15e6a315f9d7a88cbbf71db3c4b05c13..e8733d96bcd00b8c65a65182c63f7d76cf6f50b1 100755 (executable)
--- a/revs.sh
+++ b/revs.sh
@@ -1,37 +1,8 @@
-#!/bin/sh
+#!/bin/bash
 
-if [ $# > 0 ]; then
-    if [ x"$1" = x"-h" ] || [ x"$1" = x"--help" ]; then
-       echo "Usage: revs.sh"
-       echo
-       echo "Maintains the previous revision information used on the build"
-       echo "farm, as well as removing any stale build data."
-       exit 1
-    fi
-fi
+export PATH=$PATH:/usr/local/bin
 
-cd data || exit 1
+ulimit -v 300000
+ulimit -m 300000
 
-mkdir -p oldrevs
-
-for f in `find . -maxdepth 1 -type f -name "*.log" -links 1`; do
-    rev=`cat $f | egrep ^BUILD.REVISION | awk '{print $3}' | head -1`
-    test -z "$rev" && rev=0;
-
-    base=`basename $f .log`
-    log_revname="oldrevs/$base-$rev.log"
-    err_revname="oldrevs/$base-$rev.err"
-
-    rm -f $log_revname $err_revname
-    ln -f $base.log $log_revname
-    ln -f $base.err $err_revname
-
-    # possibly mail the culprits if the build broke
-    ../analyse.pl $base.log
-done
-
-# delete really old ones
-find oldrevs -type f -mtime +5 -links 1 | xargs rm -f
-
-# delete old cache data
-find ../cache -type f -name "build.*" -mtime +1 | xargs rm -f
+./import-and-analyse.py