From accd734fd5a4ac2d242997c110c1924844219ba7 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Sat, 9 Dec 2006 19:51:33 +0000 Subject: Bug 361252: checksetup.pl should get confirmation from the user before causing dataloss in UTF8 conversion - Patch by Max Kanat-Alexander r=LpSolit a=myk --- Bugzilla.pm | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'Bugzilla.pm') 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. Cusage_mode> will return the current state of this flag. +=item C + +Determines whether or not installation should be silent. See +L for the C constants. + +=item C + +Returns a hashref representing any "answers" file passed to F, +used to automatically answer or skip prompts. + =item C The current database handle. See L. -- cgit v1.2.3-24-g4f1b