version 4.24, 2019/11/26 11:28:43 |
version 4.27, 2019/11/26 12:09:02 |
|
|
$VERSION $CheckoutMagic $MimeTypes $DEBUG |
$VERSION $CheckoutMagic $MimeTypes $DEBUG |
$config $allow_version_select |
$config $allow_version_select |
@CVSrepositories @CVSROOT %CVSROOT %CVSROOTdescr |
@CVSrepositories @CVSROOT %CVSROOT %CVSROOTdescr |
%MIRRORS %DEFAULTVALUE %ICONS %MTYPES |
%DEFAULTVALUE %ICONS %MTYPES |
%DIFF_COMMANDS @DIFFTYPES %DIFFTYPES @LOGSORTKEYS %LOGSORTKEYS |
%DIFF_COMMANDS @DIFFTYPES %DIFFTYPES @LOGSORTKEYS %LOGSORTKEYS |
%alltags %fileinfo %tags @branchnames %nameprinted |
%alltags %fileinfo %tags @branchnames %nameprinted |
%symrev %revsym @allrevisions %date %author @revdisplayorder |
%symrev %revsym @allrevisions %date %author @revdisplayorder |
|
|
$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 |
|
|
$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 167 sub plural_write($$); |
|
Line 167 sub plural_write($$); |
|
sub readableTime($$); |
sub readableTime($$); |
sub clickablePath($$); |
sub clickablePath($$); |
sub chooseCVSRoot(); |
sub chooseCVSRoot(); |
sub chooseMirror(); |
|
sub fileSortCmp(); |
sub fileSortCmp(); |
sub download_url($$;$); |
sub download_url($$;$); |
sub download_link($$$;$); |
sub download_link($$$;$); |
Line 195 $config = '/conf/cvsweb/cvsweb.conf'; |
|
Line 194 $config = '/conf/cvsweb/cvsweb.conf'; |
|
|
|
######## Configuration parameters ######### |
######## Configuration parameters ######### |
|
|
@CVSrepositories = @CVSROOT = %CVSROOT = %MIRRORS = %DEFAULTVALUE = %ICONS = |
@CVSrepositories = @CVSROOT = %CVSROOT = %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 471 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 483 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 562 $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 636 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 644 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 693 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 704 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 810 if (-d $fullname) { |
|
Line 787 if (-d $fullname) { |
|
|
|
# give direct access to dirs |
# give direct access to dirs |
if ($where eq '/') { |
if ($where eq '/') { |
chooseMirror(); |
|
chooseCVSRoot(); |
chooseCVSRoot(); |
|
|
} else { |
} else { |
print '<p>Current directory: <b>', clickablePath($where, 0), '</b>'; |
print '<p>Current directory: <b>', clickablePath($where, 0), '</b>'; |
print "</p>\n"; |
print "</p>\n"; |
|
|
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"; |
|
} |
} |
} |
} |
|
|
|
|
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; |
Line 3504 Module path or alias: |
|
Line 3476 Module path or alias: |
|
</p> |
</p> |
</form> |
</form> |
EOF |
EOF |
} |
|
|
|
|
|
sub chooseMirror() |
|
{ |
|
# This code comes from the original BSD-cvsweb |
|
# and may not be useful for your site; If you don't |
|
# set %MIRRORS this won't show up, anyway. |
|
scalar(%MIRRORS) or return; |
|
|
|
# Should perhaps exclude the current site somehow... |
|
print "\n<p>\nThis CVSweb is mirrored in\n"; |
|
|
|
my @tmp = map(&link(htmlquote($_), $MIRRORS{$_}), sort keys %MIRRORS); |
|
my $tmp = pop (@tmp); |
|
|
|
if (scalar(@tmp)) { |
|
print join (', ', @tmp), ' and '; |
|
} |
|
|
|
print "$tmp.\n</p>\n"; |
|
} |
} |
|
|
|
|