first draft
authorthierry <thierry@41d37cc5-eb28-0410-a9bf-d37491348ade>
Tue, 10 Jun 2008 08:23:20 +0000 (08:23 +0000)
committerthierry <thierry@41d37cc5-eb28-0410-a9bf-d37491348ade>
Tue, 10 Jun 2008 08:23:20 +0000 (08:23 +0000)
scripts/all-modules.sh [new file with mode: 0755]

diff --git a/scripts/all-modules.sh b/scripts/all-modules.sh
new file mode 100755 (executable)
index 0000000..a2854ea
--- /dev/null
@@ -0,0 +1,53 @@
+#!/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