[libreport/f16] silent keyring warning

Jiří Moskovčák jmoskovc at fedoraproject.org
Tue Aug 2 14:33:55 UTC 2011


commit 9ab22e97311e5cac51cc6932ac588747bac80af2
Author: Jiri Moskovcak <jmoskovc at redhat.com>
Date:   Tue Aug 2 16:28:35 2011 +0200

    silent keyring warning

 ...ly-if-keyring-is-not-available-rhbz-72585.patch |  186 ++++++++++++++++++++
 ...d-event-configuration-when-dump_dir-chang.patch |   30 +++
 ...configure-event-button-to-wrong-settings-.patch |   87 +++++++++
 ...-settings-only-for-last-selected-reporter.patch |   84 +++++++++
 0015-honor-minimal-rating.patch                    |  139 +++++++++++++++
 ...nimal-rating-entry-to-all-event-xml-files.patch |   63 +++++++
 0026-rhbz-724999-fix-null-in-summary.patch         |   62 +++++++
 emptylines_interactive_di.patch                    |   48 +++++
 fix_adding_external_files_to_report.patch          |   21 +++
 libreport.spec                                     |   46 +++--
 10 files changed, 749 insertions(+), 17 deletions(-)
---
diff --git a/0001-warn-silently-if-keyring-is-not-available-rhbz-72585.patch b/0001-warn-silently-if-keyring-is-not-available-rhbz-72585.patch
new file mode 100644
index 0000000..631328f
--- /dev/null
+++ b/0001-warn-silently-if-keyring-is-not-available-rhbz-72585.patch
@@ -0,0 +1,186 @@
+From b3256793135b3466b85090f081373c428cd2c571 Mon Sep 17 00:00:00 2001
+From: Jiri Moskovcak <jmoskovc at redhat.com>
+Date: Sun, 31 Jul 2011 14:05:02 +0200
+Subject: [PATCH 1/4] warn silently if keyring is not available rhbz#725858
+
+- we shouldn't print anything to stdout -> users understand it as a bug
+  (at least when they see it in anaconda output)
+- popup dialog is too "heavy", red text warning in the config dialog
+  (as it was in abrt-1.x) should be enough)
+---
+ src/gtk-helpers/abrt-keyring.c           |   10 ++++++-
+ src/gtk-helpers/event_config_dialog.c    |   36 +++++++++++++++++++++++------
+ src/gtk-helpers/internal_libreport_gtk.h |    5 ++++
+ 3 files changed, 41 insertions(+), 10 deletions(-)
+
+diff --git a/src/gtk-helpers/abrt-keyring.c b/src/gtk-helpers/abrt-keyring.c
+index 7999818..4e830ca 100644
+--- a/src/gtk-helpers/abrt-keyring.c
++++ b/src/gtk-helpers/abrt-keyring.c
+@@ -22,6 +22,7 @@
+ 
+ static char *keyring_name;
+ static bool got_keyring = 0;
++bool g_keyring_available = 1; //by default we assume that keyring is available
+ 
+ guint32 find_keyring_item_id_for_event(const char *event_name)
+ {
+@@ -49,6 +50,10 @@ guint32 find_keyring_item_id_for_event(const char *event_name)
+ 
+ static void abrt_keyring_load_settings(const char *event_name, event_config_t *ec)
+ {
++    //don't bother when we already know that keyring is not available
++    if (!g_keyring_available)
++        return;
++
+     guint item_id = find_keyring_item_id_for_event(event_name);
+     if (!item_id)
+         return;
+@@ -81,12 +86,13 @@ static void abrt_keyring_load_settings(const char *event_name, event_config_t *e
+ static void init_keyring()
+ {
+     /* Called again? */
+-    if (got_keyring)
++    if (got_keyring || !g_keyring_available)
+         return;
+ 
+     if (!gnome_keyring_is_available())
+     {
+-        error_msg("Cannot connect to Gnome keyring daemon");
++        g_keyring_available = 0;
++        VERB1 error_msg("Cannot connect to Gnome keyring daemon");
+         return;
+     }
+ 
+diff --git a/src/gtk-helpers/event_config_dialog.c b/src/gtk-helpers/event_config_dialog.c
+index c06ba4b..430fa9b 100644
+--- a/src/gtk-helpers/event_config_dialog.c
++++ b/src/gtk-helpers/event_config_dialog.c
+@@ -36,7 +36,7 @@ typedef struct
+     GtkWidget *widget;
+ } option_widget_t;
+ 
+-static void show_event_config_dialog(const char *event_name);
++int show_event_config_dialog(const char *event_name, GtkWindow *parent);
+ 
+ static GtkWidget *gtk_label_new_justify_left(const gchar *label_str)
+ {
+@@ -211,7 +211,7 @@ static void on_configure_event_cb(GtkWidget *button, gpointer user_data)
+     GtkTreeView *events_tv = (GtkTreeView *)user_data;
+     char *event_name = get_event_name_from_row(events_tv);
+     if (event_name != NULL)
+-        show_event_config_dialog(event_name);
++        show_event_config_dialog(event_name, NULL);
+     //else
+     //    error_msg(_("Please select a plugin from the list to edit its options."));
+ }
+@@ -221,7 +221,7 @@ static void on_event_row_activated_cb(GtkTreeView *treeview, GtkTreePath *path,
+     char *event_name = get_event_name_from_row(treeview);
+     event_config_t *ec = get_event_config(event_name);
+     if (ec->options != NULL) //We need to have some options to show
+-        show_event_config_dialog(event_name);
++        show_event_config_dialog(event_name, NULL);
+ }
+ 
+ static void on_event_row_changed_cb(GtkTreeView *treeview, gpointer user_data)
+@@ -285,6 +285,9 @@ static void dehydrate_config_dialog()
+ 
+ static void save_settings_to_keyring(const char *event_name)
+ {
++    //don't bother when we already know that keyring is not available
++    if (!g_keyring_available)
++        return;
+     char *keyring_name = NULL;
+     GnomeKeyringResult result = gnome_keyring_get_default_keyring_sync(&keyring_name);
+     if (result != GNOME_KEYRING_RESULT_OK)
+@@ -333,7 +336,7 @@ static void save_settings_to_keyring(const char *event_name)
+     VERB2 log("saved event '%s' configuration to keyring", event_name);
+ }
+ 
+-static void show_event_config_dialog(const char *event_name)
++int show_event_config_dialog(const char *event_name, GtkWindow *parent)
+ {
+     if (option_widget_list != NULL)
+     {
+@@ -343,19 +346,21 @@ static void show_event_config_dialog(const char *event_name)
+ 
+     event_config_t *event = get_event_config(event_name);
+ 
++    GtkWindow *parent_window = parent ? parent : g_event_list_window;
++
+     GtkWidget *dialog = gtk_dialog_new_with_buttons(
+                         /*title:*/ event->screen_name ? event->screen_name : event_name,
+-                        g_event_list_window,
++                        parent_window,
+                         GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+                         GTK_STOCK_CANCEL,
+                         GTK_RESPONSE_CANCEL,
+                         GTK_STOCK_OK,
+                         GTK_RESPONSE_APPLY,
+                         NULL);
+-    if (g_event_list_window != NULL)
++    if (parent_window != NULL)
+     {
+         gtk_window_set_icon_name(GTK_WINDOW(dialog),
+-                gtk_window_get_icon_name(g_event_list_window));
++                gtk_window_get_icon_name(parent_window));
+     }
+ 
+     GtkWidget *option_table = gtk_table_new(/*rows*/ 0, /*cols*/ 2, /*homogeneous*/ FALSE);
+@@ -364,7 +369,21 @@ static void show_event_config_dialog(const char *event_name)
+ 
+     GtkWidget *content = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
+     gtk_box_pack_start(GTK_BOX(content), option_table, false, false, 20);
+-    gtk_widget_show_all(option_table);
++
++    /* add warning if keyring is not available showing the nagging dialog
++     * is considered "too heavy UI" be designers
++     */
++    if (!g_keyring_available)
++    {
++        GtkWidget *keyring_warn_lbl =
++        gtk_label_new(
++          _("Gnome Keyring is not available, your settings won't be saved!"));
++        static const GdkColor red = { .red = 0xffff };
++        gtk_widget_modify_fg(keyring_warn_lbl, GTK_STATE_NORMAL, &red);
++        gtk_box_pack_start(GTK_BOX(content), keyring_warn_lbl, false, false, 0);
++    }
++
++    gtk_widget_show_all(content);
+ 
+     int result = gtk_dialog_run(GTK_DIALOG(dialog));
+     if (result == GTK_RESPONSE_APPLY)
+@@ -375,6 +394,7 @@ static void show_event_config_dialog(const char *event_name)
+     //else if (result == GTK_RESPONSE_CANCEL)
+     //    log("log");
+     gtk_widget_destroy(dialog);
++    return result;
+ }
+ 
+ void show_events_list_dialog(GtkWindow *parent)
+diff --git a/src/gtk-helpers/internal_libreport_gtk.h b/src/gtk-helpers/internal_libreport_gtk.h
+index ca1835f..737cd7d 100644
+--- a/src/gtk-helpers/internal_libreport_gtk.h
++++ b/src/gtk-helpers/internal_libreport_gtk.h
+@@ -27,6 +27,8 @@
+ extern "C" {
+ #endif
+ 
++extern bool g_keyring_available;
++
+ #define make_label_autowrap_on_resize libreport_make_label_autowrap_on_resize
+ void make_label_autowrap_on_resize(GtkLabel *label);
+ 
+@@ -39,6 +41,9 @@ void load_event_config_data_from_keyring(void);
+ #define find_keyring_item_id_for_event libreport_find_keyring_item_id_for_event
+ guint32 find_keyring_item_id_for_event(const char *event_name);
+ 
++#define show_event_config_dialog libreport_show_event_config_dialog
++int show_event_config_dialog(const char *event_name, GtkWindow *parent);
++
+ #ifdef __cplusplus
+ }
+ #endif
+-- 
+1.7.6
+
diff --git a/0002-don-t-reload-event-configuration-when-dump_dir-chang.patch b/0002-don-t-reload-event-configuration-when-dump_dir-chang.patch
new file mode 100644
index 0000000..2be8fcb
--- /dev/null
+++ b/0002-don-t-reload-event-configuration-when-dump_dir-chang.patch
@@ -0,0 +1,30 @@
+From e7b9e246430753fb31a39bc64d0f65ea9a716dca Mon Sep 17 00:00:00 2001
+From: Jiri Moskovcak <jmoskovc at redhat.com>
+Date: Sun, 31 Jul 2011 14:19:02 +0200
+Subject: [PATCH 2/4] don't reload event configuration when dump_dir changes
+
+- reloading config erases the current session configuration and
+  if keyring is not available it leaves user credentials empty
+  which makes gui complain about wrong plugin configuration
+---
+ src/gui-wizard-gtk/main.c |    4 ----
+ 1 files changed, 0 insertions(+), 4 deletions(-)
+
+diff --git a/src/gui-wizard-gtk/main.c b/src/gui-wizard-gtk/main.c
+index 344d109..da32998 100644
+--- a/src/gui-wizard-gtk/main.c
++++ b/src/gui-wizard-gtk/main.c
+@@ -74,10 +74,6 @@ void reload_problem_data_from_dump_dir(void)
+     }
+     g_cd = new_cd;
+ 
+-    /* Load /etc/abrt/events/foo.{conf,xml} stuff */
+-    load_event_config_data();
+-    load_event_config_data_from_keyring();
+-//TODO: Load ~/.abrt/events/foo.conf?
+ }
+ 
+ int main(int argc, char **argv)
+-- 
+1.7.6
+
diff --git a/0003-wizard-add-configure-event-button-to-wrong-settings-.patch b/0003-wizard-add-configure-event-button-to-wrong-settings-.patch
new file mode 100644
index 0000000..4713b98
--- /dev/null
+++ b/0003-wizard-add-configure-event-button-to-wrong-settings-.patch
@@ -0,0 +1,87 @@
+From a0a0fa18401bdfb715737adf47dc93dc9c5aa1f2 Mon Sep 17 00:00:00 2001
+From: Jiri Moskovcak <jmoskovc at redhat.com>
+Date: Sun, 31 Jul 2011 14:15:49 +0200
+Subject: [PATCH 3/4] wizard: add configure event button to wrong settings
+ warning dialog
+
+- it makes it easier for users to find the settings
+- it was this way in abrt-1.x
+---
+ src/gui-wizard-gtk/wizard.c |   37 +++++++++++++++++++++++++++++++++++--
+ 1 files changed, 35 insertions(+), 2 deletions(-)
+
+diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
+index 0fc8a30..3dc6921 100644
+--- a/src/gui-wizard-gtk/wizard.c
++++ b/src/gui-wizard-gtk/wizard.c
+@@ -82,6 +82,8 @@ static GtkCellRenderer *g_tv_details_renderer_value;
+ static GtkTreeViewColumn *g_tv_details_col_checkbox;
+ //static GtkCellRenderer *g_tv_details_renderer_checkbox;
+ static GtkListStore *g_ls_details;
++static GtkWidget *g_top_most_window;
++
+ enum
+ {
+     /* Note: need to update types in
+@@ -258,6 +260,24 @@ static void save_dialog_response(GtkDialog *dialog, gint response_id, gpointer u
+     *(gint*)user_data = response_id;
+ }
+
++static void on_configure_event_cb(GtkWidget *button, gpointer user_data)
++{
++    char *event_name = (char *)user_data;
++    if (event_name != NULL)
++    {
++        int result = show_event_config_dialog(event_name, GTK_WINDOW(g_top_most_window));
++        if (result == GTK_RESPONSE_APPLY)
++        {
++            GHashTable *errors = validate_event(event_name);
++            if (errors == NULL)
++            {
++                gtk_widget_destroy(g_top_most_window);
++                g_top_most_window = NULL;
++            }
++        }
++    }
++}
++
+ static void show_event_opt_error_dialog(const char *event_name)
+ {
+     event_config_t *ec = get_event_config(event_name);
+@@ -269,18 +289,31 @@ static void show_event_opt_error_dialog(const char *event_name)
+                               "reporting will probably fail if you continue "
+                               "with the current configuration."),
+                                ec->screen_name);
+-    GtkWidget *wrong_settings = gtk_message_dialog_new(GTK_WINDOW(g_assistant),
++    GtkWidget *wrong_settings = g_top_most_window = gtk_message_dialog_new(GTK_WINDOW(g_assistant),
+         GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+         GTK_MESSAGE_WARNING,
+         GTK_BUTTONS_CLOSE,
+         message);
++
+     gtk_window_set_transient_for(GTK_WINDOW(wrong_settings), GTK_WINDOW(g_assistant));
+     free(message);
+     gtk_message_dialog_set_markup(GTK_MESSAGE_DIALOG(wrong_settings),
+                                     markup_message);
+     free(markup_message);
++
++    GtkWidget *act_area = gtk_dialog_get_content_area(GTK_DIALOG(wrong_settings));
++    char * conf_btn_lbl = xasprintf(_("Con_figure %s"), ec->screen_name);
++    GtkWidget *configure_event_btn = gtk_button_new_with_mnemonic(conf_btn_lbl);
++    g_signal_connect(configure_event_btn, "clicked", G_CALLBACK(on_configure_event_cb), (gpointer)event_name);
++    free(conf_btn_lbl);
++
++    gtk_box_pack_start(GTK_BOX(act_area), configure_event_btn, false, false, 0);
++    gtk_widget_show(configure_event_btn);
++
++
+     gtk_dialog_run(GTK_DIALOG(wrong_settings));
+-    gtk_widget_destroy(wrong_settings);
++    if (g_top_most_window)
++        gtk_widget_destroy(wrong_settings);
+ }
+
+ struct dump_dir *steal_if_needed(struct dump_dir *dd)
+--
+1.7.6
+
diff --git a/0004-check-settings-only-for-last-selected-reporter.patch b/0004-check-settings-only-for-last-selected-reporter.patch
new file mode 100644
index 0000000..259c762
--- /dev/null
+++ b/0004-check-settings-only-for-last-selected-reporter.patch
@@ -0,0 +1,84 @@
+From a7aae58e81de44a121f1d1c4a8df43692688afbd Mon Sep 17 00:00:00 2001
+From: Jiri Moskovcak <jmoskovc at redhat.com>
+Date: Sun, 31 Jul 2011 15:03:43 +0200
+Subject: [PATCH 4/4] check settings only for last selected reporter
+
+---
+ src/gui-wizard-gtk/wizard.c |   51 ++++++++++++++++++++++++++++++------------
+ 1 files changed, 36 insertions(+), 15 deletions(-)
+
+diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
+index 3dc6921..a6c48eb 100644
+--- a/src/gui-wizard-gtk/wizard.c
++++ b/src/gui-wizard-gtk/wizard.c
+@@ -647,28 +647,43 @@ static void analyze_rb_was_toggled(GtkButton *button, gpointer user_data)
+     }
+ }
+
+-static void report_tb_was_toggled(GtkButton *button_unused, gpointer user_data_unused)
++static void report_tb_was_toggled(GtkButton *button, gpointer user_data)
+ {
++    char *event_name = (char *)user_data;
+     struct strbuf *reporters_string = strbuf_new();
+     GList *li = g_list_reporters;
+-    for (; li; li = li->next)
++
++    /* if ((button && user_data)
++     * prevents sigsegv which would happen when call from
++     * line 990: ((void (*)(GtkButton*, gpointer*))func)(NULL, NULL);
++     */
++
++    if ((button && user_data)
++        && gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)) == TRUE)
+     {
+-        event_gui_data_t *event_gui_data = li->data;
+-        if (gtk_toggle_button_get_active(event_gui_data->toggle_button) == TRUE)
+-        {
+-            strbuf_append_strf(reporters_string,
++        if (g_list_find(li, event_name) == NULL)
++            li = g_list_prepend(li, event_name);
++
++        strbuf_append_strf(reporters_string,
+                             "%s%s",
+                             (reporters_string->len != 0 ? ", " : ""),
+-                            event_gui_data->event_name
+-            );
+-            GHashTable *errors = validate_event(event_gui_data->event_name);
+-            if (errors != NULL)
+-            {
+-                g_hash_table_unref(errors);
+-                show_event_opt_error_dialog(event_gui_data->event_name);
+-            }
++                            event_name
++                            );
++
++        GHashTable *errors = validate_event(event_name);
++        if (errors != NULL)
++        {
++            g_hash_table_unref(errors);
++            show_event_opt_error_dialog(event_name);
+         }
++
+     }
++    else
++    {
++        if (g_list_find(li, event_name) != NULL)
++            li = g_list_remove(li, event_name);
++    }
++
+
+     gtk_assistant_set_page_complete(g_assistant,
+                 pages[PAGENO_REPORTER_SELECTOR].page_widget,
+@@ -796,7 +811,8 @@ static event_gui_data_t *add_event_buttons(GtkBox *box,
+         }
+
+         if (func)
+-            g_signal_connect(G_OBJECT(button), "toggled", func, NULL);
++            g_signal_connect(G_OBJECT(button), "toggled", func, xstrdup(event_name));
++
+         if (cfg && cfg->long_descr)
+             gtk_widget_set_tooltip_text(button, cfg->long_descr);
+
+--
+1.7.6
+
diff --git a/0015-honor-minimal-rating.patch b/0015-honor-minimal-rating.patch
new file mode 100644
index 0000000..6497662
--- /dev/null
+++ b/0015-honor-minimal-rating.patch
@@ -0,0 +1,139 @@
+From 4625b41eb61eb32dd5ddfd59f0b1e6c4e0c351b7 Mon Sep 17 00:00:00 2001
+From: Nikola Pajkovsky <npajkovs at redhat.com>
+Date: Fri, 22 Jul 2011 13:57:10 +0200
+Subject: [PATCH 15/26] honor minimal rating
+
+Signed-off-by: Nikola Pajkovsky <npajkovs at redhat.com>
+---
+ src/cli/cli-report.c        |   10 ++++------
+ src/gui-wizard-gtk/wizard.c |   33 ++++++++++++++++++++++++---------
+ src/include/event_config.h  |    1 +
+ src/lib/event_xml_parser.c  |   13 +++++++++++++
+ 4 files changed, 42 insertions(+), 15 deletions(-)
+
+diff --git a/src/cli/cli-report.c b/src/cli/cli-report.c
+index 6ec7f96..f203fad 100644
+--- a/src/cli/cli-report.c
++++ b/src/cli/cli-report.c
+@@ -752,7 +752,9 @@ int report(const char *dump_dir_name, int flags)
+     {
+         const char *rating_str = get_problem_item_content_or_NULL(problem_data, FILENAME_RATING);
+ //COMPAT, remove after 2.1 release
+-        if (!rating_str) rating_str = get_problem_item_content_or_NULL(problem_data, "rating");
++        if (!rating_str)
++            rating_str = get_problem_item_content_or_NULL(problem_data, "rating");
++
+         unsigned i, rating = rating_str ? xatou(rating_str) : 4;
+         GList *li;
+         char wanted_reporters[255];
+@@ -781,11 +783,7 @@ int report(const char *dump_dir_name, int flags)
+             if (!is_number_in_string(i, wanted_reporters))
+                 continue;
+ 
+-            /* TODO: npajkovs; not implemented yet */
+-            //const char *rating_required = get_map_string_item_or_NULL(single_plugin_settings, "RatingRequired");
+-            //if (rating_required
+-            //    && string_to_bool(rating_required) == true
+-            if (rating < 3)
++            if (rating < config->ec_minimal_rating)
+             {
+                 puts(_("Reporting disabled because the backtrace is unusable"));
+ 
+diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
+index 7c06beb..606d799 100644
+--- a/src/gui-wizard-gtk/wizard.c
++++ b/src/gui-wizard-gtk/wizard.c
+@@ -1455,23 +1455,38 @@ static void check_bt_rating_and_allow_send(void)
+ //FIXME: say "no" to special casing!
+     if (analyzer && strcmp(analyzer, "Kerneloops") != 0)
+     {
+-        const char *rating = get_problem_item_content_or_NULL(g_cd, FILENAME_RATING);
++        const char *rating_str = get_problem_item_content_or_NULL(g_cd, FILENAME_RATING);
+ //COMPAT, remove after 2.1 release
+-        if (!rating) rating= get_problem_item_content_or_NULL(g_cd, "rating");
+-        if (rating) switch (*rating)
++        if (!rating_str)
++            rating_str = get_problem_item_content_or_NULL(g_cd, "rating");
++
++        if (rating_str)
+         {
+-            case '4': /* bt is ok - no warning here */
+-                break;
+-            case '3': /* bt is usable, but not complete, so show a warning */
++            char *endptr;
++            errno = 0;
++            long rating = strtol(rating_str, &endptr, 10);
++            if (errno != 0 || endptr == rating_str || *endptr != '\0')
++            {
++                add_warning(_("Reporting disabled because the rating does not contain a number '%s'."));
++                send = false;
++                warn = true;
++            }
++
++            event_config_t *cfg = get_event_config(g_reporter_events_selected);
++
++            if (rating == cfg->ec_minimal_rating) /* bt is usable, but not complete, so show a warning */
++            {
+                 add_warning(_("The backtrace is incomplete, please make sure you provide the steps to reproduce."));
+                 warn = true;
+-                break;
+-            default:
++            }
++
++            if (rating < cfg->ec_minimal_rating)
++            {
+                 //FIXME: see CreporterAssistant: 394 for ideas
+                 add_warning(_("Reporting disabled because the backtrace is unusable."));
+                 send = false;
+                 warn = true;
+-                break;
++            }
+         }
+     }
+ 
+diff --git a/src/include/event_config.h b/src/include/event_config.h
+index 6f9383c..bd599f9 100644
+--- a/src/include/event_config.h
++++ b/src/include/event_config.h
+@@ -76,6 +76,7 @@ typedef struct
+     char *ec_include_items_by_default;
+     char *ec_exclude_items_always;
+     bool  ec_exclude_binary_items;
++    long  ec_minimal_rating;
+ 
+     GList *options;
+ } event_config_t;
+diff --git a/src/lib/event_xml_parser.c b/src/lib/event_xml_parser.c
+index 5b5fdd7..7604a17 100644
+--- a/src/lib/event_xml_parser.c
++++ b/src/lib/event_xml_parser.c
+@@ -30,6 +30,7 @@
+ //#define ACTION_ELEMENT        "action"
+ #define NAME_ELEMENT            "name"
+ #define DEFAULT_VALUE_ELEMENT   "default-value"
++#define MINIMAL_RATING_ELEMENT  "minimal-rating"
+ 
+ #define REQUIRES_ELEMENT        "requires-items"
+ #define EXCL_BY_DEFAULT_ELEMENT "exclude-items-by-default"
+@@ -400,6 +401,18 @@ static void text(GMarkupParseContext *context,
+             free(text_copy);
+             return;
+         }
++        if (strcmp(inner_element, MINIMAL_RATING_ELEMENT) == 0)
++        {
++            char *endptr;
++            errno = 0;
++            ui->ec_minimal_rating = strtol(text_copy, &endptr, 10);
++            if (errno != 0 || endptr == text_copy || *endptr != '\0')
++            {
++                log("invalid minimal-rating number '%s', set to default 4", text_copy);
++                ui->ec_minimal_rating = 4;
++            }
++            return;
++        }
+     }
+     free(text_copy);
+ }
+-- 
+1.7.6
+
diff --git a/0025-added-minimal-rating-entry-to-all-event-xml-files.patch b/0025-added-minimal-rating-entry-to-all-event-xml-files.patch
new file mode 100644
index 0000000..7df1305
--- /dev/null
+++ b/0025-added-minimal-rating-entry-to-all-event-xml-files.patch
@@ -0,0 +1,63 @@
+From 4bcab27c3aec24b7df68996155dc32b4de7a93d1 Mon Sep 17 00:00:00 2001
+From: Jiri Moskovcak <jmoskovc at redhat.com>
+Date: Fri, 22 Jul 2011 23:13:53 +0200
+Subject: [PATCH 25/26] added minimal-rating entry to all event xml files
+
+---
+ src/plugins/report_Kerneloops.xml.in |    1 +
+ src/plugins/report_Logger.xml.in     |    1 +
+ src/plugins/report_Mailx.xml.in      |    1 +
+ src/plugins/report_RHTSupport.xml.in |    1 +
+ 4 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/src/plugins/report_Kerneloops.xml.in b/src/plugins/report_Kerneloops.xml.in
+index a4da6b6..e8d6f1a 100644
+--- a/src/plugins/report_Kerneloops.xml.in
++++ b/src/plugins/report_Kerneloops.xml.in
+@@ -8,6 +8,7 @@
+     <exclude-items-always>*</exclude-items-always>
+     <exclude-binary-items>yes</exclude-binary-items>
+     <include-items-by-default></include-items-by-default>
++    <minimal-rating>0</minimal-rating>
+ 
+     <options>
+         <option type="text" name="KerneloopsReporter_SubmitURL">
+diff --git a/src/plugins/report_Logger.xml.in b/src/plugins/report_Logger.xml.in
+index f7230e0..f37a47f 100644
+--- a/src/plugins/report_Logger.xml.in
++++ b/src/plugins/report_Logger.xml.in
+@@ -8,6 +8,7 @@
+     <exclude-items-always></exclude-items-always>
+     <exclude-binary-items>no</exclude-binary-items>
+     <include-items-by-default></include-items-by-default>
++    <minimal-rating>0</minimal-rating>
+ 
+     <options>
+         <option type="text" name="Logger_Log_File">
+diff --git a/src/plugins/report_Mailx.xml.in b/src/plugins/report_Mailx.xml.in
+index 2476a3d..f9a7458 100644
+--- a/src/plugins/report_Mailx.xml.in
++++ b/src/plugins/report_Mailx.xml.in
+@@ -8,6 +8,7 @@
+     <exclude-items-always></exclude-items-always>
+     <exclude-binary-items>no</exclude-binary-items>
+     <include-items-by-default></include-items-by-default>
++    <minimal-rating>0</minimal-rating>
+ 
+     <options>
+         <option type="text" name="Mailx_Subject">
+diff --git a/src/plugins/report_RHTSupport.xml.in b/src/plugins/report_RHTSupport.xml.in
+index 834528a..3009d64 100644
+--- a/src/plugins/report_RHTSupport.xml.in
++++ b/src/plugins/report_RHTSupport.xml.in
+@@ -8,6 +8,7 @@
+     <exclude-items-always></exclude-items-always>
+     <exclude-binary-items>no</exclude-binary-items>
+     <include-items-by-default></include-items-by-default>
++    <minimal-rating>0</minimal-rating>
+ 
+     <options>
+         <option type="text" name="RHTSupport_URL">
+-- 
+1.7.6
+
diff --git a/0026-rhbz-724999-fix-null-in-summary.patch b/0026-rhbz-724999-fix-null-in-summary.patch
new file mode 100644
index 0000000..8d04e18
--- /dev/null
+++ b/0026-rhbz-724999-fix-null-in-summary.patch
@@ -0,0 +1,62 @@
+From 4f649aaeaf3a8300bd9fd1130007b12770593d46 Mon Sep 17 00:00:00 2001
+From: Nikola Pajkovsky <npajkovs at redhat.com>
+Date: Fri, 22 Jul 2011 17:30:09 +0200
+Subject: [PATCH 26/26] rhbz#724999 - fix (null) in summary
+
+when you report selinux problem via libreport summary looks like
+
+[abrt] (null): SELinux is preventing /usr/bin/abrt-dump-oops from 'open'
+accesses on the file /var/log/messages.
+
+(null) is name of the package, but it doesn't have any. Reasonable summary
+is only from 'reason' file.
+
+Signed-off-by: Nikola Pajkovsky <npajkovs at redhat.com>
+---
+ src/plugins/rhbz.c |   27 ++++++++++++++++-----------
+ 1 files changed, 16 insertions(+), 11 deletions(-)
+
+diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c
+index 0a4c28e..5b53465 100644
+--- a/src/plugins/rhbz.c
++++ b/src/plugins/rhbz.c
+@@ -307,20 +307,25 @@ int rhbz_new_bug(struct abrt_xmlrpc *ax, problem_data_t *problem_data,
+                                                                 FILENAME_TAINTED_SHORT);
+ 
+     struct strbuf *buf_summary = strbuf_new();
+-    strbuf_append_strf(buf_summary, "[abrt] %s", package);
+-
+-    if (function != NULL && strlen(function) < 30)
+-        strbuf_append_strf(buf_summary, ": %s", function);
+-
+-    if (reason != NULL)
+-        strbuf_append_strf(buf_summary, ": %s", reason);
+-
+-    if (tainted_short && analyzer
+-        && (strcmp(analyzer, "Kerneloops") == 0))
++    if (analyzer && strcmp(analyzer, "libreport") == 0)
+     {
+-        strbuf_append_strf(buf_summary, ": TAINTED %s", tainted_short);
++        strbuf_append_str(buf_summary, reason);
+     }
++    else
++    {
++        strbuf_append_strf(buf_summary, "[abrt] %s", package);
++        if (function && strlen(function) < 30)
++            strbuf_append_strf(buf_summary, ": %s", function);
+ 
++        if (reason)
++            strbuf_append_strf(buf_summary, ": %s", reason);
++
++        if (tainted_short && analyzer
++            && (strcmp(analyzer, "Kerneloops") == 0))
++        {
++            strbuf_append_strf(buf_summary, ": TAINTED %s", tainted_short);
++        }
++    }
+     char *status_whiteboard = xasprintf("abrt_hash:%s", duphash);
+ 
+     char *bz_dsc = make_description_bz(problem_data);
+-- 
+1.7.6
+
diff --git a/emptylines_interactive_di.patch b/emptylines_interactive_di.patch
new file mode 100644
index 0000000..baab5a1
--- /dev/null
+++ b/emptylines_interactive_di.patch
@@ -0,0 +1,48 @@
+commit 6aab2606ce1bcbdfc2198eafa08afc22597768cf
+Author: Michal Toman <mtoman at redhat.com>
+Date:   Mon Aug 1 16:11:51 2011 +0200
+
+    interactive plugins: do not truncate message on EAGAIN
+
+diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
+index a6c48eb..4dcfd34 100644
+--- a/src/gui-wizard-gtk/wizard.c
++++ b/src/gui-wizard-gtk/wizard.c
+@@ -213,6 +213,7 @@ static page_obj_t pages[] =
+ 
+ static page_obj_t *added_pages[NUM_PAGES];
+ 
++static struct strbuf *line = NULL;
+ 
+ /* Utility functions */
+ 
+@@ -1174,7 +1175,8 @@ static gboolean consume_cmd_output(GIOChannel *source, GIOCondition condition, g
+     char *newline;
+     char *raw;
+     int r;
+-    struct strbuf *line = strbuf_new();
++    if (!line)
++        line = strbuf_new();
+ 
+     int alert_prefix_len = strlen(REPORT_PREFIX_ALERT);
+     int ask_prefix_len = strlen(REPORT_PREFIX_ASK);
+@@ -1348,8 +1350,6 @@ static gboolean consume_cmd_output(GIOChannel *source, GIOCondition condition, g
+         strbuf_append_str(line, raw);
+     }
+ 
+-    strbuf_free(line);
+-
+     if (r < 0 && errno == EAGAIN)
+         /* We got all buffered data, but fd is still open. Done for now */
+         return TRUE; /* "please don't remove this event (yet)" */
+@@ -1415,6 +1415,10 @@ static gboolean consume_cmd_output(GIOChannel *source, GIOCondition condition, g
+                 gtk_label_set_text(evd->status_label, msg);
+                 free(msg);
+ 
++                /* free child output buffer */
++                strbuf_free(line);
++                line = NULL;
++
+                 /* Enable (un-gray out) navigation buttons */
+                 gtk_widget_set_sensitive(GTK_WIDGET(g_assistant), true);
+ 
diff --git a/fix_adding_external_files_to_report.patch b/fix_adding_external_files_to_report.patch
new file mode 100644
index 0000000..27862b1
--- /dev/null
+++ b/fix_adding_external_files_to_report.patch
@@ -0,0 +1,21 @@
+diff --git a/src/report-python/__init__.py b/src/report-python/__init__.py
+index fbbc158..16d4759 100644
+--- a/src/report-python/__init__.py
++++ b/src/report-python/__init__.py
+@@ -162,8 +162,14 @@ def createPythonUnhandledExceptionSignature(component, hashmarkername, hashvalue
+         pd.add("os_release", product +" release "+ version)
+     pd.add_basics() # adds product and version + some other required field
+     # FIXME: how to handle files out of dump dir??
+-    #1 = flag BIN
+-    pd.add("pythonUnhandledException", exnFileName, 1)
++    # temporary glue
++    if (exnFileName):
++        try:
++            inf = open(exnFileName, "r")
++            pd.add(exnFileName[exnFileName.rfind('/')+1:], inf.read())
++            inf.close()
++        except Exception, ex:
++            print "Can't add %s to report: %s" % (exnFileName, ex)
+ 
+     return pd
+ 
diff --git a/libreport.spec b/libreport.spec
index 9675aad..f41f3be 100644
--- a/libreport.spec
+++ b/libreport.spec
@@ -5,25 +5,29 @@
 Summary: Generic library for reporting various problems
 Name: libreport
 Version: 2.0.5
-Release: 3%{?dist}
+Release: 4%{?dist}
 License: GPLv2+
 Group: System Environment/Libraries
 URL: https://fedorahosted.org/abrt/
 Source: https://fedorahosted.org/released/abrt/%{name}-%{version}.tar.gz
-Patch0: 0001-fix-el6-keyring.patch
-Patch1: 0002-Add-a-button-to-add-more-files-to-dump-dir.-Closes-1.patch
-Patch2: 0003-Ignore-files-which-seem-to-be-editor-backups.-Closes.patch
-Patch3: 0004-wizard-steal-directory-before-copying-added-files-to.patch
-Patch4: 0005-wizard.glade-glade-generates-class-GtkBox-which-does.patch
-Patch5: 0006-support-interactive-plugins-in-GUI-and-CLI.patch
-Patch6: 0007-wizard-if-more-than-one-reporter-is-chosen-select-al.patch
-Patch7: 0008-added-xml-file-for-Logger-event.patch
-Patch8: 0009-report-cli-don-t-crash-when-invalid-analyzer-is-sele.patch
-Patch9: 0010-Add-another-reporting-flag-LIBREPORT_GETPID.patch
-Patch10: 0011-add-python-bindings-for-interactive-plugins.patch
-Patch11: 0012-run_event_on_dir-fix-double-free.patch
-Patch12: 0031-added-bugzilla_event.conf-to-enable-Bugzilla-for-all.patch
-PAtch13: 0032-improved-compatibility-with-anaconda-rhbz-725857.patch
+Patch0: 0006-support-interactive-plugins-in-GUI-and-CLI.patch
+Patch1: 0007-wizard-if-more-than-one-reporter-is-chosen-select-al.patch
+Patch2: 0008-added-xml-file-for-Logger-event.patch
+Patch3: 0009-report-cli-don-t-crash-when-invalid-analyzer-is-sele.patch
+Patch4: 0011-add-python-bindings-for-interactive-plugins.patch
+Patch5: 0012-run_event_on_dir-fix-double-free.patch
+Patch6: 0015-honor-minimal-rating.patch
+Patch7: 0025-added-minimal-rating-entry-to-all-event-xml-files.patch
+Patch8: 0026-rhbz-724999-fix-null-in-summary.patch
+Patch10: 0001-fix-el6-keyring.patch
+Patch11: 0031-added-bugzilla_event.conf-to-enable-Bugzilla-for-all.patch
+Patch12: 0032-improved-compatibility-with-anaconda-rhbz-725857.patch
+Patch13: 0001-warn-silently-if-keyring-is-not-available-rhbz-72585.patch
+Patch14: 0002-don-t-reload-event-configuration-when-dump_dir-chang.patch
+Patch15: 0003-wizard-add-configure-event-button-to-wrong-settings-.patch
+Patch16: 0004-check-settings-only-for-last-selected-reporter.patch
+Patch17: fix_adding_external_files_to_report.patch
+Patch18: emptylines_interactive_di.patch
 BuildRequires: dbus-devel
 BuildRequires: gtk2-devel
 BuildRequires: curl-devel
@@ -44,7 +48,7 @@ BuildRequires: newt-devel
 # and all it's plugins, but don't provide the python bindings and the sealert
 # end-up with: can't import report.GtkIO
 # FIXME: can be removed when F15 will EOLed, needs to stay in rhel6!
-Requires: libreport-python
+Requires: libreport-python = %{version}-%{release}
 
 # for rhel6
 %if 0%{?rhel} >= 6
@@ -204,11 +208,15 @@ Plugin to report bugs into anonymous FTP site associated with ticketing system.
 %patch6 -p1
 %patch7 -p1
 %patch8 -p1
-%patch9 -p1
 %patch10 -p1
 %patch11 -p1
 %patch12 -p1
 %patch13 -p1
+%patch14 -p1
+%patch15 -p1
+%patch16 -p1
+%patch17 -p1
+%patch18 -p1
 
 %build
 mkdir -p m4
@@ -355,6 +363,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
 %{_bindir}/reporter-upload
 
 %changelog
+* Tue Aug 02 2011 Jiri Moskovcak <jmoskovc at redhat.com> 2.0.5-4
+- silent keyring warning rhbz#692433
+- further improvements to Anaconda compatibility
+
 * Fri Jul 29 2011 Jiri Moskovcak <jmoskovc at redhat.com> 2.0.5-3
 - enable bugzilla reporter for analyzer=libreport rhbz#725970
 - improved compatibility with anaconda


More information about the scm-commits mailing list