3 # reviewed in dec. 2010
4 # moving back to running on the EU side
6 # this script is a wrapper around the module-tools (version and diff)
7 # it is invoked cyclically
8 # prior to that, the following directories will have been svn updated :
11 # avoid running several instances of this script
12 # when the svn server has problems, this can very well last quite a while
14 COMMAND=$(basename $0)
16 # running as root on liquid
18 LOCK=~/all-modules.run
19 # make sure the cyclic tasks do not interfere with manual usage
20 # (i.e. do not use ~/modules)
21 WORKDIR_GIT=${HOME}/all-modules-git
22 ########## sample config running on liquid
23 #svnpath=http://svn.planet-lab.org/svn/
24 #gitserver=git.onelab.eu
27 #username=not-needed-as-we-dont-write
28 #email=not-needed-as-we-dont-write
31 function do_update() {
33 if [ -f $build_dir/auto-update.sh ] ; then
34 $build_dir/auto-update.sh
35 elif [ -d $build_dir/.git ] ; then
36 ( cd $build_dir; git pull > .update.log 2>&1 )
38 ( cd $build_dir; svn update > .update.log 2>&1 )
42 # usage: do_version dir workdir wwwname
43 function do_version () {
48 out_dir=$OUTPUT/$wwwname
49 out_file=$out_dir/version.html
50 out_tmp=$out_dir/.version.html
53 $build_dir/module-version $VERBOSE -w $workdir --www $wwwname -a &> $out_tmp
54 mv -f $out_tmp $out_file
57 # usage: do_version dir workdir wwwname
63 out_dir=$OUTPUT/$wwwname
64 out_file=$out_dir/diff.html
65 out_tmp=$out_dir/.diff.html
68 $build_dir/module-diff $VERBOSE -w $workdir --www $wwwname -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 ;;
83 -v) set -x ; VERBOSE=-v ;;
89 [ -f $LOCK ] && exit 1
94 do_version ~/git-build $WORKDIR_GIT 5.0
95 do_diff ~/git-build $WORKDIR_GIT 5.0
103 ########################################
104 # this applied to the older version that was running at princeton
106 # as the svn diff operations from a remote location are so sssssslllllllooooooooowwwwww...
108 # maintain codebase in onelab.eu for historical reasons
109 # (1) push scripts on princeton (manually run all-modules-update.sh)
110 # (2) run the scripts cyclically over there through cron
111 # and push the results on build.onelab.eu with all-modules.push.sh (as part of the cron job)