--- /dev/null
+#!/bin/bash
+
+# this script is a wrapper around the module-tools (version and diff)
+# it is invoked every 30 minutes on onelab build box
+# prior to that, the following directories will have been svn updated :
+# /root/svn-build
+# /root/svn-build-4.2
+
+OUTPUT=/build/modules
+
+# usage: do_version name dir
+function do_version () {
+ name=$1; shift
+ build_dir=$1; shift
+
+ out_dir=$OUTPUT/$name
+ out_file=$out_dir/version.txt
+ out_tmp=$out_file.new
+
+ mkdir -p $out_dir
+
+ ( echo $name ; \
+ date ; \
+ $build_dir/module-version -a ; \
+ date ) > $out_tmp
+ mv -f $out_tmp $out_file
+}
+
+# usage: do_version name dir
+function do_diff () {
+ name=$1; shift
+ build_dir=$1; shift
+
+ out_dir=$OUTPUT/$name
+ out_file=$out_dir/version.txt
+ out_tmp=$out_file.new
+
+ mkdir -p $out_dir
+
+ ( echo $name ; \
+ date ; \
+ $build_dir/module-diff -a -o -q ; \
+ date ) > $out_tmp
+
+ ( echo 'WARNINGS (if any)' ; \
+ egrep 'was not found|Skipping failed' $out_tmp ;
+ cat $out_tmp ) > $out_file
+}
+
+do_version trunk /root/svn-build
+do_diff trunk /root/svn-build
+do_version 4.2 /root/svn-build-4.2
+do_diff 4.2 /root/svn-build-4.2