From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (mandoc.bsd.lv [local]) by mandoc.bsd.lv (OpenSMTPD) with ESMTPA id be11b1ec for ; Fri, 29 Nov 2019 09:30:18 -0500 (EST) Date: Fri, 29 Nov 2019 09:30:18 -0500 (EST) X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: cvsweb: The tar(1) -z option is fully portable: all BSDs, GNU tar, and X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-ID: <8d079a2dcdc1e2a0@mandoc.bsd.lv> Log Message: ----------- The tar(1) -z option is fully portable: all BSDs, GNU tar, and Illumos support it. Consequently, there is no need to run tar(1) and gzip(1) in a pipe. Modified Files: -------------- cvsweb: cvsweb.cgi cvsweb.conf Revision Data ------------- Index: cvsweb.cgi =================================================================== RCS file: /home/cvs/mandoc/cvsweb/cvsweb.cgi,v retrieving revision 4.29 retrieving revision 4.30 diff -Lcvsweb.cgi -Lcvsweb.cgi -u -p -r4.29 -r4.30 --- cvsweb.cgi +++ cvsweb.cgi @@ -78,7 +78,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 @cvs_options + $allow_tar @tar_options @cvs_options @annotate_options @rcsdiff_options $HTML_DOCTYPE $HTML_META $cssurl $CSS ); @@ -128,7 +128,7 @@ EOM $MimeTypes = undef if $@; $CheckoutMagic = '~checkout~'; - $CMD{$_} = "/usr/bin/$_" for (qw(cvs gzip rcsdiff rlog)); + $CMD{$_} = "/usr/bin/$_" for (qw(cvs rcsdiff rlog)); $CMD{tar} = "/bin/tar"; } @@ -678,22 +678,13 @@ if ($input{tarball}) { ('500 Internal Error', 'Export failure (exit status %s), output:
%s
', $errcode, $err || $export_err); - } else { - $| = 1; # Essential to get the buffering right. local (*TAR_OUT); - - my (@cmd, $ctype); - my @tar = ($CMD{tar}, @tar_options, '-cf', '-', $basedir); - my @gzip = ($CMD{gzip}, @gzip_options, '-c'); - push(@cmd, \@tar, '|', \@gzip); - $ctype = 'application/x-gzip'; - push(@cmd, '>pipe', \*TAR_OUT); - - my ($h, $err) = startproc(@cmd); + my ($h, $err) = startproc($CMD{tar}, @tar_options, '-czf', '-', + $basedir, '>pipe', \*TAR_OUT); if ($h) { - print "Content-Type: $ctype\r\n\r\n"; + print "Content-Type: application/x-gzip\r\n\r\n"; local $/ = undef; print ; $h->finish(); Index: cvsweb.conf =================================================================== RCS file: /home/cvs/mandoc/cvsweb/cvsweb.conf,v retrieving revision 4.17 retrieving revision 4.18 diff -Lcvsweb.conf -Lcvsweb.conf -u -p -r4.17 -r4.18 --- cvsweb.conf +++ cvsweb.conf @@ -405,9 +405,9 @@ $use_moddate = 1; # While downloading of the entire repository is disallowed, depending on # the directory this may take a lot of time and disk space. For some CVS # versions, the user account running CVSweb needs write access to -# CVSROOT/val-tags. See also the tar and gzip options below. +# CVSROOT/val-tags. See also the tar options below. # -#$allow_tar = ($CMD{tar} && $CMD{gzip}) ? 1 : 0; +$allow_tar = 0; # Options to pass to tar(1). # For example: @tar_options = qw(--ignore-failed-read); @@ -416,13 +416,6 @@ $use_moddate = 1; # the tar(1) (or gtar(1)) manpage for details. # @tar_options = qw(); - -# Options to pass to gzip(1) when compressing a tarball to download. -# For example: @gzip_options = qw(-3); -# Try lower compression level than 6 (default) if you want faster -# compression, or higher for better compression. -# -@gzip_options = qw(); # Options to pass to cvs(1). # For cvs versions 1.11 to 1.11.6 (broken in < 1.11, removed in 1.11.7), you -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv