summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2017-06-17 03:24:22 +0200
committerDylan William Hardison <dylan@hardison.net>2017-06-17 03:41:43 +0200
commit47a27759d3397b44480540483e40a6d363613736 (patch)
treede0e3e3e41fd03c462d1e828926953e648ae6e8c
parentb5c02dfb5889ab74677e9f79b1640165515f7afb (diff)
downloadbugzilla-47a27759d3397b44480540483e40a6d363613736.tar.gz
bugzilla-47a27759d3397b44480540483e40a6d363613736.tar.xz
add --user-pref option to generate_bmo_data.pl
this option is used by bmo-ci to turn off the bug_modal interface
-rwxr-xr-xscripts/generate_bmo_data.pl9
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/generate_bmo_data.pl b/scripts/generate_bmo_data.pl
index fefeb06d6..788227443 100755
--- a/scripts/generate_bmo_data.pl
+++ b/scripts/generate_bmo_data.pl
@@ -22,6 +22,7 @@ use Bugzilla::Keyword;
use Bugzilla::Config qw(:admin);
use Bugzilla::User::Setting;
use Bugzilla::Status;
+use Getopt::Long qw( :config gnu_getopt );
BEGIN { Bugzilla->extensions }
@@ -30,9 +31,6 @@ my $dbh = Bugzilla->dbh;
# set Bugzilla usage mode to USAGE_MODE_CMDLINE
Bugzilla->usage_mode(USAGE_MODE_CMDLINE);
-my $admin_email = shift || 'admin@mozilla.bugs';
-Bugzilla->set_user(Bugzilla::User->check({ name => $admin_email }));
-
##########################################################################
# Set Default User Preferences
##########################################################################
@@ -65,6 +63,11 @@ my %user_prefs = (
zoom_textareas => 'off',
);
+GetOptions('user-pref=s%' => \%user_prefs);
+
+my $admin_email = shift || 'admin@mozilla.bugs';
+Bugzilla->set_user(Bugzilla::User->check({ name => $admin_email }));
+
foreach my $pref (keys %user_prefs) {
my $value = $user_prefs{$pref};
Bugzilla::User::Setting::set_default($pref, $value, 1);