[BACK]Return to cvsweb.cgi CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / cvsweb

Diff for /cvsweb/cvsweb.cgi between version 1.14 and 1.26

version 1.14, 1998/01/12 16:27:14 version 1.26, 1998/11/10 19:26:16
Line 3 
Line 3 
 # cvsweb - a CGI interface to the CVS tree.  # cvsweb - a CGI interface to the CVS tree.
 #  #
 # Written by Bill Fenner <fenner@parc.xerox.com> on his own time.  # Written by Bill Fenner <fenner@parc.xerox.com> 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.25 1998/08/24 16:41:42 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  #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  #SERVER_NAME: www.freebsd.org
 #QUERY_STRING: baz  #QUERY_STRING: baz
Line 34  require 'cgi-style.pl';
Line 61  require 'cgi-style.pl';
   
 %CVSROOT = (  %CVSROOT = (
             'freebsd', '/home/ncvs',              'freebsd', '/home/ncvs',
             'openbsd', '/home/OpenBSD/cvs',  
             'learn', '/c/learncvs',              'learn', '/c/learncvs',
             );              );
   
   %CVSROOTdescr = (
               'freebsd', 'FreeBSD',
               'learn', 'Learn',
               );
   
   %mirrors = (
               'Germany', 'http://www.de.freebsd.org/cgi/cvsweb.cgi',
               'Japan', 'http://www.jp.freebsd.org/cgi/cvsweb.cgi',
              );
   
 $cvstreedefault = 'freebsd';  $cvstreedefault = 'freebsd';
 $cvstree = $cvstreedefault;  $cvstree = $cvstreedefault;
 $cvsroot = $CVSROOT{"$cvstree"} || "/home/ncvs";  $cvsroot = $CVSROOT{"$cvstree"} || "/home/ncvs";
Line 57  display diffs between arbitrary revisions.
Line 93  display diffs between arbitrary revisions.
 <p>  <p>
 If you would like to use this CGI script on your own web server and  If you would like to use this CGI script on your own web server and
 CVS tree, see <A HREF=\"http://www.freebsd.org/~fenner/cvsweb/\">  CVS tree, see <A HREF=\"http://www.freebsd.org/~fenner/cvsweb/\">
 the CVSWeb distribution site</A>.  the CVSWeb distribution site</A> or the <a
   href=\"http://www.freebsd.org/cgi/cvsweb.cgi/www/data/cgi/cvsweb.cgi\">current</a> FreeBSD version.
 <p>  <p>
 Please send any suggestions, comments, etc. to  Please send any suggestions, comments, etc. to
 <A HREF=\"mailto:fenner\@freebsd.org\">Bill Fenner &lt;fenner\@freebsd.org&gt;</A>  <A HREF=\"mailto:fenner\@freebsd.org\">Bill Fenner &lt;fenner\@freebsd.org&gt;</A>
Line 107  if (!-d $cvsroot) {
Line 144  if (!-d $cvsroot) {
 }  }
   
   
   {
       local(@foo, $i);
       local($scriptname) = $ENV{'SCRIPT_NAME'};
       foreach (sort keys %CVSROOT) {
           if (-d $CVSROOT{$_}) {
               push(@foo, $_);
           }
       }
       if ($#foo > 1) {
           $intro .= "<p>\nThis script support the following CVS trees:\n";
           for($i = 0; $i <= $#foo; $i++) {
               $intro .= qq{<a href="$scriptname?cvsroot=$foo[$i]">} .
                   ($CVSROOTdescr{$foo[$i]} ?
                    $CVSROOTdescr{$foo[$i]} : $foo[$i]) . qq{</a>} .
                        ($i == $#foo  ? ".\n" : ",\n");
           }
       }
   }
   
   
   {
       local(@mirrors) = sort keys %mirrors;;
       if ($#mirrors >= 0) {
           $intro .= "<p>\nThis script is mirrored in:\n";
           local($m);
           for($m = 0; $m <= $#mirrors; $m++) {
               $intro .= qq(<a href="$mirrors{$mirrors[$m]}">$mirrors[$m]</a>);
               $intro .= ',' if $m != $#mirrors;
               $intro .= "\n";
           }
       }
   }
   
   
 if (-d $fullname) {  if (-d $fullname) {
         opendir(DIR, $fullname) || &fatal("404 Not Found","$where: $!");          opendir(DIR, $fullname) || &fatal("404 Not Found","$where: $!");
         @dir = readdir(DIR);          @dir = readdir(DIR);
Line 118  if (-d $fullname) {
Line 189  if (-d $fullname) {
             print &html_header("/$where");              print &html_header("/$where");
             print $shortinstr;              print $shortinstr;
         }          }
         print "<p>Current directory: <b>/$where</b>\n";          print "<p>";
           print "Current CVS tree: <b>",
                   ($CVSROOTdescr{"$cvstree"} ? $CVSROOTdescr{"$cvstree"} :
                           $cvstree), "</b><br>\n";
           print "Current directory: <b>/$where</b>\n";
         print "<P><HR NOSHADE>\n";          print "<P><HR NOSHADE>\n";
         # Using <MENU> in this manner violates the HTML2.0 spec but          # Using <MENU> in this manner violates the HTML2.0 spec but
         # provides the results that I want in most browsers.  Another          # provides the results that I want in most browsers.  Another
Line 142  if (-d $fullname) {
Line 217  if (-d $fullname) {
             if ($_ eq '.') {              if ($_ eq '.') {
                 next;                  next;
             }              }
               # ignore CVS lock and stale NFS files
               next if /^#cvs\.|^,|^\.nfs/;
   
             if (s|^Attic/||) {              if (s|^Attic/||) {
                 $attic = " (in the Attic)";                  $attic = " (in the Attic)";
             } else {              } else {

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.26

CVSweb