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