=================================================================== RCS file: /cvs/cvsweb/cvsweb.cgi,v retrieving revision 4.30 retrieving revision 4.34 diff -u -p -r4.30 -r4.34 --- cvsweb/cvsweb.cgi 2019/11/29 14:29:48 4.30 +++ cvsweb/cvsweb.cgi 2019/11/29 16:30:06 4.34 @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $Id: cvsweb.cgi,v 4.30 2019/11/29 14:29:48 schwarze Exp $ +# $Id: cvsweb.cgi,v 4.34 2019/11/29 16:30:06 schwarze Exp $ # $knu: cvsweb.cgi,v 1.299 2010/11/13 16:37:18 simon # # cvsweb - a CGI interface to CVS trees. @@ -56,8 +56,7 @@ use filetest qw(access); use vars qw ( $VERSION $CheckoutMagic $MimeTypes $DEBUG $config $allow_version_select - @CVSrepositories @CVSROOT %CVSROOT %CVSROOTdescr - %DEFAULTVALUE %ICONS %MTYPES + @CVSrepositories @CVSROOT %CVSROOT %CVSROOTdescr %DEFAULTVALUE %MTYPES %DIFF_COMMANDS @DIFFTYPES %DIFFTYPES @LOGSORTKEYS %LOGSORTKEYS %alltags %fileinfo %tags @branchnames %nameprinted %symrev %revsym @allrevisions %date %author @revdisplayorder @@ -68,9 +67,9 @@ use vars qw ( %input $query $barequery $sortby $bydate $byrev $byauthor $bylog $byfile $defaultDiffType $logsort $cvstree $cvsroot $charset $output_filter %CMD $allow_compress $backicon $diricon $fileicon - $fullname $logo $defaulttitle $address $binfileicon - $long_intro $short_instruction $shortLogLen $show_author - $tablepadding $hr_breakable $showfunc $hr_ignwhite $hr_ignkeysubst + $fullname $logo $defaulttitle $address $binfileicon $iconsdir + $shortLogLen $show_author + $hr_breakable $showfunc $hr_ignwhite $hr_ignkeysubst $inputTextSize $mime_types $allow_annotate $allow_markup $allow_mailtos $allow_log_extra $allow_dir_extra $allow_source_extra $edit_option_form @@ -190,17 +189,21 @@ sub checkout_to_temp($$$); # (think mod_perl)... delete(@ENV{qw(PATH IFS CDPATH ENV BASH_ENV)}); +# Helps to achieve read only access to the repositories +# with cvs >= 1.12.1 and doesn't hurt other versions. +$ENV{CVSREADONLYFS} = 1; + # Location of the configuration file inside the web server chroot: $config = '/conf/cvsweb/cvsweb.conf'; ######## Configuration parameters ######### -@CVSrepositories = @CVSROOT = %CVSROOT = %DEFAULTVALUE = %ICONS = +@CVSrepositories = @CVSROOT = %CVSROOT = %DEFAULTVALUE = %MTYPES = %tags = %alltags = %fileinfo = %DIFF_COMMANDS = (); $logo = $defaulttitle = - $address = $long_intro = $short_instruction = $shortLogLen = $show_author = - $tablepadding = $hr_breakable = $showfunc = $hr_ignwhite = + $address = $shortLogLen = $show_author = + $hr_breakable = $showfunc = $hr_ignwhite = $hr_ignkeysubst = $inputTextSize = $mime_types = $allow_annotate = $allow_markup = $allow_compress = $edit_option_form = $show_subdir_lastmod = $show_log_in_markup = $preformat_in_markup = @@ -568,17 +571,20 @@ if ($input{cvsroot} && $CVSROOT{$input{cvsroot}}) { $cvsroot = $CVSROOT{$cvstree}; -# create icons out of description -foreach my $k (keys %ICONS) { - my ($itxt, $ipath, $iwidth, $iheight) = @{$ICONS{$k}}; - no strict 'refs'; - if ($ipath) { - ${"${k}icon"} = - sprintf('%s', - htmlquote($ipath), htmlquote($itxt), $iwidth, $iheight); - } else { - ${"${k}icon"} = $itxt; - } +if ($iconsdir) { + $backicon = '[BACK]'; + $diricon = '[DIR]'; + $fileicon = '[TXT]'; + $binfileicon = '[BIN]'; +} else { + $backicon = 'back'; + $diricon = 'dir'; + $fileicon = 'file'; + $binfileicon = 'binfile'; } my $config_cvstree = "$config-$cvstree"; @@ -718,8 +724,6 @@ if (-d $fullname) { if ($where eq '/') { html_header($defaulttitle); - $long_intro =~ s/!!CVSROOTdescr!!/$CVSROOTdescr{$cvstree}/g; - print $long_intro; } else { html_header($where); my $html = (-f catfile($fullname, 'README.cvs.html,v') || @@ -756,7 +760,6 @@ if (-d $fullname) { } $h->finish(); } - print $short_instruction; } if ($use_descriptions && @@ -785,8 +788,8 @@ if (-d $fullname) { my $infocols = 1; - printf(< + printf(< EOF printf('', ($byfile ? ' class="sorted"' : ''));