summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-01-31 14:46:48 +0000
committerThierry Vignaud <tv@mandriva.org>2008-01-31 14:46:48 +0000
commit58ff427d70d13f03ee831cd9be63a0b1cbf6475e (patch)
tree9c3ed2612209275cd3ec94207d61241b6156a8b5 /perl-install
parent05c13b52de5aefa8590712dd2beb31276e70ca2f (diff)
downloaddrakx-backup-do-not-use-58ff427d70d13f03ee831cd9be63a0b1cbf6475e.tar
drakx-backup-do-not-use-58ff427d70d13f03ee831cd9be63a0b1cbf6475e.tar.gz
drakx-backup-do-not-use-58ff427d70d13f03ee831cd9be63a0b1cbf6475e.tar.bz2
drakx-backup-do-not-use-58ff427d70d13f03ee831cd9be63a0b1cbf6475e.tar.xz
drakx-backup-do-not-use-58ff427d70d13f03ee831cd9be63a0b1cbf6475e.zip
(report_bug_to_bugzilla) split it out for readability & reasonable indentation
Diffstat (limited to 'perl-install')
-rwxr-xr-xperl-install/standalone/drakbug88
1 files changed, 43 insertions, 45 deletions
diff --git a/perl-install/standalone/drakbug b/perl-install/standalone/drakbug
index 63d4868da..365d90442 100755
--- a/perl-install/standalone/drakbug
+++ b/perl-install/standalone/drakbug
@@ -166,51 +166,7 @@ gtkadd($window->{window},
0, gtkpack(create_hbox('edge'),
gtksignal_connect(Gtk2::Button->new(N("Help")), clicked => sub { system("drakhelp --id drakbug &") }),
gtkpack(create_hbox('end'),
- gtksignal_connect(Gtk2::Button->new(N("Report")), clicked => sub {
- my $p = $package->get_text;
- my ($product, $version) = $p =~ /^(.*)-([^-]+-[^-]+(mdk|mdv.*))$/; # FIXME: fragile!
- my $app = $comb_app->entry->get_text;
- my $component = $app ?
- if_(member($app, @all_drakxtools), $app) || $mdk_app->{$app} :
- $product;
- my $text;
- if ($incident) {
- my $buffer = $user_descr->get_buffer;
- $text = $buffer->get_text($buffer->get_start_iter, $buffer->get_end_iter, 0);
- if (!$text) {
- err_dialog(N("Warning"),
- N("You must type in what you were doing when this bug happens in order to increase the reproductibility of this bug and the odds of fixing it")
- . "\n\n" . N("Thanks."));
- return;
- }
- }
- my $rel_data = mandrake_release_info();
- my $rel = standalone::real_version();
- my $options = join('&',
- ($product || $version ?
- 'cf_rpmpkg=' . join('-', $product, $version) : ()),
-'version=' . ($rel_data->{branch} eq 'Devel' ? 'Cooker' : $rel_data->{version} ),
- 'component=Core%20Packages',
- 'classification=Mandriva%20Linux',
- if_($incident,
- "short_desc=$prog%20" . ($segfaulted ? 'segfaulted' : 'crashed'),
- 'comment=' . uri_escape(qq(The "$prog" program crashed. Drakbug-$rel caught it.
-
-). ($text || "Please describe what you were doing when it crashed.") . "\n\n"
-. ($error ? qq(Backtrace was:
-$error) :
-qq(If you can, try to run the "$prog" program from a terminal and copy and paste here any error messages and/or backtrace))
- . if_($gdb_trace, qq(
-GDB backtrace was:
-$gdb_trace)),
- ),
- ),
- );
- print($bugzilla_url . "?" . $options . "\n");
- run_program::raw({ detach => 1, setuid => $parent_uid },
- '/usr/bin/www-browser', "$bugzilla_url?$options");
- }
- ),
+ gtksignal_connect(Gtk2::Button->new(N("Report")), clicked => \&report_bug_to_bugzilla),
gtksignal_connect(Gtk2::Button->new(N("Close")), clicked => sub { ugtk2->exit(0) }),
))));
@@ -266,4 +222,46 @@ sub get_package {
$rpm_package;
}
+sub report_bug_to_bugzilla {
+ my $p = $package->get_text;
+ my ($product, $version) = $p =~ /^(.*)-([^-]+-[^-]+(mdk|mdv.*))$/; # FIXME: fragile!
+ my $app = $comb_app->entry->get_text;
+ my $component = $app ?
+ if_(member($app, @all_drakxtools), $app) || $mdk_app->{$app} :
+ $product;
+ my $text;
+ if ($incident) {
+ my $buffer = $user_descr->get_buffer;
+ $text = $buffer->get_text($buffer->get_start_iter, $buffer->get_end_iter, 0);
+ if (!$text) {
+ err_dialog(N("Warning"),
+ N("You must type in what you were doing when this bug happens in order to increase the reproductibility of this bug and the odds of fixing it")
+ . "\n\n" . N("Thanks."));
+ return;
+ }
+ }
+ my $rel_data = mandrake_release_info();
+ my $rel = standalone::real_version();
+ my $options = join('&',
+ ($product || $version ? 'cf_rpmpkg=' . join('-', $product, $version) : ()),
+ 'version=' . ($rel_data->{branch} eq 'Devel' ? 'Cooker' : $rel_data->{version} ),
+ 'component=Core%20Packages',
+ 'classification=Mandriva%20Linux',
+ if_($incident,
+ "short_desc=$prog%20" . ($segfaulted ? 'segfaulted' : 'crashed'),
+ 'comment=' . uri_escape(qq(The "$prog" program crashed. Drakbug-$rel caught it.
+
+). ($text || "Please describe what you were doing when it crashed.") . "\n\n"
+ . ($error ? qq(Backtrace was:
+$error) :
+ qq(If you can, try to run the "$prog" program from a terminal and copy and paste here any error messages and/or backtrace))
+ . if_($gdb_trace, qq(
+GDB backtrace was:
+$gdb_trace)),
+ ),
+ ),
+ );
+ print($bugzilla_url . "?" . $options . "\n");
+ run_program::raw({ detach => 1, setuid => $parent_uid }, '/usr/bin/www-browser', "$bugzilla_url?$options");
+}