1#!/bin/sh
2# Watch the CVS repository for changes in trf, retrieve the
3# changed files and invoke the handler script which propagate the
4# changes to other parts of the system.
5
6cd `dirname $0`/..
7
8export CVSROOT
9CVSROOT=:pserver:anonymous@cvs1:/cvsroot/trf
10
11if [ 0 -lt `cvs -d $CVSROOT diff trf 2>/dev/null | wc -l` ]
12then
13	out=$HOME/logs/trf
14	mkdir -p `dirname $out`
15
16	cvs -d $CVSROOT co trf >$out 2>&1
17	mkdir -p trf/htdocs/state
18
19        # Use a new htdocs_setup script immediately.
20        # Without this copying it would take effect
21        # only after with the change after the current
22        # one.
23
24        cp ./trf/tools/htdocs_setup ./tools/htdocs_setup
25
26	(sleep 60 ; ./tools/htdocs_setup ) &
27fi
28exit
29