#!/bin/sh
# Watch the CVS repository for changes in memchan, retrieve the
# changed files and invoke the handler script which propagate the
# changes to other parts of the system.

cd `dirname $0`/..

export CVSROOT
CVSROOT=:pserver:anonymous@cvs.memchan.sourceforge.net:/cvsroot/memchan

if [ 0 -lt `cvs diff memchan 2>/dev/null | wc -l` ]
then
	out=$HOME/logs/memchan
	mkdir -p `dirname $out`

	cvs co memchan >$out 2>&1
	mkdir -p memchan/htdocs/state

        # Use a new htdocs_setup script immediately.
        # Without this copying it would take effect
        # only after with the change after the current
        # one.

        cp ./memchan/tools/htdocs_setup ./tools_setup

	(sleep 60 ; ./tools/htdocs_setup ) &
fi
exit


syntax highlighted by Code2HTML, v. 0.9.1