=================================================================== RCS file: /cvs/cvsweb/cvsweb.cgi,v retrieving revision 1.11 retrieving revision 1.17 diff -u -p -r1.11 -r1.17 --- cvsweb/cvsweb.cgi 1997/11/15 16:48:07 1.11 +++ cvsweb/cvsweb.cgi 1998/05/05 16:05:32 1.17 @@ -36,8 +36,16 @@ require 'cgi-style.pl'; 'freebsd', '/home/ncvs', 'openbsd', '/home/OpenBSD/cvs', 'learn', '/c/learncvs', + 'mozilla', '/a/mozilla-cvs', ); +%CVSROOTdescr = ( + 'freebsd', 'FreeBSD', + 'openbsd', 'OpenBSD', + 'learn', 'Learn', + 'mozilla', 'Mozilla FreeBSD', + ); + $cvstreedefault = 'freebsd'; $cvstree = $cvstreedefault; $cvsroot = $CVSROOT{"$cvstree"} || "/home/ncvs"; @@ -57,7 +65,8 @@ display diffs between arbitrary revisions.
If you would like to use this CGI script on your own web server and CVS tree, see -the CVSWeb distribution site. +the CVSWeb distribution site or the current FreeBSD version.
Please send any suggestions, comments, etc. to Bill Fenner <fenner\@freebsd.org> @@ -76,7 +85,6 @@ $scriptname =~ s|/$||; $scriptwhere = $scriptname . '/' . $where; $scriptwhere =~ s|/$||; - if ($query = $ENV{'QUERY_STRING'}) { foreach (split(/&/, $query)) { s/%(..)/sprintf("%c", hex($1))/ge; # unquote %-quoted @@ -102,11 +110,32 @@ if ($input{'cvsroot'}) { do "$config-$cvstree" if -f "$config-$cvstree"; $fullname = $cvsroot . '/' . $where; + if (!-d $cvsroot) { - &fatal("500 Internal Error",'$CVSROOT not found!'); + &fatal("500 Internal Error",'$CVSROOT not found!
The server on which the CVS tree lives is probably down. Please try again in a few minutes.'); } +{ + local(@foo, $i); + local($scriptname) = $ENV{'SCRIPT_NAME'}; + foreach (keys %CVSROOT) { + if (-d $CVSROOT{$_}) { + push(@foo, $_); + } + } + if ($#foo > 1) { + $intro .= "
\nThis script support the following CVS trees:\n"; + for($i = 0; $i <= $#foo; $i++) { + $intro .= qq{} . + ($CVSROOTdescr{$foo[$i]} ? + $CVSROOTdescr{$foo[$i]} : $foo[$i]) . qq{} . + ($i == $#foo ? ".\n" : ",\n"); + } + } +} + + if (-d $fullname) { opendir(DIR, $fullname) || &fatal("404 Not Found","$where: $!"); @dir = readdir(DIR); @@ -118,7 +147,10 @@ if (-d $fullname) { print &html_header("/$where"); print $shortinstr; } - print "
Current directory: /$where\n"; + print "
";
+ print "Current CVS tree: $cvstree
\n"
+ if $cvstree ne $cvstreedefault;
+ print "Current directory: /$where\n";
print "