#!/bin/bash
set -a
shopt -s extglob 
shopt -s nullglob

tfd=${TWIKI_FREETOWN_DIST:-$HOME/.twiki_freetown_dist}
err () { echo "$*"; exit 1; }

if ! test -e $tfd/MAIN/twiki_httpd_conf.txt; then err "No $tfd/MAIN found!";fi
if ! test -e $tfd/twikiplugins/TocPlugin/data/TWiki/TocPlugin.txt; then 
   err "No $tfd/twikiplugins found!"
else
   pv=`cd $tfd/twikiplugins;svn info|grep '^Revision: '|sed -e 's/.* //'`
   mv=`sed -n -e "/^[ 	]*[$]RELEASE = /s/^[^']*[']\([^']*\)['].*/\1/p" <$tfd/MAIN/lib/TWiki.pm`
   echo "${mv// /-} $pv"
fi
