=================================================================== RCS file: /cvs/cvsweb/cvsweb.cgi,v retrieving revision 4.24 retrieving revision 4.25 diff -u -p -r4.24 -r4.25 --- cvsweb/cvsweb.cgi 2019/11/26 11:28:43 4.24 +++ cvsweb/cvsweb.cgi 2019/11/26 11:53:01 4.25 @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $Id: cvsweb.cgi,v 4.24 2019/11/26 11:28:43 schwarze Exp $ +# $Id: cvsweb.cgi,v 4.25 2019/11/26 11:53:01 schwarze Exp $ # $knu: cvsweb.cgi,v 1.299 2010/11/13 16:37:18 simon # # cvsweb - a CGI interface to CVS trees. @@ -79,7 +79,7 @@ use vars qw ( $tabstop $state $annTable $sel @ForbiddenFiles $use_descriptions %descriptions $dwhere $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 $HTML_DOCTYPE $HTML_META $cssurl $CSS ); @@ -650,7 +650,7 @@ if ($input{tarball}) { my ($module) = ($where =~ m,^/?(.*),); # untaint $module =~ s,/([^/]*)$,,; - my ($ext) = ($1 =~ /(\.t(?:ar\.)?gz|\.zip)$/); + my ($ext) = ($1 =~ /(\.t(?:ar\.)?gz)$/); my ($basedir) = ($module =~ m,([^/]+)$,); if ($basedir eq '' || $module eq '') { @@ -658,16 +658,11 @@ if ($input{tarball}) { '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) { fatal('500 Internal Error', 'tar command not found.') unless $CMD{tar}; fatal('500 Internal Error', 'gzip command not found.') unless $CMD{gzip}; - } - my $iszip = ($ext eq '.zip'); - if ($iszip && !$CMD{zip}) { - fatal('500 Internal Error', 'zip command not found.'); - } - if (!$istar && !$iszip) { + } else { fatal('500 Internal Error', 'Unsupported archive type.'); } @@ -712,10 +707,6 @@ if ($input{tarball}) { my @gzip = ($CMD{gzip}, @gzip_options, '-c'); push(@cmd, \@tar, '|', \@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); @@ -727,8 +718,8 @@ if ($input{tarball}) { $h->finish(); } else { @fatal = ('500 Internal Error', - '%s failure (exit status %s), output:
%s
', - $istar ? 'Tar' : 'Zip', $? >> 8 || -1, $err); + 'tar failure (exit status %s), output:
%s
', + $? >> 8 || -1, $err); } } @@ -1120,17 +1111,14 @@ EOF if ($allow_tar && $filesfound) { my ($basefile) = ($where =~ m,(?:.*/)?([^/]+),); my $havetar = $CMD{tar} && $CMD{gzip}; - my $havezip = $CMD{zip}; - if (defined($basefile) && $basefile ne '' && ($havetar || $havezip)) { + if (defined($basefile) && $basefile ne '' && $havetar) { my $q = ($query ? "$query;" : '?') . 'tarball=1'; print "
\n", '
Download this directory in '; # Mangle the filename so browsers show a reasonable filename to download. - my @types = (); $basefile = uri_escape($basefile); - push(@types, &link('tarball', "$basefile.tar.gz$q")) if $havetar; - push(@types, &link('zip archive', "$basefile.zip$q")) if $havezip; - print join(' or ', @types), "
\n"; + print &link('tarball', "$basefile.tar.gz$q"); + print "\n"; } }