| version 1.14, 2002/11/22 20:22:23 |
version 1.15, 2002/11/25 12:33:34 |
|
|
| # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| # SUCH DAMAGE. |
# SUCH DAMAGE. |
| # |
# |
| # $FreeBSD: projects/cvsweb/cvsweb.cgi,v 1.136 2002/11/16 13:26:40 scop Exp $ |
# $FreeBSD: projects/cvsweb/cvsweb.cgi,v 1.138 2002/11/24 18:03:21 scop Exp $ |
| # $Id$ |
# $Id$ |
| # $Idaemons: /home/cvs/cvsweb/cvsweb.cgi,v 1.84 2001/10/07 20:50:10 knu Exp $ |
# $Idaemons: /home/cvs/cvsweb/cvsweb.cgi,v 1.84 2001/10/07 20:50:10 knu Exp $ |
| # $Platon: scripts/cgi/cvsweb/cvsweb.cgi,v 1.13 2002/11/22 20:04:15 rajo Exp $ |
# $Platon: scripts/cgi/cvsweb/cvsweb.cgi,v 1.14 2002/11/22 20:22:23 rajo Exp $ |
| # |
# |
| ### |
### |
| |
|
| require 5.000; |
require 5.005_03; |
| |
|
| use strict; |
use strict; |
| |
|
|
|
| $use_moddate $has_zlib $gzip_open |
$use_moddate $has_zlib $gzip_open |
| $allow_tar @tar_options @gzip_options @zip_options @cvs_options |
$allow_tar @tar_options @gzip_options @zip_options @cvs_options |
| @annotate_options $LOG_FILESEPARATOR $LOG_REVSEPARATOR |
@annotate_options $LOG_FILESEPARATOR $LOG_REVSEPARATOR |
| $tmpdir $HTML_DOCTYPE $HTML_META $cssurl |
$tmpdir $HTML_DOCTYPE $HTML_META $cssurl $TempTemplate |
| ); |
); |
| |
|
| # TODO: |
# TODO: |
| # Maybe "use filetest 'access'" on perl >= 5.6 for better -X checks. |
# Maybe "use filetest 'access'" on perl >= 5.6 for better -X checks. |
| #($] >= 5.006) and eval "use filetest 'access'"; |
#($] >= 5.006) and eval "use filetest 'access'"; |
| |
|
| use Cwd qw(abs_path); |
use Cwd qw(abs_path); |
| use File::Basename (); |
use File::Basename qw(); |
| use IO::Pipe (); |
use File::Temp qw(tempdir); |
| use IPC::Open2 qw(open2); |
use IO::Pipe qw(); |
| use Time::Local (); |
use IPC::Open2 qw(open2); |
| |
use Time::Local qw(); |
| |
|
| # ----------------------------------------------------------------------------- |
# ----------------------------------------------------------------------------- |
| |
|
|
|
| |
|
| $tmpdir = $ENV{TMPDIR} || '/var/tmp'; |
$tmpdir = $ENV{TMPDIR} || '/var/tmp'; |
| |
|
| |
$TempTemplate = '.cvsweb.XXXXXXXX'; |
| |
|
| $LOG_FILESEPARATOR = qr/^={77}$/o; |
$LOG_FILESEPARATOR = qr/^={77}$/o; |
| $LOG_REVSEPARATOR = qr/^-{28}$/o; |
$LOG_REVSEPARATOR = qr/^-{28}$/o; |
| } |
} |
| Line 562 if ($input{tarball}) { |
|
| Line 565 if ($input{tarball}) { |
|
| _('You cannot download the top level directory.')); |
_('You cannot download the top level directory.')); |
| } |
} |
| |
|
| my $tmpexportdir = "$tmpdir/.cvsweb.$$." . int(time); |
my $tmpexportdir; |
| |
eval { |
| mkdir($tmpexportdir, 0700) or |
local $SIG{__DIE__}; |
| fatal('500 Internal Error', _('Unable to make temporary directory: %s'), $!); |
$tmpexportdir = tempdir($TempTemplate, DIR => $tmpdir, CLEANUP => 1); |
| |
}; |
| |
if ($@) { |
| |
fatal('500 Internal Error', _('Unable to make temporary directory: %s'), $@); |
| |
} |
| |
|
| my @fatal; |
my @fatal; |
| |
|
| Line 601 if ($input{tarball}) { |
|
| Line 608 if ($input{tarball}) { |
|
| } |
} |
| } |
} |
| |
|
| system($CMD{rm}, '-rf', $tmpexportdir) if -d $tmpexportdir; |
# File::Temp's CLEANUP will handle cleanup of the temp dir for us. |
| |
|
| &fatal(@fatal) if @fatal; |
&fatal(@fatal) if @fatal; |
| |
|
| Line 2223 sub getDirLogs($$@) |
|
| Line 2230 sub getDirLogs($$@) |
|
| |
|
| if ($. == 0) { |
if ($. == 0) { |
| fatal("500 Internal Error", |
fatal("500 Internal Error", |
| _('Failed to spawn GNU rlog on <em>"%s"</em>. <p>Did you set the <b>$command_path</b> in your configuration file correctly ? (Currently "%s"'), |
_('Failed to spawn GNU rlog on <em>"%s"</em>.<br><br>Did you set the <b><code>$command_path</code></b> in your configuration file correctly? (Currently: "<code>%s</code>")'), |
| join (", ", @files), $command_path); |
join (", ", @files), $command_path); |
| } |
} |
| close($fh); |
close($fh); |