#!/usr/local/bin/perl
#
# get cvs diffs
#
# $Id: showdiff.cgi,v 1.1 1999/01/09 08:56:58 cjh Exp cjh $
# $Log: showdiff.cgi,v $
# Revision 1.1  1999/01/09 08:56:58  cjh
# Initial revision
#

# configuration

# sgml path of CVS repository
$checkoutpath="/home/dipper/doc/handbook";
$modulepath="doc/handbook";
$cvsroot="/kfug/ncvs";
$cvsrdiffcmd="cvs -n -d $cvsroot rdiff";

# end of configuration

use CGI;
$query=new CGI;
print $query->header("text/plain");

$file=$query->param('file');		# file name
$r1=$query->param('r1');		# old version
$r2=$query->param('r2');		# new version

if ($file eq "" || $r1 eq "" || $r2 eq "") {
	exit;
}

chdir $checkoutpath;
open DIFF,"$cvsrdiffcmd -r$r1 -r$r2 -u $modulepath/$file|";
#print "$cvsrdiffcmd -r$r1 -r$r2 -u $modulepath/$file";

while(<DIFF>)
{
  print $_;
}

1;
