summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB.pm
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-04-20 01:21:58 +0200
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-04-20 01:21:58 +0200
commit049ae4ae5d0367485910064f62b1baf38fdaad04 (patch)
tree1be645e4d0d5fdf6b1bb81aea55f07cabea0e361 /Bugzilla/DB.pm
parent3944a53b67f20592b960f03c65d9ff2b490f58fb (diff)
downloadbugzilla-049ae4ae5d0367485910064f62b1baf38fdaad04.tar.gz
bugzilla-049ae4ae5d0367485910064f62b1baf38fdaad04.tar.xz
Bug 560284: Make all errors that checksetup.pl throws be red
r=mkanat, a=mkanat (module owner)
Diffstat (limited to 'Bugzilla/DB.pm')
-rw-r--r--Bugzilla/DB.pm22
1 files changed, 8 insertions, 14 deletions
diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm
index 85ad77e17..fc2e05899 100644
--- a/Bugzilla/DB.pm
+++ b/Bugzilla/DB.pm
@@ -147,7 +147,7 @@ sub bz_check_requirements {
my $dbd_mod = $dbd->{module};
my $dbd_ver = $dbd->{version};
my $version = $dbd_ver ? " $dbd_ver or higher" : '';
- print <<EOT;
+ die <<EOT;
For $sql_server, Bugzilla requires that perl's $dbd_mod $dbd_ver or later be
installed. To install this module, run the following command (as $root):
@@ -155,7 +155,6 @@ installed. To install this module, run the following command (as $root):
$command
EOT
- exit;
}
# We don't try to connect to the actual database if $db_check is
@@ -178,14 +177,13 @@ EOT
if ( vers_cmp($sql_vers,$sql_want) > -1 ) {
print "ok: found v$sql_vers\n" if $output;
} else {
- print <<EOT;
+ die <<EOT;
Your $sql_server v$sql_vers is too old. Bugzilla requires version
$sql_want or later of $sql_server. Please download and install a
newer version.
EOT
- exit;
}
print "\n" if $output;
@@ -213,10 +211,9 @@ sub bz_create_database {
if (!$success) {
my $error = $dbh->errstr || $@;
chomp($error);
- print STDERR "The '$db_name' database could not be created.",
- " The error returned was:\n\n $error\n\n",
- _bz_connect_error_reasons();
- exit;
+ die "The '$db_name' database could not be created.",
+ " The error returned was:\n\n $error\n\n",
+ _bz_connect_error_reasons();
}
}
@@ -237,9 +234,8 @@ sub _get_no_db_connection {
# Can't use $dbh->errstr because $dbh is undef.
my $error = $DBI::errstr || $@;
chomp($error);
- print STDERR "There was an error connecting to $sql_server:\n\n",
- " $error\n\n", _bz_connect_error_reasons();
- exit;
+ die "There was an error connecting to $sql_server:\n\n",
+ " $error\n\n", _bz_connect_error_reasons(), "\n";
}
return $dbh;
}
@@ -1309,13 +1305,11 @@ sub _check_references {
}
}
else {
- print "\n", get_text('install_fk_invalid',
+ die "\n", get_text('install_fk_invalid',
{ table => $table, column => $column,
foreign_table => $foreign_table,
foreign_column => $foreign_column,
'values' => $bad_values }), "\n";
- # I just picked a number above 2, to be considered "abnormal exit"
- exit 3
}
}
}