=================================================================== RCS file: /cvs/cvsweb/cvsweb.cgi,v retrieving revision 1.13 retrieving revision 1.23 diff -u -p -r1.13 -r1.23 --- cvsweb/cvsweb.cgi 1997/11/19 19:20:22 1.13 +++ cvsweb/cvsweb.cgi 1998/08/15 09:59:11 1.23 @@ -3,8 +3,35 @@ # cvsweb - a CGI interface to the CVS tree. # # Written by Bill Fenner on his own time. -# Insert BSD copyright here. # +# Copyright (c) 1996-1998 Bill Fenner +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $fId: cvsweb.cgi,v 1.22 1998/08/13 10:35:26 wosch Exp $ +# + + #HTTP_USER_AGENT: Mozilla/1.1N (X11; I; SunOS 4.1.3_U1 sun4m) via proxy gateway CERN-HTTPD/3.0 libwww/2.17 #SERVER_NAME: www.freebsd.org #QUERY_STRING: baz @@ -34,10 +61,16 @@ require 'cgi-style.pl'; %CVSROOT = ( 'freebsd', '/home/ncvs', - 'openbsd', '/home/OpenBSD/cvs', 'learn', '/c/learncvs', + 'mozilla', '/a/mozilla-cvs', ); +%CVSROOTdescr = ( + 'freebsd', 'FreeBSD', + 'learn', 'Learn', + 'mozilla', 'Mozilla FreeBSD', + ); + $cvstreedefault = 'freebsd'; $cvstree = $cvstreedefault; $cvsroot = $CVSROOT{"$cvstree"} || "/home/ncvs"; @@ -57,7 +90,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> @@ -107,6 +141,26 @@ if (!-d $cvsroot) { } +{ + local(@foo, $i); + local($scriptname) = $ENV{'SCRIPT_NAME'}; + foreach (sort 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 +172,11 @@ if (-d $fullname) { print &html_header("/$where"); print $shortinstr; } - print "

Current directory: /$where\n"; + print "

"; + print "Current CVS tree: ", + ($CVSROOTdescr{"$cvstree"} ? $CVSROOTdescr{"$cvstree"} : + $cvstree), "
\n"; + print "Current directory: /$where\n"; print "


\n"; # Using in this manner violates the HTML2.0 spec but # provides the results that I want in most browsers. Another @@ -142,6 +200,9 @@ if (-d $fullname) { if ($_ eq '.') { next; } + # ignore CVS lock and stale NFS files + next if /^#cvs\.|^,|^\.nfs/; + if (s|^Attic/||) { $attic = " (in the Attic)"; } else { @@ -642,7 +703,7 @@ sub dolog { if (/^1\.1\.1\.\d+$/) { print " (vendor branch)"; } - print " " . &ctime($date{$_}) . " by "; + print " " . &ctime($date{$_}) . " UTC by "; print "" . $author{$_} . "\n"; if ($revsym{$_}) { print "
CVS Tags: $revsym{$_}";