===================================================================
RCS file: /cvs/cvsweb/cvsweb.cgi,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -p -r1.9 -r1.10
--- cvsweb/cvsweb.cgi 1997/07/19 00:54:40 1.9
+++ cvsweb/cvsweb.cgi 1997/11/14 17:36:47 1.10
@@ -31,7 +31,17 @@ require 'ctime.pl';
$hsty_base = "";
require 'cgi-style.pl';
-$cvsroot = '/home/ncvs';
+%CVSROOT = (
+ 'freebsd', '/home/ncvs',
+ 'openbsd', '/home/OpenBSD/cvs',
+ 'learn', '/c/learncvs',
+ );
+
+$cvstreedefault = 'freebsd';
+$cvstree = $cvstreedefault;
+$cvsroot = $CVSROOT{"$cvstree"} || "/home/ncvs";
+
+
$intro = "
This is a WWW interface to the FreeBSD CVS tree.
You can browse the file hierarchy by picking directories
@@ -49,7 +59,7 @@ CVS tree, see .
Please send any suggestions, comments, etc. to
-Bill Fenner <fenner@freebsd.org>
+Bill Fenner <fenner\@freebsd.org>
";
$shortinstr = "
Click on a directory to enter that directory. Click on a file to display
@@ -60,15 +70,11 @@ chance to display diffs between revisions.
$verbose = $v;
($where = $ENV{'PATH_INFO'}) =~ s|^/||;
$where =~ s|/$||;
-$fullname = $cvsroot . '/' . $where;
($scriptname = $ENV{'SCRIPT_NAME'}) =~ s|^/?|/|;
$scriptname =~ s|/$||;
$scriptwhere = $scriptname . '/' . $where;
$scriptwhere =~ s|/$||;
-if (!-d $cvsroot) {
- &fatal("500 Internal Error",'$CVSROOT not found!');
-}
if ($query = $ENV{'QUERY_STRING'}) {
foreach (split(/&/, $query)) {
@@ -81,6 +87,22 @@ if ($query = $ENV{'QUERY_STRING'}) {
}
$query = "?" . $query;
}
+
+
+
+if ($input{'cvsroot'}) {
+ if ($CVSROOT{$input{'cvsroot'}}) {
+ $cvstree = $input{'cvsroot'};
+ $cvsroot = $CVSROOT{"$cvstree"};
+ }
+}
+
+$fullname = $cvsroot . '/' . $where;
+if (!-d $cvsroot) {
+ &fatal("500 Internal Error",'$CVSROOT not found!');
+}
+
+
if (-d $fullname) {
opendir(DIR, $fullname) || &fatal("404 Not Found","$where: $!");
@dir = readdir(DIR);
@@ -344,7 +366,8 @@ if (-d $fullname) {
$nameprinted{$br}++;
}
print "\n";
- print "$_";
+ print "$_};
if (/^1\.1\.1\.\d+$/) {
print " (vendor branch)";
}
@@ -387,7 +410,7 @@ if (-d $fullname) {
if ($prevrev[$#prevrev] != 0) {
$prev = join(".", @prevrev);
print "
Diffs to $prev\n";
+ print "&r2=$_" . &cvsroot . qq{">Diffs to $prev
\n"; print "