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

Diff for /cvsweb/cvsweb.cgi between version 4.24 and 4.26

version 4.24, 2019/11/26 11:28:43 version 4.26, 2019/11/26 12:04:55
Line 69  use vars qw (
Line 69  use vars qw (
   $bylog $byfile $defaultDiffType $logsort $cvstree $cvsroot    $bylog $byfile $defaultDiffType $logsort $cvstree $cvsroot
   $charset $output_filter    $charset $output_filter
   @command_path %CMD $allow_compress $backicon $diricon $fileicon    @command_path %CMD $allow_compress $backicon $diricon $fileicon
   $fullname $cvstreedefault $logo $defaulttitle $address $binfileicon    $fullname $logo $defaulttitle $address $binfileicon
   $long_intro $short_instruction $shortLogLen $show_author    $long_intro $short_instruction $shortLogLen $show_author
   $tablepadding $hr_breakable $showfunc $hr_ignwhite $hr_ignkeysubst    $tablepadding $hr_breakable $showfunc $hr_ignwhite $hr_ignkeysubst
   $inputTextSize $mime_types $allow_annotate $allow_markup $allow_mailtos    $inputTextSize $mime_types $allow_annotate $allow_markup $allow_mailtos
Line 79  use vars qw (
Line 79  use vars qw (
   $tabstop $state $annTable $sel @ForbiddenFiles    $tabstop $state $annTable $sel @ForbiddenFiles
   $use_descriptions %descriptions $dwhere    $use_descriptions %descriptions $dwhere
   $use_moddate $gzip_open $file_list_len    $use_moddate $gzip_open $file_list_len
   $allow_tar @tar_options @gzip_options @zip_options @cvs_options    $allow_tar @tar_options @gzip_options @cvs_options
   @annotate_options @rcsdiff_options    @annotate_options @rcsdiff_options
   $HTML_DOCTYPE $HTML_META $cssurl $CSS    $HTML_DOCTYPE $HTML_META $cssurl $CSS
 );  );
Line 198  $config = '/conf/cvsweb/cvsweb.conf';
Line 198  $config = '/conf/cvsweb/cvsweb.conf';
 @CVSrepositories = @CVSROOT = %CVSROOT = %MIRRORS = %DEFAULTVALUE = %ICONS =  @CVSrepositories = @CVSROOT = %CVSROOT = %MIRRORS = %DEFAULTVALUE = %ICONS =
   %MTYPES = %tags = %alltags = %fileinfo = %DIFF_COMMANDS = ();    %MTYPES = %tags = %alltags = %fileinfo = %DIFF_COMMANDS = ();
   
 $cvstreedefault = $logo = $defaulttitle =  $logo = $defaulttitle =
   $address = $long_intro = $short_instruction = $shortLogLen = $show_author =    $address = $long_intro = $short_instruction = $shortLogLen = $show_author =
   $tablepadding = $hr_breakable = $showfunc = $hr_ignwhite =    $tablepadding = $hr_breakable = $showfunc = $hr_ignwhite =
   $hr_ignkeysubst = $inputTextSize = $mime_types = $allow_annotate =    $hr_ignkeysubst = $inputTextSize = $mime_types = $allow_annotate =
Line 472  for (my $i = 0; $i < scalar(@CVSrepositories); $i += 2
Line 472  for (my $i = 0; $i < scalar(@CVSrepositories); $i += 2
     next;      next;
   }    }
   $rootfound ||= 1;    $rootfound ||= 1;
   $cvstreedefault = $key unless defined($cvstreedefault);  
   $CVSROOTdescr{$key} = $descr;    $CVSROOTdescr{$key} = $descr;
   $CVSROOT{$key} = $root;    $CVSROOT{$key} = $root;
   push(@CVSROOT, $key);    push(@CVSROOT, $key);
Line 485  unless ($rootfound) {
Line 484  unless ($rootfound) {
 }  }
 undef $rootfound;  undef $rootfound;
   
 #  $DEFAULTVALUE{cvsroot} = $CVSrepositories[0];
 # Default CVS root  
 #  
 if (!defined($CVSROOT{$cvstreedefault})) {  
   fatal("500 Internal Error",  
         '<code>$cvstreedefault</code> points to a repository (%s) not ' .  
         'defined in <code>@CVSrepositories</code> in your configuration ' .  
         'file (<code>%s</code>).',  
         $cvstreedefault,  
         $config);  
 }  
   
 $DEFAULTVALUE{cvsroot} = $cvstreedefault;  
   
 while (my ($key, $defval) = each %DEFAULTVALUE) {  while (my ($key, $defval) = each %DEFAULTVALUE) {
   
   # Replace not given parameters with defaults.    # Replace not given parameters with defaults.
Line 576  $logsort = $input{logsort};
Line 563  $logsort = $input{logsort};
 if ($input{cvsroot} && $CVSROOT{$input{cvsroot}}) {  if ($input{cvsroot} && $CVSROOT{$input{cvsroot}}) {
   $cvstree = $input{cvsroot};    $cvstree = $input{cvsroot};
 } else {  } else {
   $cvstree = $cvstreedefault;    $cvstree = $CVSrepositories[0];
 }  }
   
 $cvsroot = $CVSROOT{$cvstree};  $cvsroot = $CVSROOT{$cvstree};
Line 650  if ($input{tarball}) {
Line 637  if ($input{tarball}) {
   
   my ($module)  =  ($where =~ m,^/?(.*),);    # untaint    my ($module)  =  ($where =~ m,^/?(.*),);    # untaint
   $module       =~ s,/([^/]*)$,,;    $module       =~ s,/([^/]*)$,,;
   my ($ext)     =  ($1 =~ /(\.t(?:ar\.)?gz|\.zip)$/);    my ($ext)     =  ($1 =~ /(\.t(?:ar\.)?gz)$/);
   my ($basedir) =  ($module =~ m,([^/]+)$,);    my ($basedir) =  ($module =~ m,([^/]+)$,);
   
   if ($basedir eq '' || $module eq '') {    if ($basedir eq '' || $module eq '') {
Line 658  if ($input{tarball}) {
Line 645  if ($input{tarball}) {
           'You cannot download the top level directory.');            'You cannot download the top level directory.');
   }    }
   
   my $istar = ($ext eq '.tar.gz' || $ext eq '.tgz');    my $istar = $ext eq '.tar.gz' || $ext eq '.tgz';
   if ($istar) {    if ($istar) {
     fatal('500 Internal Error', 'tar command not found.') unless $CMD{tar};      fatal('500 Internal Error', 'tar command not found.') unless $CMD{tar};
     fatal('500 Internal Error', 'gzip command not found.') unless $CMD{gzip};      fatal('500 Internal Error', 'gzip command not found.') unless $CMD{gzip};
   }    } else {
   my $iszip = ($ext eq '.zip');  
   if ($iszip && !$CMD{zip}) {  
     fatal('500 Internal Error', 'zip command not found.');  
   }  
   if (!$istar && !$iszip) {  
     fatal('500 Internal Error', 'Unsupported archive type.');      fatal('500 Internal Error', 'Unsupported archive type.');
   }    }
   
Line 712  if ($input{tarball}) {
Line 694  if ($input{tarball}) {
       my @gzip = ($CMD{gzip}, @gzip_options, '-c');        my @gzip = ($CMD{gzip}, @gzip_options, '-c');
       push(@cmd, \@tar, '|', \@gzip);        push(@cmd, \@tar, '|', \@gzip);
       $ctype = 'application/x-gzip';        $ctype = 'application/x-gzip';
     } elsif ($iszip) {  
       my @zip = ($CMD{zip}, @zip_options, '-r', '-', $basedir);  
       push(@cmd, \@zip, \'');  
       $ctype = 'application/zip';  
     }      }
     push(@cmd, '>pipe', \*TAR_OUT);      push(@cmd, '>pipe', \*TAR_OUT);
   
Line 727  if ($input{tarball}) {
Line 705  if ($input{tarball}) {
       $h->finish();        $h->finish();
     } else {      } else {
       @fatal = ('500 Internal Error',        @fatal = ('500 Internal Error',
                 '%s failure (exit status %s), output: <pre>%s</pre>',                  'tar failure (exit status %s), output: <pre>%s</pre>',
                 $istar ? 'Tar' : 'Zip', $? >> 8 || -1, $err);                  $? >> 8 || -1, $err);
     }      }
   }    }
   
Line 1120  EOF
Line 1098  EOF
   if ($allow_tar && $filesfound) {    if ($allow_tar && $filesfound) {
     my ($basefile) = ($where =~ m,(?:.*/)?([^/]+),);      my ($basefile) = ($where =~ m,(?:.*/)?([^/]+),);
     my $havetar = $CMD{tar} && $CMD{gzip};      my $havetar = $CMD{tar} && $CMD{gzip};
     my $havezip = $CMD{zip};      if (defined($basefile) && $basefile ne '' && $havetar) {
     if (defined($basefile) && $basefile ne '' && ($havetar || $havezip)) {  
       my $q = ($query ? "$query;" : '?') . 'tarball=1';        my $q = ($query ? "$query;" : '?') . 'tarball=1';
       print "<hr />\n",        print "<hr />\n",
         '<div style="text-align: center">Download this directory in ';          '<div style="text-align: center">Download this directory in ';
       # Mangle the filename so browsers show a reasonable filename to download.        # Mangle the filename so browsers show a reasonable filename to download.
       my @types = ();  
       $basefile = uri_escape($basefile);        $basefile = uri_escape($basefile);
       push(@types, &link('tarball', "$basefile.tar.gz$q")) if $havetar;        print &link('tarball', "$basefile.tar.gz$q");
       push(@types, &link('zip archive', "$basefile.zip$q")) if $havezip;        print "</div>\n";
       print join(' or ', @types), "</div>\n";  
     }      }
   }    }
   
Line 1146  EOF
Line 1121  EOF
       printf(qq{<input type="hidden" name="%s" value="%s" />\n},        printf(qq{<input type="hidden" name="%s" value="%s" />\n},
              $v, $input{$v} || 0);               $v, $input{$v} || 0);
     }      }
     if ($cvstree ne $cvstreedefault) {      if ($cvstree ne $CVSrepositories[0]) {
       print "<input type=\"hidden\" name=\"cvsroot\" value=\"$cvstree\" />\n";        print "<input type=\"hidden\" name=\"cvsroot\" value=\"$cvstree\" />\n";
     }      }
     print <<EOF;      print <<EOF;

Legend:
Removed from v.4.24  
changed lines
  Added in v.4.26

CVSweb