[Automatic Bug Reporting Tool - ABRT] #747: Running tasks should be deletable
by fedora-badges
#747: Running tasks should be deletable
----------------------------+---------------------------------
Reporter: mtoman | Owner: crash-catcher@…
Type: defect | Status: new
Priority: major | Milestone: Retrace_server_GSS
Component: retrace-server | Version:
Keywords: | Blocked By:
Blocking: |
----------------------------+---------------------------------
If a task dies, it stays "Running" forever. Test whether retrace-server-
cleanups grabs them or implement a way to delete it.
--
Ticket URL: <https://fedorahosted.org/abrt/ticket/747>
Automatic Bug Reporting Tool - ABRT <http://example.org/>
Automatic bug reporting tool
11 years, 7 months
[LIBREPORT PATCH] rhbz#767186: show a link to a page describing the ABRT configuration
by Jakub Filak
Signed-off-by: Jakub Filak <jfilak(a)redhat.com>
---
src/gui-wizard-gtk/wizard.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
index c2a7a72..d148132 100644
--- a/src/gui-wizard-gtk/wizard.c
+++ b/src/gui-wizard-gtk/wizard.c
@@ -276,11 +276,13 @@ static void show_event_opt_error_dialog(const char *event_name)
event_config_t *ec = get_event_config(event_name);
char *message = xasprintf(_("Wrong settings detected for %s, "
"reporting will probably fail if you continue "
- "with the current configuration."),
+ "with the current configuration.\n\n"
+ "Read more about configuration on https://fedorahosted.org/abrt/wiki/AbrtConfiguration"),
ec->screen_name);
char *markup_message = xasprintf(_("Wrong settings detected for <b>%s</b>, "
"reporting will probably fail if you continue "
- "with the current configuration."),
+ "with the current configuration.\n\n"
+ "<a href=\"https://fedorahosted.org/abrt/wiki/AbrtConfiguration\">Read about configuration</a>"),
ec->screen_name);
GtkWidget *wrong_settings = g_top_most_window = gtk_message_dialog_new(GTK_WINDOW(g_wnd_assistant),
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
--
1.7.11.4
11 years, 7 months
[LIBREPORT PATCH v2] build: optional build of bugzilla plugin
by Nikola Pajkovsky
Signed-off-by: Nikola Pajkovsky <npajkovs(a)redhat.com>
---
configure.ac | 26 ++++++++++++++++++++++++++
doc/Makefile.am | 4 ++++
src/lib/Makefile.am | 8 ++++++--
src/plugins/Makefile.am | 36 ++++++++++++++++++++++++++----------
4 files changed, 62 insertions(+), 12 deletions(-)
diff --git a/configure.ac b/configure.ac
index 3efff1f..a9a1976 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,3 +1,20 @@
+# LIBREPORT_PARSE_WITH(PACKAGE)
+# -----------------------
+# For use in AC_ARG_WITH action-if-found, for packages default ON.
+# * Set NO_PACKAGE=YesPlease for --without-PACKAGE
+# * Unset NO_PACKAGE for --with-PACKAGE without ARG
+AC_DEFUN([LIBREPORT_PARSE_WITH],
+ [m4_pushdef([LIBREPORT_UC_PACKAGE], m4_toupper([$1]))dnl
+ if test "$withval" = "no"; then
+ NO_[]LIBREPORT_UC_PACKAGE=YesPlease
+ elif test "$withval" = "yes"; then
+ NO_[]LIBREPORT_UC_PACKAGE=
+ else
+ NO_[]LIBREPORT_UC_PACKAGE=
+ fi
+ m4_popdef([LIBREPORT_UC_PACKAGE])])
+
+
AC_INIT([libreport],
m4_esyscmd([cat ./libreport-version]),
[crash-catcher(a)fedorahosted.org])
@@ -66,6 +83,12 @@ AC_PATH_PROG([XMLTO], [xmlto], [no])
[exit 1]
[fi]
+AC_ARG_WITH(bugzilla,
+AS_HELP_STRING([--with-bugzilla],[use Bugzilla plugin (default is YES)]),
+LIBREPORT_PARSE_WITH([bugzilla]))
+
+if test -z "$NO_BUGZILLA"; then
+AM_CONDITIONAL(NO_BUGZILLA, true)
AC_PATH_PROG([XMLRPC], [xmlrpc-c-config], [no])
[if test "$XMLRPC" = "no"]
[then]
@@ -84,6 +107,9 @@ XMLRPC_CLIENT_CFLAGS=`xmlrpc-c-config client --cflags 2> /dev/null`
XMLRPC_CLIENT_LIBS=`xmlrpc-c-config client --libs 2> /dev/null`
AC_SUBST(XMLRPC_CLIENT_CFLAGS)
AC_SUBST(XMLRPC_CLIENT_LIBS)
+else
+AM_CONDITIONAL(NO_BUGZILLA, false)
+fi dnl end NO_BUGZILLA
AC_PATH_PROG([PYTHON], [python-config], [no])
[if test "$XMLTO" = "no"]
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 04e23c5..e63f18a 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -9,7 +9,11 @@ XMLTO_SILENT_0 = @echo " XMLTO " $@;
MAN1_TXT =
MAN1_TXT += report-cli.txt
+
+if NO_BUGZILLA
MAN1_TXT += reporter-bugzilla.txt
+endif
+
MAN1_TXT += reporter-kerneloops.txt
MAN1_TXT += reporter-mailx.txt
MAN1_TXT += reporter-print.txt
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 5befe7d..c2b8ec0 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -88,9 +88,13 @@ libabrt_dbus_la_LIBADD = \
$(GLIB_LIBS) \
$(DBUS_LIBS)
-libreport_web_la_SOURCES = \
+libreport_web_o =
+if NO_BUGZILLA
+libreport_web_o += abrt_xmlrpc.h abrt_xmlrpc.c
+endif
+
+libreport_web_la_SOURCES = $(libreport_web_o) \
curl.c \
- abrt_xmlrpc.h abrt_xmlrpc.c \
proxies.h proxies.c \
ureport.h json.c
libreport_web_la_CPPFLAGS = \
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index ea7d8b6..97bc365 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -1,7 +1,11 @@
pluginslibdir = $(PLUGINS_LIB_DIR)
-bin_PROGRAMS = \
- reporter-bugzilla \
+reporters_bin =
+if NO_BUGZILLA
+reporters_bin += reporter_bugzilla
+endif
+
+bin_PROGRAMS = $(reporters_bin) \
reporter-rhtsupport \
reporter-kerneloops \
reporter-upload \
@@ -14,16 +18,23 @@ pluginsconfdir = $(PLUGINS_CONF_DIR)
reportpluginsconfdir = $(REPORT_PLUGINS_CONF_DIR)
-dist_reportpluginsconf_DATA = \
- bugzilla.conf \
+reporters_plugin_conf =
+if NO_BUGZILLA
+reporters_plugin_conf += bugzilla.conf
+endif
+
+dist_reportpluginsconf_DATA = $(reporters_plugin_conf) \
rhtsupport.conf \
mailx.conf
eventsdir = $(EVENTS_DIR)
-dist_events_DATA = \
- report_Bugzilla.xml \
- report_Bugzilla.conf \
+reporters_events =
+if NO_BUGZILLA
+reporters_events += report_Bugzilla.xml report_Bugzilla.conf
+endif
+
+dist_events_DATA = $(reporters_events) \
report_Logger.conf \
report_Logger.xml \
report_Mailx.xml \
@@ -43,9 +54,12 @@ dist_eventsconf_DATA = \
rhtsupport_event.conf \
uploader_event.conf
-EXTRA_DIST = \
- report_Bugzilla.xml.in \
- report_Bugzilla.conf \
+reporters_extra_dist =
+if NO_BUGZILLA
+reporters_extra_dist += report_Bugzilla.xml.in report_Bugzilla.conf
+endif
+
+EXTRA_DIST = $(reporters_extra_dist) \
report_Logger.conf \
report_Logger.xml.in \
report_Mailx.xml.in \
@@ -57,6 +71,7 @@ EXTRA_DIST = \
$(DESTDIR)/$(DEBUG_INFO_DIR):
$(mkdir_p) '$@'
+if NO_BUGZILLA
reporter_bugzilla_SOURCES = \
reporter-bugzilla.c rhbz.c rhbz.h
reporter_bugzilla_CPPFLAGS = \
@@ -78,6 +93,7 @@ reporter_bugzilla_LDADD = \
$(XMLRPC_LIBS) $(XMLRPC_CLIENT_LIBS) \
../lib/libreport-web.la \
../lib/libreport.la
+endif
reporter_rhtsupport_SOURCES = \
abrt_rh_support.h abrt_rh_support.c \
--
1.7.12
11 years, 7 months
[PATCH] build: optional build of bugzilla plugin
by Nikola Pajkovsky
Signed-off-by: Nikola Pajkovsky <npajkovs(a)redhat.com>
---
configure.ac | 26 ++++++++++++++++++++++++++
doc/Makefile.am | 4 ++++
src/lib/Makefile.am | 8 ++++++--
src/plugins/Makefile.am | 36 ++++++++++++++++++++++++++----------
4 files changed, 62 insertions(+), 12 deletions(-)
diff --git a/configure.ac b/configure.ac
index 3efff1f..4a8bf39 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,3 +1,23 @@
+# LIBREPORT_PARSE_WITH(PACKAGE)
+# -----------------------
+# For use in AC_ARG_WITH action-if-found, for packages default ON.
+# * Set NO_PACKAGE=YesPlease for --without-PACKAGE
+# * Unset NO_PACKAGE for --with-PACKAGE without ARG
+AC_DEFUN([LIBREPORT_PARSE_WITH],
+ [m4_pushdef([LIBREPORT_UC_PACKAGE], m4_toupper([$1]))dnl
+ if test "$withval" = "no"; then
+ NO_[]LIBREPORT_UC_PACKAGE=YesPlease
+ AM_CONDITIONAL(NO_[]LIBREPORT_UC_PACKAGE, false)
+ elif test "$withval" = "yes"; then
+ NO_[]LIBREPORT_UC_PACKAGE=
+ AM_CONDITIONAL(NO_[]LIBREPORT_UC_PACKAGE, true)
+ else
+ NO_[]LIBREPORT_UC_PACKAGE=
+ AM_CONDITIONAL(NO_[]LIBREPORT_UC_PACKAGE, true)
+ fi
+ m4_popdef([LIBREPORT_UC_PACKAGE])])
+
+
AC_INIT([libreport],
m4_esyscmd([cat ./libreport-version]),
[crash-catcher(a)fedorahosted.org])
@@ -66,6 +86,11 @@ AC_PATH_PROG([XMLTO], [xmlto], [no])
[exit 1]
[fi]
+AC_ARG_WITH(bugzilla,
+AS_HELP_STRING([--with-bugzilla],[use Bugzilla plugin (default is YES)]),
+LIBREPORT_PARSE_WITH([bugzilla]))
+
+if test -z "$NO_BUGZILLA"; then
AC_PATH_PROG([XMLRPC], [xmlrpc-c-config], [no])
[if test "$XMLRPC" = "no"]
[then]
@@ -84,6 +109,7 @@ XMLRPC_CLIENT_CFLAGS=`xmlrpc-c-config client --cflags 2> /dev/null`
XMLRPC_CLIENT_LIBS=`xmlrpc-c-config client --libs 2> /dev/null`
AC_SUBST(XMLRPC_CLIENT_CFLAGS)
AC_SUBST(XMLRPC_CLIENT_LIBS)
+fi dnl end NO_BUGZILLA
AC_PATH_PROG([PYTHON], [python-config], [no])
[if test "$XMLTO" = "no"]
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 04e23c5..e63f18a 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -9,7 +9,11 @@ XMLTO_SILENT_0 = @echo " XMLTO " $@;
MAN1_TXT =
MAN1_TXT += report-cli.txt
+
+if NO_BUGZILLA
MAN1_TXT += reporter-bugzilla.txt
+endif
+
MAN1_TXT += reporter-kerneloops.txt
MAN1_TXT += reporter-mailx.txt
MAN1_TXT += reporter-print.txt
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 5befe7d..c2b8ec0 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -88,9 +88,13 @@ libabrt_dbus_la_LIBADD = \
$(GLIB_LIBS) \
$(DBUS_LIBS)
-libreport_web_la_SOURCES = \
+libreport_web_o =
+if NO_BUGZILLA
+libreport_web_o += abrt_xmlrpc.h abrt_xmlrpc.c
+endif
+
+libreport_web_la_SOURCES = $(libreport_web_o) \
curl.c \
- abrt_xmlrpc.h abrt_xmlrpc.c \
proxies.h proxies.c \
ureport.h json.c
libreport_web_la_CPPFLAGS = \
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index ea7d8b6..97bc365 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -1,7 +1,11 @@
pluginslibdir = $(PLUGINS_LIB_DIR)
-bin_PROGRAMS = \
- reporter-bugzilla \
+reporters_bin =
+if NO_BUGZILLA
+reporters_bin += reporter_bugzilla
+endif
+
+bin_PROGRAMS = $(reporters_bin) \
reporter-rhtsupport \
reporter-kerneloops \
reporter-upload \
@@ -14,16 +18,23 @@ pluginsconfdir = $(PLUGINS_CONF_DIR)
reportpluginsconfdir = $(REPORT_PLUGINS_CONF_DIR)
-dist_reportpluginsconf_DATA = \
- bugzilla.conf \
+reporters_plugin_conf =
+if NO_BUGZILLA
+reporters_plugin_conf += bugzilla.conf
+endif
+
+dist_reportpluginsconf_DATA = $(reporters_plugin_conf) \
rhtsupport.conf \
mailx.conf
eventsdir = $(EVENTS_DIR)
-dist_events_DATA = \
- report_Bugzilla.xml \
- report_Bugzilla.conf \
+reporters_events =
+if NO_BUGZILLA
+reporters_events += report_Bugzilla.xml report_Bugzilla.conf
+endif
+
+dist_events_DATA = $(reporters_events) \
report_Logger.conf \
report_Logger.xml \
report_Mailx.xml \
@@ -43,9 +54,12 @@ dist_eventsconf_DATA = \
rhtsupport_event.conf \
uploader_event.conf
-EXTRA_DIST = \
- report_Bugzilla.xml.in \
- report_Bugzilla.conf \
+reporters_extra_dist =
+if NO_BUGZILLA
+reporters_extra_dist += report_Bugzilla.xml.in report_Bugzilla.conf
+endif
+
+EXTRA_DIST = $(reporters_extra_dist) \
report_Logger.conf \
report_Logger.xml.in \
report_Mailx.xml.in \
@@ -57,6 +71,7 @@ EXTRA_DIST = \
$(DESTDIR)/$(DEBUG_INFO_DIR):
$(mkdir_p) '$@'
+if NO_BUGZILLA
reporter_bugzilla_SOURCES = \
reporter-bugzilla.c rhbz.c rhbz.h
reporter_bugzilla_CPPFLAGS = \
@@ -78,6 +93,7 @@ reporter_bugzilla_LDADD = \
$(XMLRPC_LIBS) $(XMLRPC_CLIENT_LIBS) \
../lib/libreport-web.la \
../lib/libreport.la
+endif
reporter_rhtsupport_SOURCES = \
abrt_rh_support.h abrt_rh_support.c \
--
1.7.12
11 years, 7 months
[LIBREPORT PATCH] trac#653: event config dialog: port from deprecated GtkTable to GtkGrid
by Jakub Filak
Signed-off-by: Jakub Filak <jfilak(a)redhat.com>
---
src/gtk-helpers/event_config_dialog.c | 104 ++++++++++++++++------------------
1 file changed, 48 insertions(+), 56 deletions(-)
diff --git a/src/gtk-helpers/event_config_dialog.c b/src/gtk-helpers/event_config_dialog.c
index 94cd1ea..a067511 100644
--- a/src/gtk-helpers/event_config_dialog.c
+++ b/src/gtk-helpers/event_config_dialog.c
@@ -21,7 +21,6 @@
static GtkWindow *g_event_list_window;
static GList *option_widget_list;
-static GtkWidget *g_adv_option_table;
static bool has_password_option;
enum
@@ -68,22 +67,20 @@ static void on_show_pass_store_cb(GtkToggleButton *tb, gpointer user_data)
set_user_setting("store_passwords", gtk_toggle_button_get_active(tb) ? "no" : "yes");
}
-static unsigned grow_table_by_1(GtkTable *table)
+static unsigned add_one_row_to_grid(GtkGrid *table)
{
- guint rows, columns;
- //needs gtk 2.22: gtk_table_get_size(table, &rows, &columns);
- g_object_get(table, "n-rows", &rows, NULL);
- g_object_get(table, "n-columns", &columns, NULL);
- gtk_table_resize(table, rows + 1, columns);
+ gulong rows = (gulong)g_object_get_data(G_OBJECT(table), "n-rows");
+ gtk_grid_insert_row(table, rows);
+ g_object_set_data(G_OBJECT(table), "n-rows", (gpointer)(rows + 1));
return rows;
}
static void add_option_to_table(gpointer data, gpointer user_data)
{
event_option_t *option = data;
- GtkTable *option_table = user_data;
+ GtkGrid *option_table = user_data;
if (option->is_advanced)
- option_table = GTK_TABLE(g_adv_option_table);
+ option_table = GTK_GRID(g_object_get_data(G_OBJECT(option_table), "advanced-options"));
GtkWidget *label;
GtkWidget *option_input;
@@ -107,32 +104,27 @@ static void add_option_to_table(gpointer data, gpointer user_data)
case OPTION_TYPE_TEXT:
case OPTION_TYPE_NUMBER:
case OPTION_TYPE_PASSWORD:
- last_row = grow_table_by_1(option_table);
+ last_row = add_one_row_to_grid(option_table);
label = gtk_label_new_justify_left(option_label);
- gtk_table_attach(option_table, label,
- /*left,right_attach:*/ 0, 1,
- /*top,bottom_attach:*/ last_row, last_row+1,
- /*x,yoptions:*/ GTK_FILL, GTK_FILL,
- /*x,ypadding:*/ 0, 0);
+ gtk_grid_attach(option_table, label,
+ /*left,top:*/ 0, last_row,
+ /*width,height:*/ 1, 1);
option_input = gtk_entry_new();
+ gtk_widget_set_hexpand(option_input, TRUE);
if (option->eo_value != NULL)
gtk_entry_set_text(GTK_ENTRY(option_input), option->eo_value);
- gtk_table_attach(option_table, option_input,
- /*left,right_attach:*/ 1, 2,
- /*top,bottom_attach:*/ last_row, last_row+1,
- /*x,yoptions:*/ GTK_FILL | GTK_EXPAND, GTK_FILL,
- /*x,ypadding:*/ 0, 0);
+ gtk_grid_attach(option_table, option_input,
+ /*left,top:*/ 1, last_row,
+ /*width,height:*/ 1, 1);
add_option_widget(option_input, option);
if (option->eo_type == OPTION_TYPE_PASSWORD)
{
gtk_entry_set_visibility(GTK_ENTRY(option_input), 0);
- last_row = grow_table_by_1(option_table);
+ last_row = add_one_row_to_grid(option_table);
GtkWidget *pass_cb = gtk_check_button_new_with_label(_("Show password"));
- gtk_table_attach(option_table, pass_cb,
- /*left,right_attach:*/ 1, 2,
- /*top,bottom_attach:*/ last_row, last_row+1,
- /*x,yoptions:*/ GTK_FILL, GTK_FILL,
- /*x,ypadding:*/ 0, 0);
+ gtk_grid_attach(option_table, pass_cb,
+ /*left,top:*/ 1, last_row,
+ /*width,height:*/ 1, 1);
g_signal_connect(pass_cb, "toggled", G_CALLBACK(on_show_pass_cb), option_input);
has_password_option = true;
}
@@ -144,22 +136,18 @@ static void add_option_to_table(gpointer data, gpointer user_data)
gtk_misc_set_alignment(GTK_MISC(label), /*x,yalign:*/ 0.0, 0.0);
make_label_autowrap_on_resize(GTK_LABEL(label));
- last_row = grow_table_by_1(option_table);
- gtk_table_attach(option_table, label,
- /*left,right_attach:*/ 0, 2,
- /*top,bottom_attach:*/ last_row, last_row+1,
- /*x,yoptions:*/ GTK_FILL, GTK_FILL,
- /*x,ypadding:*/ 0, 0);
+ last_row = add_one_row_to_grid(option_table);
+ gtk_grid_attach(option_table, label,
+ /*left,top:*/ 0, last_row,
+ /*width,height:*/ 2, 1);
break;
case OPTION_TYPE_BOOL:
- last_row = grow_table_by_1(option_table);
+ last_row = add_one_row_to_grid(option_table);
option_input = gtk_check_button_new_with_label(option_label);
- gtk_table_attach(option_table, option_input,
- /*left,right_attach:*/ 0, 2,
- /*top,bottom_attach:*/ last_row, last_row+1,
- /*x,yoptions:*/ GTK_FILL, GTK_FILL,
- /*x,ypadding:*/ 0, 0);
+ gtk_grid_attach(option_table, option_input,
+ /*left,top:*/ 0, last_row,
+ /*width,height:*/ 2, 1);
if (option->eo_value != NULL)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(option_input),
string_to_bool(option->eo_value));
@@ -180,12 +168,10 @@ static void add_option_to_table(gpointer data, gpointer user_data)
gtk_misc_set_alignment(GTK_MISC(label), /*x,yalign:*/ 0.0, 0.0);
make_label_autowrap_on_resize(GTK_LABEL(label));
- last_row = grow_table_by_1(option_table);
- gtk_table_attach(option_table, label,
- /*left,right_attach:*/ 1, 2,
- /*top,bottom_attach:*/ last_row, last_row+1,
- /*x,yoptions:*/ GTK_FILL, GTK_FILL,
- /*x,ypadding:*/ 0, 0);
+ last_row = add_one_row_to_grid(option_table);
+ gtk_grid_attach(option_table, label,
+ /*left,top:*/ 1, last_row,
+ /*top,heigh:*/ 1, 1);
}
free(option_label);
@@ -335,18 +321,26 @@ int show_event_config_dialog(const char *event_name, GtkWindow *parent)
gtk_window_get_icon_name(parent_window));
}
- GtkWidget *option_table = gtk_table_new(/*rows*/ 0, /*cols*/ 2, /*homogeneous*/ FALSE);
- gtk_table_set_row_spacings(GTK_TABLE(option_table), 2);
+ GtkWidget *option_table = gtk_grid_new();
+ gtk_grid_set_row_homogeneous(GTK_GRID(option_table), FALSE);
+ gtk_grid_set_column_homogeneous(GTK_GRID(option_table), FALSE);
+ gtk_grid_set_row_spacing(GTK_GRID(option_table), 2);
+ g_object_set_data(G_OBJECT(option_table), "n-rows", (gpointer)-1);
/* table to hold advanced options
* hidden in expander which is visible only if there's at least
* one advanced option
*/
- g_adv_option_table = gtk_table_new(/*rows*/ 0, /*cols*/ 2, /*homogeneous*/ FALSE);
- gtk_table_set_row_spacings(GTK_TABLE(g_adv_option_table), 2);
+ GtkWidget *adv_option_table = gtk_grid_new();
+ gtk_grid_set_row_homogeneous(GTK_GRID(adv_option_table), FALSE);
+ gtk_grid_set_column_homogeneous(GTK_GRID(adv_option_table), FALSE);
+ gtk_grid_set_row_spacing(GTK_GRID(adv_option_table), 2);
+ g_object_set_data(G_OBJECT(adv_option_table), "n-rows", (gpointer)-1);
+
GtkWidget *adv_expander = gtk_expander_new(_("Advanced"));
- gtk_container_add(GTK_CONTAINER(adv_expander), g_adv_option_table);
+ gtk_container_add(GTK_CONTAINER(adv_expander), adv_option_table);
+ g_object_set_data(G_OBJECT(option_table), "advanced-options", adv_option_table);
has_password_option = false;
g_list_foreach(event->options, &add_option_to_table, option_table);
@@ -354,13 +348,11 @@ int show_event_config_dialog(const char *event_name, GtkWindow *parent)
/* if there is at least one password option, add checkbox to disable storing passwords */
if (has_password_option)
{
- unsigned last_row = grow_table_by_1(GTK_TABLE(option_table));
+ unsigned last_row = add_one_row_to_grid(GTK_GRID(option_table));
GtkWidget *pass_store_cb = gtk_check_button_new_with_label(_("Don't store passwords"));
- gtk_table_attach(GTK_TABLE(option_table), pass_store_cb,
- /*left,right_attach:*/ 0, 1,
- /*top,bottom_attach:*/ last_row, last_row+1,
- /*x,yoptions:*/ GTK_FILL, GTK_FILL,
- /*x,ypadding:*/ 0, 0);
+ gtk_grid_attach(GTK_GRID(option_table), pass_store_cb,
+ /*left,top:*/ 0, last_row,
+ /*width,height:*/ 1, 1);
const char *store_passwords = get_user_setting("store_passwords");
if (store_passwords && !strcmp(store_passwords, "no"))
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pass_store_cb), 1);
@@ -371,7 +363,7 @@ int show_event_config_dialog(const char *event_name, GtkWindow *parent)
gtk_box_pack_start(GTK_BOX(content), option_table, false, false, 20);
/* add the adv_option_table to the dialog only if there is some adv option */
- if (g_list_length(gtk_container_get_children(GTK_CONTAINER(g_adv_option_table))) > 0)
+ if (g_list_length(gtk_container_get_children(GTK_CONTAINER(adv_option_table))) > 0)
gtk_box_pack_start(GTK_BOX(content), adv_expander, false, false, 0);
/* add warning if secrets service is not available showing the nagging dialog
--
1.7.11.4
11 years, 7 months
[PATCH v4] Provide package data for kernel oops
by Richard Marko
Required for reporter-ureport to work with kernel oopses.
Signed-off-by: Richard Marko <rmarko(a)redhat.com>
---
abrt.spec.in | 1 +
src/plugins/Makefile.am | 3 ++-
src/plugins/abrt-action-save-kernel-data | 36 ++++++++++++++++++++++++++++++++
src/plugins/koops_event.conf | 1 +
4 files changed, 40 insertions(+), 1 deletion(-)
create mode 100755 src/plugins/abrt-action-save-kernel-data
diff --git a/abrt.spec.in b/abrt.spec.in
index a1c00ba..65a03d3 100644
--- a/abrt.spec.in
+++ b/abrt.spec.in
@@ -571,6 +571,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%endif
%{_bindir}/abrt-dump-oops
%{_bindir}/abrt-action-analyze-oops
+%{_bindir}/abrt-action-save-kernel-data
%{_mandir}/man1/abrt-action-analyze-oops.1*
%files addon-xorg
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index 675b1a7..8829c06 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -4,7 +4,8 @@ bin_SCRIPTS = \
abrt-action-install-debuginfo \
abrt-action-analyze-core \
abrt-action-analyze-vmcore \
- abrt-action-list-dsos
+ abrt-action-list-dsos \
+ abrt-action-save-kernel-data
bin_PROGRAMS = \
abrt-watch-log \
diff --git a/src/plugins/abrt-action-save-kernel-data b/src/plugins/abrt-action-save-kernel-data
new file mode 100755
index 0000000..84bd447
--- /dev/null
+++ b/src/plugins/abrt-action-save-kernel-data
@@ -0,0 +1,36 @@
+#!/bin/bash
+#
+# Save pkg_{name, arch, version, release} for kernel oopses.
+#
+# These files are required by reporter-ureporter (mandatory
+# in uReport).
+#
+
+test -f kernel || exit 1
+
+echo "Looking for kernel package"
+kernel_package="kernel"
+kernel_version="$( sed 's/ .*//' kernel )"
+
+if grep -q "PAE" kernel; then
+ echo "Looking for PAE kernel"
+ kernel_package="kernel-PAE"
+ kernel_version="$( echo "$kernel_version" | sed 's/\.PAE//' )"
+fi
+
+package="$( rpm -q "$kernel_package" | grep "$kernel_version" )"
+if [ $? == 0 ]; then
+ echo "Kernel package $package found"
+ rpm -q --qf "%{name}\n" "$package" > pkg_name
+ rpm -q --qf "%{arch}\n" "$package" > pkg_arch
+ rpm -q --qf "%{version}\n" "$package" > pkg_version
+ rpm -q --qf "%{release}\n" "$package" > pkg_release
+ epoch="$( rpm -q --qf "%{epoch}" "$package" )"
+ if [ "$epoch" == "(none)" ]; then
+ echo "0" > pkg_epoch
+ else
+ echo "$epoch" > pkg_epoch
+ fi
+else
+ echo "Kernel package not found, tried version $kernel_version"
+fi
diff --git a/src/plugins/koops_event.conf b/src/plugins/koops_event.conf
index 91759b1..9369131 100644
--- a/src/plugins/koops_event.conf
+++ b/src/plugins/koops_event.conf
@@ -3,6 +3,7 @@ EVENT=post-create analyzer=Kerneloops
abrt-action-analyze-oops &&
dmesg >dmesg &&
abrt-action-generate-core-backtrace
+ abrt-action-save-kernel-data
# If you want behavior similar to one provided by kerneloops daemon
# distributed by kerneloops.org - that is, if you want
--
1.7.11.4
11 years, 7 months
[ABRT PATCH] rhbz#853641: introduce the analyze smart event
by Jakub Filak
- the event takes care about asking user for permission to do something
which needs user's permission (upload coredump, run local analysis)
- the event starts the local analysis if the remote analysis fails or if
the remote analysis was rejected by user
Signed-off-by: Jakub Filak <jfilak(a)redhat.com>
---
abrt.spec.in | 2 +
po/POTFILES.in | 2 +
src/plugins/Makefile.am | 9 +++
src/plugins/abrt-action-analyze-smart.in | 117 +++++++++++++++++++++++++++++++
src/plugins/analyze_Smart.xml.in | 41 +++++++++++
src/plugins/ccpp_event.conf | 5 +-
6 files changed, 175 insertions(+), 1 deletion(-)
create mode 100644 src/plugins/abrt-action-analyze-smart.in
create mode 100644 src/plugins/analyze_Smart.xml.in
diff --git a/abrt.spec.in b/abrt.spec.in
index a1c00ba..ebb81a0 100644
--- a/abrt.spec.in
+++ b/abrt.spec.in
@@ -467,12 +467,14 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%{_bindir}/abrt-handle-upload
%{_bindir}/abrt-action-save-package-data
%{_bindir}/abrt-watch-log
+%{_bindir}/abrt-action-analyze-smart
%config(noreplace) %{_sysconfdir}/%{name}/abrt.conf
%config(noreplace) %{_sysconfdir}/%{name}/abrt-action-save-package-data.conf
%config(noreplace) %{_sysconfdir}/%{name}/gpg_keys
%config(noreplace) %{_sysconfdir}/libreport/events.d/abrt_event.conf
%config(noreplace) %{_sysconfdir}/libreport/events.d/smart_event.conf
%config(noreplace) %{_sysconfdir}/libreport/events.d/smolt_event.conf
+%config(noreplace) %{_sysconfdir}/libreport/events/analyze_Smart.xml
%dir %attr(0755, abrt, abrt) %{_localstatedir}/spool/%{name}
%dir %attr(0700, abrt, abrt) %{_localstatedir}/spool/%{name}-upload
# abrtd runs as root
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 3bd7a1b..095aef2 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -17,6 +17,7 @@ src/plugins/abrt-action-analyze-backtrace.c
src/plugins/abrt-action-analyze-c.c
src/plugins/abrt-action-analyze-oops.c
src/plugins/abrt-action-analyze-python.c
+src/plugins/abrt-action-analyze-smart.in
src/plugins/abrt-action-analyze-vmcore.in
src/plugins/abrt-action-generate-backtrace.c
src/plugins/abrt-action-generate-core-backtrace.c
@@ -35,6 +36,7 @@ src/plugins/bodhi.c
src/cli/abrt-cli.c
src/cli/list.c
+src/plugins/analyze_Smart.xml.in
src/plugins/analyze_VMcore.xml.in
src/plugins/collect_GConf.xml.in
src/plugins/collect_Smolt.xml.in
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index 675b1a7..7d1f523 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -3,6 +3,7 @@
bin_SCRIPTS = \
abrt-action-install-debuginfo \
abrt-action-analyze-core \
+ abrt-action-analyze-smart \
abrt-action-analyze-vmcore \
abrt-action-list-dsos
@@ -30,6 +31,7 @@ eventsdir = $(EVENTS_DIR)
dist_events_DATA = \
analyze_LocalGDB.xml \
analyze_RetraceServer.xml \
+ analyze_Smart.xml \
analyze_VMcore.xml \
collect_xsession_errors.xml \
collect_Smolt.xml \
@@ -59,6 +61,7 @@ PYTHON_FILES = \
abrt-action-install-debuginfo.in \
abrt-action-list-dsos \
abrt-action-analyze-core \
+ abrt-action-analyze-smart.in \
abrt-action-analyze-vmcore.in
EXTRA_DIST = \
@@ -70,6 +73,7 @@ EXTRA_DIST = \
collect_vimrc_system.xml.in \
analyze_LocalGDB.xml.in \
analyze_RetraceServer.xml.in \
+ analyze_Smart.xml.in \
analyze_VMcore.xml.in \
abrt-action-analyze-vmcore \
https-utils.h \
@@ -266,3 +270,8 @@ abrt_bodhi_SOURCES = \
DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
+
+
+abrt-action-analyze-smart: abrt-action-analyze-smart.in
+ sed -e s,\@libexecdir\@,$(libexecdir),g \
+ $< >$@
diff --git a/src/plugins/abrt-action-analyze-smart.in b/src/plugins/abrt-action-analyze-smart.in
new file mode 100644
index 0000000..399b349
--- /dev/null
+++ b/src/plugins/abrt-action-analyze-smart.in
@@ -0,0 +1,117 @@
+#!/usr/bin/env python
+"""This module provides a function for executing of disjunction of analyze
+events.
+"""
+
+import sys
+import os
+from argparse import ArgumentParser
+import locale
+import gettext
+from subprocess import Popen
+
+
+GETTEXT_PROGNAME = "abrt-action-analyze-smart"
+
+_ = gettext.lgettext
+
+def ask_yes_no_save_result(option_name, question):
+ """Asks user for answer to yes/no/yesforever question.
+
+ Keyword arguments:
+ option_name -- a key for configuration to store the yesforever answer
+ question -- a displayed question
+
+ Returns True if user's answer is yes or yes forever; otherwise returns
+ False.
+
+ """
+
+ sys.stdout.write("ASK_YES_NO_YESFOREVER {0} {1}\n"
+ .format(option_name, question))
+ sys.stdout.flush()
+ return sys.stdin.readline() == "yes\n"
+
+def handle_event(event_name, problem_dir):
+ """Helper function handling a single event
+
+ Keyword arguments:
+ envet_name -- a name of handled event
+ problem_dir -- a path to problem directory
+
+ Returns True if the handled event was successfully executed; otherwise
+ returns False.
+
+ """
+
+ executable = "@libexecdir@/abrt-handle-event"
+ try:
+ proc = Popen([executable, "-e", event_name, "--", problem_dir])
+ return proc.wait() == 0
+ except OSError as e:
+ sys.stderr.write("Can't run '{0}': {1}\n".format(executable, e))
+ sys.exit(1)
+
+
+def run_analyze_smart(problem_dir):
+ """Runs analyze_RetraceServer event or analyze_LocalGB event.
+
+ At first runs analyze_RetraceServer. If user dismisses
+ analyze_RetraceServer event or if the run fails the analyze_LocalGDB event
+ will be run.
+
+ Keyword arguments:
+ problem_dir -- a path to problem directory
+
+ Returns True if any of the events was successfuly performed; otherwise
+ returns False.
+
+ """
+
+ analyzed = False
+ allowed = ask_yes_no_save_result("abrt_analyze_smart_ask_upload_coredump",
+ _("Ok to upload core dump? (It may contain sensitive data). "\
+ "If your answer is 'No', a stack trace will be generated localy. "\
+ "(It may download a huge amount of data)."))
+
+ if allowed:
+ analyzed = handle_event("analyze_RetraceServer", problem_dir)
+
+ # temporary helper variables for better readability
+ option = "abrt_analyze_smart_ask_perform_local_analysis"
+ question = _("Do you want to generate a stack trace localy? "\
+ "(It may download a huge amount of data but reporting "\
+ "can't continue without stack trace).")
+
+ # run local GDB if the retrace event was dismissed
+ # or if the retrace event failed and user gave us permission to run local GDB
+ if not allowed or (not analyzed and ask_yes_no_save_result(option, question)):
+ analyzed = handle_event("analyze_LocalGDB", problem_dir)
+
+ return analyzed
+
+
+if __name__ == "__main__":
+ try:
+ locale.setlocale(locale.LC_ALL, "")
+ except locale.Error:
+ os.environ['LC_ALL'] = 'C'
+ locale.setlocale(locale.LC_ALL, "")
+
+ # Defeat "AttributeError: 'module' object has no attribute 'nl_langinfo'"
+ try:
+ gettext.bind_textdomain_codeset(GETTEXT_PROGNAME,
+ locale.nl_langinfo(locale.CODESET))
+ except AttributeError:
+ pass
+
+ gettext.bindtextdomain(GETTEXT_PROGNAME, '/usr/share/locale')
+ gettext.textdomain(GETTEXT_PROGNAME)
+
+ CMDARGS = ArgumentParser(description = _('Smartly runs analyze events'))
+ CMDARGS.add_argument('-d', '--problem-dir', type=str,
+ default='.', help=_('Problem directory'))
+
+ OPTIONS = CMDARGS.parse_args()
+
+ sys.exit(0 if run_analyze_smart(vars(OPTIONS)['problem_dir']) else 1)
diff --git a/src/plugins/analyze_Smart.xml.in b/src/plugins/analyze_Smart.xml.in
new file mode 100644
index 0000000..2d4aa3b
--- /dev/null
+++ b/src/plugins/analyze_Smart.xml.in
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<event>
+ <name>Smart Analyze Event</name>
+ <_description>Send core dump to remote retrace server for analysis or perform local analysis if the remote analysis fails</_description>
+ <_long-description>Uploads coredump to a server, which generates backtrace and returns it. If user doens't want to upload his coredump to anywhere the event performs local analysis. Local analysis is run event if remote analysis fails.
+ Pros: no need for debuginfo downloads. Retrace server's database of debuginfos is more complete. Retrace server may generate better backtraces.
+ Cons: coredump you upload contains all the data from the crashed program, including your private data, if any.
+ </_long-description>
+ <creates-items>backtrace</creates-items>
+ <gui-review-elements>no</gui-review-elements>
+
+ <!-- The event shows a message about sensitive data on its own.
+ It has to ask user on its own because other tools interrupts
+ processing at all if user rejects sending of sensitive data.
+ The second result for showing the question on its own is that the
+ event implementation automatically runs the analyze_LocalGDB event if
+ user dismisses the analyze_RetraceServer event. -->
+ <sending-sensitive-data>no</sending-sensitive-data>
+
+ <!-- The following options are taken from analyze_RetraceServer
+ event configuration because the analyze smart event internally runs
+ the analyze_RetraceServer. The current implementation of the event
+ and libreport's run event framework can't load configuration of an
+ internally executed event. This causes that user can be forced to
+ configure remote analysis on two different places. -->
+ <options>
+ <option type="text" name="RETRACE_SERVER_URL">
+ <_label>Retrace server URL</_label>
+ <default-value>retrace.fedoraproject.org</default-value>
+ <allow-empty>no</allow-empty>
+ <_description>Address of the retrace server</_description>
+ </option>
+ <option type="text" name="RETRACE_SERVER_INSECURE">
+ <_label>Insecure</_label>
+ <allow-empty>yes</allow-empty>
+ <_description>Whether or not to use insecure connection</_description>
+ <_note-html>Write "insecure" to allow insecure connection <a href="https://fedorahosted.org/abrt/wiki/AbrtRetraceServerInsecureConnection" >(warning)</a></_note-html>
+ </option>
+
+ </options>
+</event>
diff --git a/src/plugins/ccpp_event.conf b/src/plugins/ccpp_event.conf
index 81b14d2..0d6300e 100644
--- a/src/plugins/ccpp_event.conf
+++ b/src/plugins/ccpp_event.conf
@@ -56,6 +56,9 @@ EVENT=report_uReport analyzer=CCpp
EVENT=post_report analyzer=CCpp
reporter-ureport -r
+EVENT=analyze_Smart analyzer=CCpp
+ abrt-action-analyze-smart
+
# Reporting of C/Cpp problems
EVENT=report-gui analyzer=CCpp
- report-gtk -e report_uReport -e analyze_RetraceServer -e report_Bugzilla -e post_report -- "$DUMP_DIR"
+ report-gtk -e report_uReport -e analyze_Smart -e report_Bugzilla -e post_report -- "$DUMP_DIR"
--
1.7.11.4
11 years, 7 months