X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=Debbugs%2FConfig.pm;h=60b1072c6db97e391b13fedc9dcfee892edfcf5b;hb=7cbf8c0bb1159a29a6a6106d70c291577791b457;hp=ec7650f6419e58766deb062c7ae01796e5f3d12e;hpb=792fd5180f99c76551e9dc5699b4d15fea9ac088;p=debbugs.git diff --git a/Debbugs/Config.pm b/Debbugs/Config.pm index ec7650f..60b1072 100644 --- a/Debbugs/Config.pm +++ b/Debbugs/Config.pm @@ -43,15 +43,18 @@ BEGIN { qw($gMaintainer $gMaintainerWebpage $gMaintainerEmail $gUnknownMaintainerEmail), qw($gSubmitList $gMaintList $gQuietList $gForwardList), qw($gDoneList $gRequestList $gSubmitterList $gControlList), + qw($gStrongList), + qw($gPackageVersionRe), qw($gSummaryList $gMirrorList $gMailer $gBug), qw($gBugs $gRemoveAge $gSaveOldBugs $gDefaultSeverity), qw($gShowSeverities $gBounceFroms $gConfigDir $gSpoolDir), qw($gIncomingDir $gWebDir $gDocDir $gMaintainerFile), qw($gMaintainerFileOverride $gPseudoDescFile $gPackageSource), qw($gVersionPackagesDir $gVersionIndex $gBinarySourceMap $gSourceBinaryMap), - qw($gSendmail $gLibPath), + qw($gSendmail $gLibPath $gSpamScan @gExcludeFromControl), qw(%gSeverityDisplay @gTags @gSeverityList @gStrongSeverities), qw(%gSearchEstraier), + qw(@gPostProcessall @gRemovalDefaultDistributionTags @gRemovalDistributionTags @gRemovalArchitectures), ], text => [qw($gBadEmailPrefix $gHTMLTail $gHTMLExpireNote), ], @@ -76,6 +79,13 @@ use Safe; # read in the files; %config = (); +# untaint $ENV{DEBBUGS_CONFIG_FILE} if it's owned by us +# This enables us to test things that are -T. +if (exists $ENV{DEBBUGS_CONFIG_FILE} and + ${[stat($ENV{DEBBUGS_CONFIG_FILE})]}[4] = $<) { + $ENV{DEBBUGS_CONFIG_FILE} =~ /(.+)/; + $ENV{DEBBUGS_CONFIG_FILE} = $1; +} read_config(exists $ENV{DEBBUGS_CONFIG_FILE}?$ENV{DEBBUGS_CONFIG_FILE}:'/etc/debbugs/config'); =item email_domain $gEmailDomain @@ -273,6 +283,7 @@ set_default(\%config,'submitter_list','bug-submitter-list'); set_default(\%config, 'control_list', 'bug-control-list'); set_default(\%config, 'summary_list', 'bug-summary-list'); set_default(\%config, 'mirror_list', 'bug-mirror-list'); +set_default(\%config, 'strong_list', 'bug-strong-list'); =head2 Misc Options @@ -338,6 +349,57 @@ set_default(\%config,'removal_default_distribution_tags', [qw(unstable testing)] ); +=item removal_architectures + +For removal/archival purposes, these architectures are consulted if +there is more than one architecture applicable. If the bug is in a +package not in any of these architectures, the architecture actually +checked is undefined. + +Default: qw(i386 amd64 arm ppc sparc alpha); + +=cut + +set_default(\%config,'removal_architectures', + [qw(i386 amd64 arm ppc sparc alpha)] + ); + + +=item package_name_re + +The regex which will match a package name + +Default: '[a-z0-9][a-z0-9\.+-]+' + +=cut + +set_default(\%config,'package_name_re', + '[a-z0-9][a-z0-9\.+-]+'); + +=item package_version_re + +The regex which will match a package version + +Default: '[A-Za-z0-9:+\.-]+' + +=cut + +set_default(\%config,'package_version_re', + '[A-Za-z0-9:+\.~-]+'); + + + +=item exclude_from_control + +Addresses which are not allowed to send messages to control + +=cut + +set_default(\%config,'exclude_from_control',[]); + + + + set_default(\%config,'default_severity','normal'); set_default(\%config,'show_severities','critical, grave, normal, minor, wishlist'); set_default(\%config,'strong_severities',[qw(critical grave)]); @@ -370,13 +432,24 @@ set_default(\%config,'package_source',$config{config_dir}.'/indices/sources'); set_default(\%config,'version_packages_dir',$config{spool_dir}.'/../versions/pkg'); +set_default(\%config,'post_processall',[]); + =item sendmail Sets the sendmail binary to execute; defaults to /usr/lib/sendmail =cut -set_default(\%config,'sendmail',$config{sendmail},'/usr/lib/sendmail'); +set_default(\%config,'sendmail','/usr/lib/sendmail'); + +=item spam_scan + +Whether or not spamscan is being used; defaults to 0 (not being used + +=cut + +set_default(\%config,'spam_scan',0); + =back @@ -403,6 +476,15 @@ This prefixes the text of all lines in a bad e-mail message ack. set_default(\%config,'bad_email_prefix',''); + +=item text_instructions + +This gives more information about bad e-mails to receive.in + +=cut + +set_default(\%config,'text_instructions',$config{bad_email_prefix}); + =item html_tail This shows up at the end of (most) html pages @@ -445,7 +527,7 @@ sub read_config{ or die "Unable to open configuration file $conf_file for reading: $!"; # A new version configuration file must have a comment as its first line my $first_line = <$fh>; - my ($version) = $first_line =~ /VERSION:\s*(\d+)/i; + my ($version) = defined $first_line?$first_line =~ /VERSION:\s*(\d+)/i:undef; if (defined $version) { if ($version == 1) { # Do something here; @@ -470,14 +552,14 @@ sub read_config{ my ($hash_name,$glob_name,$glob_type) = __convert_name($variable); my $var_glob = $cpt->varglob($glob_name); my $value; #= $cpt->reval("return $variable"); - #print STDERR $value,qq(\n); + # print STDERR "$variable $value",qq(\n); if (defined $var_glob) {{ no strict 'refs'; if ($glob_type eq '%') { - $value = {%{*{$var_glob}}}; + $value = {%{*{$var_glob}}} if defined *{$var_glob}{HASH}; } elsif ($glob_type eq '@') { - $value = [@{*{$var_glob}}]; + $value = [@{*{$var_glob}}] if defined *{$var_glob}{ARRAY}; } else { $value = ${*{$var_glob}}; @@ -520,19 +602,22 @@ sub set_default{ $varname =~ s/(Html|Cgi)/uc($1)/ge; } # update the configuration value - if (not $USING_GLOBALS and not exists $config{$option}) { - $config{$option} = $value; + if (not $USING_GLOBALS and not exists $config->{$option}) { + $config->{$option} = $value; } elsif ($USING_GLOBALS) {{ no strict 'refs'; # Need to check if a value has already been set in a global if (defined *{"Debbugs::Config::${varname}"}) { - $config{$option} = *{"Debbugs::Config::${varname}"}; + $config->{$option} = *{"Debbugs::Config::${varname}"}; + } + else { + $config->{$option} = $value; } }} if ($USING_GLOBALS) {{ no strict 'refs'; - *{"Debbugs::Config::${varname}"} = $config{$option}; + *{"Debbugs::Config::${varname}"} = $config->{$option}; }} }