(no commit message)
[infrastructure.git] / scripts / all-modules.sh
1 #!/bin/bash
2 # $Id$
3 # this script is a wrapper around the module-tools (version and diff)
4 # it is invoked every 30 minutes on onelab build box
5 # prior to that, the following directories will have been svn updated :
6 # /root/svn-build
7 # /root/svn-build-4.2
8
9 OUTPUT=/build/modules
10
11 # usage: do_version dir name 
12 function do_version () {
13     build_dir=$1; shift
14     name=$1; shift
15
16     out_dir=$OUTPUT/$name
17     out_file=$out_dir/version.txt
18     out_tmp=$out_file.new
19     
20     mkdir -p $out_dir
21     
22     ( echo $name ; \
23       date ; \
24       $build_dir/module-version -a ; \
25       date ) > $out_tmp
26     mv -f $out_tmp $out_file
27 }
28
29 # usage: do_version dir name 
30 function do_diff () {
31     build_dir=$1; shift
32     name=$1; shift
33
34     out_dir=$OUTPUT/$name
35     out_file=$out_dir/version.txt
36     out_tmp=$out_file.new
37     
38     mkdir -p $out_dir
39     
40     ( echo $name ; \
41       date ; \
42       $build_dir/module-diff -a -o -q ; \
43       date ) > $out_tmp
44
45     ( echo 'WARNINGS (if any)' ; \
46       egrep 'was not found|Skipping failed' $out_tmp ;
47       cat $out_tmp ) > $out_file
48 }
49
50 do_version /root/svn-build     trunk 
51 do_diff    /root/svn-build     trunk 
52 do_version /root/svn-build-4.2 4.2 
53 do_diff    /root/svn-build-4.2 4.2