$SIG{CHLD} = sub {};
my %config;
eval {
- %config = create_debbugs_configuration(debug => exists $ENV{DEBUG}?$ENV{DEBUG}:0);
+ %config = create_debbugs_configuration();
};
if ($@) {
BAIL_OUT($@);
my $spool_dir = $config{spool_dir};
my $config_dir = $config{config_dir};
-END{
- if ($ENV{DEBUG}) {
- diag("spool_dir: $spool_dir\n");
- diag("config_dir: $config_dir\n");
- diag("sendmail_dir: $sendmail_dir\n");
- }
-}
+
# We're going to use create mime message to create these messages, and
# then just send them to receive.
my %config;
eval {
- %config = create_debbugs_configuration(debug => exists $ENV{DEBUG}?$ENV{DEBUG}:0);
+ %config = create_debbugs_configuration();
};
if ($@) {
BAIL_OUT($@);
}
-# Output some debugging information if there's an error
-END{
- if ($ENV{DEBUG}) {
- foreach my $key (keys %config) {
- diag("$key: $config{$key}\n");
- }
- }
-}
-
# create a bug
send_message(to=>'submit@bugs.something',
headers => [To => 'submit@bugs.something',
$SIG{CHLD} = sub {};
my %config;
eval {
- %config = create_debbugs_configuration(debug => exists $ENV{DEBUG}?$ENV{DEBUG}:0);
+ %config = create_debbugs_configuration();
};
if ($@) {
BAIL_OUT($@);
my $spool_dir = $config{spool_dir};
my $config_dir = $config{config_dir};
-END{
- if ($ENV{DEBUG}) {
- diag("spool_dir: $spool_dir\n");
- diag("config_dir: $config_dir\n");
- diag("sendmail_dir: $sendmail_dir\n");
- }
-}
+
# We're going to use create mime message to create these messages, and
# then just send them to receive.
my %config;
eval {
- %config = create_debbugs_configuration(debug => exists $ENV{DEBUG}?$ENV{DEBUG}:0);
+ %config = create_debbugs_configuration();
};
if ($@) {
BAIL_OUT($@);
}
-# Output some debugging information if there's an error
-END{
- if ($ENV{DEBUG}) {
- foreach my $key (keys %config) {
- diag("$key: $config{$key}\n");
- }
- }
-}
-
# create a bug
send_message(to=>'submit@bugs.something',
headers => [To => 'submit@bugs.something',
my %config;
eval {
- %config = create_debbugs_configuration(debug => exists $ENV{DEBUG}?$ENV{DEBUG}:0);
+ %config = create_debbugs_configuration();
};
if ($@) {
BAIL_OUT($@);
}
-# Output some debugging information if we're debugging
-END{
- if ($ENV{DEBUG}) {
- foreach my $key (keys %config) {
- diag("$key: $config{$key}\n");
- }
- }
-}
-
# create a bug
send_message(to=>'submit@bugs.something',
headers => [To => 'submit@bugs.something',
$SIG{CHLD} = sub {};
my %config;
eval {
- %config = create_debbugs_configuration(debug => exists $ENV{DEBUG}?$ENV{DEBUG}:0);
+ %config = create_debbugs_configuration();
};
if ($@) {
BAIL_OUT($@);
my $spool_dir = $config{spool_dir};
my $config_dir = $config{config_dir};
-END{
- if ($ENV{DEBUG}) {
- diag("spool_dir: $spool_dir\n");
- diag("config_dir: $config_dir\n");
- diag("sendmail_dir: $sendmail_dir\n");
- }
-}
+
# We're going to use create mime message to create these messages, and
# then just send them to receive.
$SIG{CHLD} = sub {};
my %config;
eval {
- %config = create_debbugs_configuration(debug => exists $ENV{DEBUG}?$ENV{DEBUG}:0);
+ %config = create_debbugs_configuration();
};
if ($@) {
BAIL_OUT($@);
my $spool_dir = $config{spool_dir};
my $config_dir = $config{config_dir};
-END{
- if ($ENV{DEBUG}) {
- diag("spool_dir: $spool_dir\n");
- diag("config_dir: $config_dir\n");
- diag("sendmail_dir: $sendmail_dir\n");
- }
-}
+
# We're going to use create mime message to create these messages, and
# then just send them to receive.
$SIG{CHLD} = sub {};
my %config;
eval {
- %config = create_debbugs_configuration(debug => exists $ENV{DEBUG}?$ENV{DEBUG}:0);
+ %config = create_debbugs_configuration();
};
if ($@) {
BAIL_OUT($@);
my $spool_dir = $config{spool_dir};
my $config_dir = $config{config_dir};
-END{
- if ($ENV{DEBUG}) {
- diag("spool_dir: $spool_dir\n");
- diag("config_dir: $config_dir\n");
- diag("sendmail_dir: $sendmail_dir\n");
- }
-}
+
# We're going to use create mime message to create these messages, and
# then just send them to receive.
$SIG{CHLD} = sub {};
my %config;
eval {
- %config = create_debbugs_configuration(debug => exists $ENV{DEBUG}?$ENV{DEBUG}:0);
+ %config = create_debbugs_configuration();
};
if ($@) {
BAIL_OUT($@);
my $spool_dir = $config{spool_dir};
my $config_dir = $config{config_dir};
-END{
- if ($ENV{DEBUG}) {
- diag("spool_dir: $spool_dir\n");
- diag("config_dir: $config_dir\n");
- diag("sendmail_dir: $sendmail_dir\n");
- }
-}
+
# We're going to use create mime message to create these messages, and
# then just send them to receive.
$SIG{CHLD} = sub {};
my %config;
eval {
- %config = create_debbugs_configuration(debug => exists $ENV{DEBUG}?$ENV{DEBUG}:0);
+ %config = create_debbugs_configuration();
};
if ($@) {
BAIL_OUT($@);
my $spool_dir = $config{spool_dir};
my $config_dir = $config{config_dir};
-END{
- if ($ENV{DEBUG}) {
- diag("spool_dir: $spool_dir\n");
- diag("config_dir: $config_dir\n");
- diag("sendmail_dir: $sendmail_dir\n");
- }
-}
+
# We're going to use create mime message to create these messages, and
# then just send them to receive.
$SIG{CHLD} = sub {};
my %config;
eval {
- %config = create_debbugs_configuration(debug => exists $ENV{DEBUG}?$ENV{DEBUG}:0);
+ %config = create_debbugs_configuration();
};
if ($@) {
BAIL_OUT($@);
my $spool_dir = $config{spool_dir};
my $config_dir = $config{config_dir};
-END{
- if ($ENV{DEBUG}) {
- diag("spool_dir: $spool_dir\n");
- diag("config_dir: $config_dir\n");
- diag("sendmail_dir: $sendmail_dir\n");
- }
-}
+
# We're going to use create mime message to create these messages, and
# then just send them to receive.
$SIG{CHLD} = sub {};
our %config;
eval {
- %config = create_debbugs_configuration(debug => exists $ENV{DEBUG}?$ENV{DEBUG}:0);
+ %config = create_debbugs_configuration();
};
if ($@) {
BAIL_OUT($@);
}
$ENV{DEBBUGS_CONFIG_FILE} = "$config{config_dir}/debbugs_config";
-END{
- if ($ENV{DEBUG}) {
- diag("spool_dir: $config{spool_dir}\n");
- diag("config_dir: $config{config_dir}\n");
- diag("sendmail_dir: $config{sendmail_dir}\n");
- }
-}
my $libravatar_cgi_handler = sub {
my $fh;
sub create_debbugs_configuration {
my %param = validate_with(params => \@_,
spec => {debug => {type => BOOLEAN,
- default => 0,
+ default => exists $ENV{DEBUG}?
+ $ENV{DEBUG}:0,
},
cleanup => {type => BOOLEAN,
optional => 1,
$ENV{DEBBUGS_CONFIG_FILE} ="$config_dir/debbugs_config";
$ENV{PERL5LIB} = getcwd();
$ENV{SENDMAIL_TESTDIR} = $sendmail_dir;
+ eval {
my $sendmail_tester = getcwd().'/t/sendmail_tester';
unless (-x $sendmail_tester) {
die q(t/sendmail_tester doesn't exist or isn't executable. You may be in the wrong directory.);
}
system('mkdir','-p',"$spool_dir/incoming");
system('mkdir','-p',"$spool_dir/lock");
+ eval '
+END{
+ if ($ENV{DEBUG}) {
+ diag("spool_dir: $spool_dir\n");
+ diag("config_dir: $config_dir\n",);
+ diag("sendmail_dir: $sendmail_dir\n");
+ }
+}';
+ };
+ BAIL_OUT ($@) if ($@);
return (spool_dir => $spool_dir,
sendmail_dir => $sendmail_dir,
config_dir => $config_dir,
}
}
+$SIG{CHLD} = sub {};
+
{
package DebbugsTest::HTTPServer;
use base qw(HTTP::Server::Simple::CGI HTTP::Server::Simple::CGI::Environment);