summaryrefslogtreecommitdiffstats
path: root/Bugzilla.pm
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-12-09 20:51:33 +0100
committerlpsolit%gmail.com <>2006-12-09 20:51:33 +0100
commitaccd734fd5a4ac2d242997c110c1924844219ba7 (patch)
tree2f82a2be166e2aea8bf75cc6aaa17374f0d9534a /Bugzilla.pm
parent850da7d0ea8233e343d31f159a9f21c18b0f1390 (diff)
downloadbugzilla-accd734fd5a4ac2d242997c110c1924844219ba7.tar.gz
bugzilla-accd734fd5a4ac2d242997c110c1924844219ba7.tar.xz
Bug 361252: checksetup.pl should get confirmation from the user before causing dataloss in UTF8 conversion - Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit a=myk
Diffstat (limited to 'Bugzilla.pm')
-rw-r--r--Bugzilla.pm32
1 files changed, 32 insertions, 0 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm
index 7c52dd500..32f731859 100644
--- a/Bugzilla.pm
+++ b/Bugzilla.pm
@@ -327,6 +327,28 @@ sub usage_mode {
|| Bugzilla::Constants::USAGE_MODE_BROWSER;
}
+sub installation_mode {
+ my ($class, $newval) = @_;
+ ($class->request_cache->{installation_mode} = $newval) if defined $newval;
+ return $class->request_cache->{installation_mode}
+ || INSTALLATION_MODE_INTERACTIVE;
+}
+
+sub installation_answers {
+ my ($class, $filename) = @_;
+ if ($filename) {
+ my $s = new Safe;
+ $s->rdo($filename);
+
+ die "Error reading $filename: $!" if $!;
+ die "Error evaluating $filename: $@" if $@;
+
+ # Now read the param back out from the sandbox
+ $class->request_cache->{installation_answers} = $s->varglob('answer');
+ }
+ return $class->request_cache->{installation_answers} || {};
+}
+
sub switch_to_shadow_db {
my $class = shift;
@@ -570,6 +592,16 @@ usage mode.
C<Bugzilla->usage_mode> will return the current state of this flag.
+=item C<installation_mode>
+
+Determines whether or not installation should be silent. See
+L<Bugzilla::Constants> for the C<INSTALLATION_MODE> constants.
+
+=item C<installation_answers>
+
+Returns a hashref representing any "answers" file passed to F<checksetup.pl>,
+used to automatically answer or skip prompts.
+
=item C<dbh>
The current database handle. See L<DBI>.