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

Diff for /cvsweb/cvsweb.cgi between version 1.1.1.19 and 1.1.1.20

version 1.1.1.19, 2001/01/02 12:41:38 version 1.1.1.20, 2001/01/03 03:36:03
Line 43 
Line 43 
 # SUCH DAMAGE.  # SUCH DAMAGE.
 #  #
 # $zId: cvsweb.cgi,v 1.104 2000/11/01 22:05:12 hnordstrom Exp $  # $zId: cvsweb.cgi,v 1.104 2000/11/01 22:05:12 hnordstrom Exp $
 # $kId: cvsweb.cgi,v 1.55 2001/01/02 12:23:20 knu Exp $  # $kId: cvsweb.cgi,v 1.57 2001/01/03 02:55:30 knu Exp $
 #  #
 ###  ###
   
Line 53  use strict;
Line 53  use strict;
   
 use vars qw (  use vars qw (
     $config $allow_version_select $verbose      $config $allow_version_select $verbose
     %CVSROOT %CVSROOTdescr %MIRRORS %DEFAULTVALUE %ICONS %MTYPES      @CVSrepositories @CVSROOT %CVSROOT %CVSROOTdescr
       %MIRRORS %DEFAULTVALUE %ICONS %MTYPES
     @DIFFTYPES %DIFFTYPES @LOGSORTKEYS %LOGSORTKEYS      @DIFFTYPES %DIFFTYPES @LOGSORTKEYS %LOGSORTKEYS
     %alltags @tabcolors %fileinfo %tags @branchnames %nameprinted      %alltags @tabcolors %fileinfo %tags @branchnames %nameprinted
     %symrev %revsym @allrevisions %date %author @revdisplayorder      %symrev %revsym @allrevisions %date %author @revdisplayorder
Line 138  use File::Basename;
Line 139  use File::Basename;
 # Locations to search for user configuration, in order:  # Locations to search for user configuration, in order:
 for (  for (
      (dirname $0) . '/cvsweb.conf',       (dirname $0) . '/cvsweb.conf',
      '/usr/local/etc/cvsweb.conf'       '/usr/local/etc/cvsweb/cvsweb.conf'
     ) {      ) {
     if (defined($_) && -r $_) {      if (defined($_) && -r $_) {
         ($config) = /(.*)/; # untaint          ($config) = /(.*)/; # untaint
Line 155  $allow_version_select = 1;
Line 156  $allow_version_select = 1;
   
 ######## Configuration variables #########  ######## Configuration variables #########
 # These are defined to allow checking with perl -cw  # These are defined to allow checking with perl -cw
 %CVSROOT = %MIRRORS = %DEFAULTVALUE = %ICONS = %MTYPES =  @CVSrepositories = @CVSROOT = %CVSROOT =
   %MIRRORS = %DEFAULTVALUE = %ICONS = %MTYPES =
 %tags = %alltags = @tabcolors = ();  %tags = %alltags = @tabcolors = ();
 $cvstreedefault = $body_tag = $body_tag_for_src =  $cvstreedefault = $body_tag = $body_tag_for_src =
 $logo = $defaulttitle = $address =  $logo = $defaulttitle = $address =
Line 359  else {
Line 361  else {
 }  }
 undef @barequery;  undef @barequery;
   
   if (defined($input{path})) {
       redirect("$scriptname/$input{path}$query");
   }
   
 # get actual parameters  # get actual parameters
 $sortby = $input{"sortby"};  $sortby = $input{"sortby"};
 $bydate = 0;  $bydate = 0;
Line 386  $defaultDiffType = $input{'f'};
Line 392  $defaultDiffType = $input{'f'};
   
 $logsort = $input{'logsort'};  $logsort = $input{'logsort'};
   
   my @tmp = @CVSrepositories;
   my @pair;
   
   while (@pair = splice(@tmp, 0, 2)) {
       my($key, $val) = @pair;
       my($descr, $cvsroot) = @$val;
   
       next if !-d $cvsroot;
   
       $CVSROOTdescr{$key} = $descr;
       $CVSROOT{$key} = $cvsroot;
       push @CVSROOT, $key;
   }
   undef @tmp;
   undef @pair;
   
 ## Default CVS-Tree  ## Default CVS-Tree
 if (!defined($CVSROOT{$cvstreedefault})) {  if (!defined($CVSROOT{$cvstreedefault})) {
    &fatal("500 Internal Error",     &fatal("500 Internal Error",
Line 459  if (-d $fullname) {
Line 480  if (-d $fullname) {
     # to allow relative URL's. If they're not, make a redirect.      # to allow relative URL's. If they're not, make a redirect.
     ##      ##
     if (!($pathinfo =~ m|/$|) || ($pathinfo =~ m |/{2,}$|)) {      if (!($pathinfo =~ m|/$|) || ($pathinfo =~ m |/{2,}$|)) {
         redirect ($scriptwhere . '/' . $query);          redirect("$scriptwhere/$query");
     }      }
     else {      else {
         $where .= '/';          $where .= '/';
Line 865  if (-d $fullname) {
Line 886  if (-d $fullname) {
                        ">$tag\n";                         ">$tag\n";
             }              }
             print "</SELECT>\n";              print "</SELECT>\n";
               print " Module path or alias:\n";
               printf "<INPUT TYPE=TEXT NAME=\"path\" VALUE=\"%s\" SIZE=15>\n", htmlquote($where);
             print "<INPUT TYPE=SUBMIT VALUE=\"Go\">\n";              print "<INPUT TYPE=SUBMIT VALUE=\"Go\">\n";
             print "</FORM>\n";              print "</FORM>\n";
         }          }
Line 872  if (-d $fullname) {
Line 895  if (-d $fullname) {
         if ($allow_tar) {          if ($allow_tar) {
             my($basefile) = ($where =~ m,(?:.*/)?([^/]+),);              my($basefile) = ($where =~ m,(?:.*/)?([^/]+),);
   
             if ($basefile ne '') {              if (defined($basefile) && $basefile ne '') {
                 print "<HR NOSHADE>\n",                  print "<HR NOSHADE>\n",
                   "<DIV align=center>",                    "<DIV align=center>",
                     &link("Download this directory in tarball",                      &link("Download this directory in tarball",
Line 967  if (-d $fullname) {
Line 990  if (-d $fullname) {
         # The file has been removed and is in the Attic.          # The file has been removed and is in the Attic.
         # Send a redirect pointing to the file in the Attic.          # Send a redirect pointing to the file in the Attic.
         (my $newplace = $scriptwhere) =~ s|/([^/]+)$|/Attic/$1|;          (my $newplace = $scriptwhere) =~ s|/([^/]+)$|/Attic/$1|;
         &redirect($newplace);          redirect("$newplace$query");
         exit;          exit;
     }      }
     elsif (0 && (my @files = &safeglob($fullname . ",v"))) {      elsif (0 && (my @files = &safeglob($fullname . ",v"))) {
Line 987  if (-d $fullname) {
Line 1010  if (-d $fullname) {
             while (<$fh>) {              while (<$fh>) {
                 if (/^(\S+)\s+(\S+)/o && $module eq $1                  if (/^(\S+)\s+(\S+)/o && $module eq $1
                     && -d "$cvsroot/$2" && $module ne $2) {                      && -d "$cvsroot/$2" && $module ne $2) {
                     &redirect("$scriptname/$2$xtra");                      redirect("$scriptname/$2$xtra$query");
                 }                  }
             }              }
         }          }
Line 2715  sub navigateHeader($$$$$) {
Line 2738  sub navigateHeader($$$$$) {
     print qq`<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">`;      print qq`<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">`;
     print "<HTML>\n<HEAD>\n";      print "<HTML>\n<HEAD>\n";
     print qq`<META name="robots" content="nofollow">\n`;      print qq`<META name="robots" content="nofollow">\n`;
     print '<!-- CVSweb $zRevision: 1.104 $  $kRevision: 1.55 $ -->';      print '<!-- CVSweb $zRevision: 1.104 $  $kRevision: 1.57 $ -->';
     print "\n<TITLE>$path$filename - $title - $rev</TITLE></HEAD>\n";      print "\n<TITLE>$path$filename - $title - $rev</TITLE></HEAD>\n";
     print  "$body_tag_for_src\n";      print  "$body_tag_for_src\n";
     print "<table width=\"100%\" border=0 cellspacing=0 cellpadding=1 bgcolor=\"$navigationHeaderColor\">";      print "<table width=\"100%\" border=0 cellspacing=0 cellpadding=1 bgcolor=\"$navigationHeaderColor\">";
Line 2829  sub clickablePath($$) {
Line 2852  sub clickablePath($$) {
 }  }
   
 sub chooseCVSRoot() {  sub chooseCVSRoot() {
     my @foo;      if (2 <= @CVSROOT) {
     foreach (sort keys %CVSROOT) {  
         if (-d $CVSROOT{$_}) {  
             push(@foo, $_);  
         }  
     }  
     if (@foo > 1) {  
         my ($k);          my ($k);
         print "<form method=\"GET\" action=\"${scriptwhere}\">\n";          print "<form method=\"GET\" action=\"${scriptwhere}\">\n";
         foreach $k (keys %input) {          foreach $k (keys %input) {
Line 2850  sub chooseCVSRoot() {
Line 2867  sub chooseCVSRoot() {
         print "<td>\n<select name=\"cvsroot\"";          print "<td>\n<select name=\"cvsroot\"";
         print " onchange=\"submit()\"" if ($use_java_script);          print " onchange=\"submit()\"" if ($use_java_script);
         print ">\n";          print ">\n";
         foreach $k (@foo) {          foreach $k (@CVSROOT) {
             print "<option value=\"$k\"";              print "<option value=\"$k\"";
             print " selected" if ($k eq $cvstree);              print " selected" if ($k eq $cvstree);
             print ">", ($CVSROOTdescr{$k} ? $CVSROOTdescr{$k} : $k), "</option>\n";              print ">", ($CVSROOTdescr{$k} ? $CVSROOTdescr{$k} : $k), "</option>\n";
         }          }
         print "</select>\n</td>";          print "</select>\n</td>";
         print "<td><input type=submit value=\"Go\"></td>";          print "<td>";
         print "</tr></table></form>";  
     }      }
     else {      else {
         # no choice ..          # no choice ..
         print "CVS Root: <b>[$cvstree]</b>";          print "CVS Root: <b>[$cvstree]</b>";
     }      }
   
       print " Module path or alias:\n";
       print "<INPUT TYPE=TEXT NAME=\"path\" VALUE=\"\" SIZE=15>\n";
       print "<input type=submit value=\"Go\">";
   
       if (2 <= @CVSROOT) {
           print "</td></tr></table></form>";
       }
 }  }
   
 sub chooseMirror() {  sub chooseMirror() {
Line 3109  sub http_header(;$) {
Line 3133  sub http_header(;$) {
   
 sub html_header($) {  sub html_header($) {
     my ($title) = @_;      my ($title) = @_;
     my $version = '$zRevision: 1.104 $  $kRevision: 1.55 $'; #'      my $version = '$zRevision: 1.104 $  $kRevision: 1.57 $'; #'
     http_header("text/html");      http_header("text/html");
     print <<EOH;      print <<EOH;
 <!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"  <!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"

Legend:
Removed from v.1.1.1.19  
changed lines
  Added in v.1.1.1.20

CVSweb