4 # as the svn diff operations from a remote location are so sssssslllllllooooooooowwwwww...
6 # maintain codebase in onelab.eu for historical reasons
7 # (1) push scripts on princeton (manually run all-modules-update.sh)
8 # (2) run the scripts cyclically over there through cron
9 # and push the results on build.onelab.eu with all-modules.push.sh (as part of the cron job)
11 # this script is a wrapper around the module-tools (version and diff)
12 # it is invoked cyclically
13 # prior to that, the following directories will have been svn updated :
15 # ~/root/svn-build-4.2
17 # avoid running several instances of this script
18 # when the svn server has problems, this can very well last quite a while
20 COMMAND=$(basename $0)
22 # make the command usable as non-root user at Princeton for more efficiency
23 if [ "$(id -u)" == "0" ] ; then
24 OUTPUT=/build/modules/slow
25 LOCK=/var/run/all-modules.pid
29 LOCK=~/all-modules.run
30 # make sure the cyclic tasks do not interfere with manual usage
31 MODULES_OPTION="-w ${HOME}/all-modules-working-dir"
34 function do_update() {
36 if [ -f $build_dir/auto-update.sh ] ; then
37 $build_dir/auto-update.sh
39 ( cd $build_dir; svn update > .update.log 2>&1 )
43 # usage: do_version dir name
44 function do_version () {
49 out_file=$out_dir/version.html
50 out_tmp=$out_dir/.version.html
53 $build_dir/module-version $MODULES_OPTION --www $name -a &> $out_tmp
54 mv -f $out_tmp $out_file
57 # usage: do_version dir name
63 out_file=$out_dir/diff.html
64 out_tmp=$out_dir/.diff.html
67 $build_dir/module-diff $MODULES_OPTION --www $name -a &> $out_tmp
68 mv -f $out_tmp $out_file
73 echo "Usage: $COMMAND [-v] [-f] [-i]"
78 while [[ -n "$@" ]] ; do
81 -i) ls -l $LOCK ; exit 0 ;;
88 [ -f $LOCK ] && exit 1
93 do_version ~/svn-build 5.0
94 do_diff ~/svn-build 5.0
95 do_update ~/svn-build-4.3
96 do_version ~/svn-build-4.3 4.3
97 do_diff ~/svn-build-4.3 4.3