===================================================================
RCS file: /cvs/cvsweb/cvsweb.cgi,v
retrieving revision 3.26
retrieving revision 3.31
diff -u -p -r3.26 -r3.31
--- cvsweb/cvsweb.cgi 2000/09/22 11:13:17 3.26
+++ cvsweb/cvsweb.cgi 2000/10/02 19:07:08 3.31
@@ -43,7 +43,7 @@
# SUCH DAMAGE.
#
# $zId: cvsweb.cgi,v 1.103 2000/09/20 17:02:29 jumager Exp $
-# $Id: cvsweb.cgi,v 3.26 2000/09/22 11:13:17 knu Exp $
+# $Id: cvsweb.cgi,v 3.31 2000/10/02 19:07:08 knu Exp $
#
###
@@ -125,14 +125,13 @@ sub forbidden_module($);
use Cwd;
# == EDIT this ==
-# User configuration is stored in
-$config = undef;
-
-for ($ENV{CVSWEB_CONFIG},
-# '/home/knu/etc/cvsweb.conf',
+# Locations to search for user configuration, in order:
+for (
+ $ENV{CVSWEB_CONFIG},
'/usr/local/etc/cvsweb.conf',
- getcwd . '/cvsweb.conf') {
- $config = $_ if defined($_) && -r $_;
+ getcwd() . '/cvsweb.conf'
+ ) {
+ $config = $_ if defined($_) && -r $_;
}
# == Configuration defaults ==
@@ -146,7 +145,7 @@ $allow_version_select = 1;
# These are defined to allow checking with perl -cw
%CVSROOT = %MIRRORS = %DEFAULTVALUE = %ICONS = %MTYPES =
%tags = %alltags = @tabcolors = ();
-$cvstreedefault = $body_tag = $body_tag_for_src =
+$cvstreedefault = $body_tag = $body_tag_for_src =
$logo = $defaulttitle = $address =
$long_intro = $short_instruction = $shortLogLen =
$show_author = $dirtable = $tablepadding = $columnHeaderColorDefault =
@@ -224,9 +223,11 @@ $maycompress = (((defined($ENV{HTTP_ACCEPT_ENCODING})
@stickyvars = qw(cvsroot hideattic sortby logsort f only_with_tag);
if (-f $config) {
- do $config;
-}
-else {
+ do $config
+ || &fatal("500 Internal Error",
+ sprintf('Error in loading configuration file: %s
%s
',
+ $config, &htmlify($@)));
+} else {
&fatal("500 Internal Error",
'Configuration not found. Set the variable $config
'
. 'in cvsweb.cgi, or the environment variable '
@@ -278,25 +279,24 @@ foreach (keys %DEFAULTVALUE)
}
$barequery = "";
+my @barequery;
foreach (@stickyvars) {
# construct a query string with the sticky non default parameters set
if (defined($input{$_}) && $input{$_} ne '' &&
!(defined($DEFAULTVALUE{$_}) && $input{$_} eq $DEFAULTVALUE{$_})) {
- if ($barequery) {
- $barequery = $barequery . "&";
- }
- my $thisval = urlencode($_) . "=" . urlencode($input{$_});
- $barequery .= $thisval;
+ push @barequery, join('=', urlencode($_), urlencode($input{$_});
}
}
# is there any query ?
-if ($barequery) {
+if (@barequery) {
+ $barequery = join('&', @barequery);
$query = "?$barequery";
- $barequery = "&" . $barequery;
+ $barequery = "&$barequery";
}
else {
$query = "";
}
+undef @barequery;
# get actual parameters
$sortby = $input{"sortby"};
@@ -344,7 +344,8 @@ if ($input{'cvsroot'} && $CVSROOT{$input{'cvsroot'}})
$cvsroot = $CVSROOT{$cvstree};
# create icons out of description
-foreach my $k (keys %ICONS) {
+my $k
+foreach $k (keys %ICONS) {
no strict 'refs';
my ($itxt,$ipath,$iwidth,$iheight) = @{$ICONS{$k}};
if ($ipath) {
@@ -354,9 +355,18 @@ foreach my $k (keys %ICONS) {
${"${k}icon"} = $itxt;
}
}
+undef $k;
+my $config_cvstree = "$config-$cvstree";
+
# Do some special configuration for cvstrees
-do "$config-$cvstree" if (-f "$config-$cvstree");
+if (-f $config_cvstree) {
+ do $config_cvstree
+ || &fatal("500 Internal Error",
+ sprintf('Error in loading configuration file: %s
%s
',
+ $config_cvstree, &htmlify($@)));
+}
+undef $config_cvstree;
$prcategories = '(?:' . join('|', @prcategories) . ')';
$prcgi .= '%s' if defined($prcgi) && $prcgi !~ /%s/;
@@ -1133,11 +1143,6 @@ sub doAnnotate($$) {
($pathname = $where) =~ s/(Attic\/)?[^\/]*$//;
($filename = $where) =~ s/^.*\///;
- http_header();
-
- navigateHeader($scriptwhere,$pathname,$filename,$rev, "annotate");
- print "