diff --git a/.gitignore b/.gitignore index 5c1b6fa..9c49cbc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /libreport-2.0.3.tar.gz /libreport-2.0.4.tar.gz /libreport-2.0.5.tar.gz +/libreport-2.0.5.980.tar.gz diff --git a/0001-fix-el6-keyring.patch b/0001-fix-el6-keyring.patch deleted file mode 100644 index 86f642e..0000000 --- a/0001-fix-el6-keyring.patch +++ /dev/null @@ -1,25 +0,0 @@ -From e8408578b1d0b320e8abf27f96186e8fa1f5e4dd Mon Sep 17 00:00:00 2001 -From: Michal Toman -Date: Mon, 18 Jul 2011 16:38:02 +0200 -Subject: [PATCH 01/12] fix el6 keyring - ---- - src/gtk-helpers/event_config_dialog.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/src/gtk-helpers/event_config_dialog.c b/src/gtk-helpers/event_config_dialog.c -index 219f841..c06ba4b 100644 ---- a/src/gtk-helpers/event_config_dialog.c -+++ b/src/gtk-helpers/event_config_dialog.c -@@ -318,7 +318,7 @@ static void save_settings_to_keyring(const char *event_name) - GNOME_KEYRING_ITEM_GENERIC_SECRET, /* type */ - event_name, /* display name */ - attrs, /* attributes */ -- NULL, /* secret - no special handling for password it's stored in attrs */ -+ "", /* secret - no special handling for password it's stored in attrs */ - 1, /* update if exist */ - &item_id); - VERB2 log("created new item with id: %i", item_id); --- -1.7.6 - diff --git a/0001-libreport-force-run-cli-event-if-DISPLAY-exist.patch b/0001-libreport-force-run-cli-event-if-DISPLAY-exist.patch deleted file mode 100644 index 1559e64..0000000 --- a/0001-libreport-force-run-cli-event-if-DISPLAY-exist.patch +++ /dev/null @@ -1,39 +0,0 @@ -From f144695906aa98a8164dd2e4dd2257a92f8aadd9 Mon Sep 17 00:00:00 2001 -From: Nikola Pajkovsky -Date: Tue, 26 Jul 2011 09:41:14 +0200 -Subject: [PATCH 01/52] [libreport] force run cli event if DISPLAY exist - -Signed-off-by: Nikola Pajkovsky ---- - src/include/report.h | 1 + - src/lib/report.c | 2 +- - 2 files changed, 2 insertions(+), 1 deletions(-) - -diff --git a/src/include/report.h b/src/include/report.h -index 410a24d..ae879b5 100644 ---- a/src/include/report.h -+++ b/src/include/report.h -@@ -35,6 +35,7 @@ enum { - /* ("run reporters" is always on, has no flag (for now?)) */ - LIBREPORT_RELOAD_DATA = (1 << 5), /* reload problem data after run (needs WAIT) */ - LIBREPORT_DEL_DIR = (1 << 6), /* delete directory after reporting */ -+ LIBREPORT_RUN_CLI = (1 << 7), /* run 'cli' instead of 'gui' */ - }; - - int report_problem_in_dir(const char *dirname, int flags); -diff --git a/src/lib/report.c b/src/lib/report.c -index 3c365ae..4b9f5c9 100644 ---- a/src/lib/report.c -+++ b/src/lib/report.c -@@ -48,7 +48,7 @@ int report_problem_in_dir(const char *dirname, int flags) - *pp++ = (char *)dirname; - *pp = NULL; - -- if (!getenv("DISPLAY")) -+ if (!getenv("DISPLAY") || (flags & LIBREPORT_RUN_CLI)) - { - /* GUI won't work, use command line tool instead */ - path1 = BIN_DIR"/report-cli"; --- -1.7.6 - diff --git a/0001-reporter-bugzilla-add-b-to-make-it-possible-to-attac.patch b/0001-reporter-bugzilla-add-b-to-make-it-possible-to-attac.patch deleted file mode 100644 index 1fa976f..0000000 --- a/0001-reporter-bugzilla-add-b-to-make-it-possible-to-attac.patch +++ /dev/null @@ -1,293 +0,0 @@ -From ac1c8f561dbdc9a1ba6277d8aa776bc76a9fc928 Mon Sep 17 00:00:00 2001 -From: Jiri Moskovcak -Date: Wed, 31 Aug 2011 09:59:21 +0200 -Subject: [PATCH 2/2] reporter-bugzilla: add -b to make it possible to attach - binary items - -Text file max size is increased to 500k. -Both these measures should help with rhbz#733448. - -Signed-off-by: Denys Vlasenko - -Conflicts: - - src/plugins/reporter-bugzilla.c ---- - src/lib/problem_data.c | 3 +- - src/plugins/bugzilla_event.conf | 2 +- - src/plugins/report_Bugzilla.xml.in | 2 +- - src/plugins/reporter-bugzilla.c | 38 +++++++------------------ - src/plugins/reporter-bugzilla.txt | 5 ++- - src/plugins/rhbz.c | 54 ++++++++++++++++++++++++++++++++++-- - src/plugins/rhbz.h | 8 ++++- - 7 files changed, 76 insertions(+), 36 deletions(-) - -diff --git a/src/lib/problem_data.c b/src/lib/problem_data.c -index 91f269c..1783b63 100644 ---- a/src/lib/problem_data.c -+++ b/src/lib/problem_data.c -@@ -236,9 +236,10 @@ static char* is_text_file(const char *name, ssize_t *sz) - * So, don't remove this. If you really need to, raise the limit. - * - * Bumped up to 200k: saw 124740 byte /proc/PID/smaps file -+ * Bumped up to 500k: saw 375252 byte anaconda traceback file - */ - off_t size = lseek(fd, 0, SEEK_END); -- if (size < 0 || size > 200*1024) -+ if (size < 0 || size > 500*1024) - { - close(fd); - return NULL; /* it's not a SMALL text */ -diff --git a/src/plugins/bugzilla_event.conf b/src/plugins/bugzilla_event.conf -index 3fb604d..109c581 100644 ---- a/src/plugins/bugzilla_event.conf -+++ b/src/plugins/bugzilla_event.conf -@@ -1 +1 @@ --EVENT=report_Bugzilla analyzer=libreport reporter-bugzilla -\ No newline at end of file -+EVENT=report_Bugzilla analyzer=libreport reporter-bugzilla -b -diff --git a/src/plugins/report_Bugzilla.xml.in b/src/plugins/report_Bugzilla.xml.in -index 00ef4a4..059171f 100644 ---- a/src/plugins/report_Bugzilla.xml.in -+++ b/src/plugins/report_Bugzilla.xml.in -@@ -6,7 +6,7 @@ - component,duphash,os_release - coredump,count,event_log,reported_to,vmcore - -- yes -+ no - - - -diff --git a/src/plugins/reporter-bugzilla.c b/src/plugins/reporter-bugzilla.c -index 5f46636..ec263ae 100644 ---- a/src/plugins/reporter-bugzilla.c -+++ b/src/plugins/reporter-bugzilla.c -@@ -24,7 +24,7 @@ - - static void report_to_bugzilla(const char *dump_dir_name, const char *login, - const char *password, const char *bugzilla_xmlrpc, -- const char *bugzilla_url, int ssl_verify) -+ const char *bugzilla_url, int ssl_verify, int attach_binary) - { - problem_data_t *problem_data = create_problem_data_for_reporting(dump_dir_name); - if (!problem_data) -@@ -113,7 +113,10 @@ static void report_to_bugzilla(const char *dump_dir_name, const char *login, - char bug_id_str[sizeof(int)*3 + 2]; - sprintf(bug_id_str, "%i", bug_id); - -- rhbz_attachments(client, bug_id_str, problem_data, RHBZ_NOMAIL_NOTIFY); -+ int flags = RHBZ_NOMAIL_NOTIFY; -+ if (attach_binary) -+ flags |= RHBZ_ATTACH_BINARY_FILES; -+ rhbz_attach_big_files(client, bug_id_str, problem_data, flags); - - bz = new_bug_info(); - bz->bi_status = xstrdup("NEW"); -@@ -210,8 +210,8 @@ - - /* Can't keep these strings/structs static: _() doesn't support that */ - const char *program_usage_string = _( -- "\b [-v] [-c CONFFILE] -d DIR\n" -- " or: \b [-v] --ticket[ID] FILE [FILE...]\n" -+ "\b [-vb] [-c CONFFILE] -d DIR\n" -+ " or: \b [-vb] --ticket[ID] FILE [FILE...]\n" - "\n" - "Reports problem to Bugzilla.\n" - "\n" -@@ -245,6 +248,7 @@ int main(int argc, char **argv) - OPT_d = 1 << 1, - OPT_c = 1 << 2, - OPT_t = 1 << 3, -+ OPT_b = 1 << 4, - }; - - char *ticket_no = NULL; -@@ -249,6 +249,7 @@ - OPT_STRING('d', NULL, &dump_dir_name, "DIR" , _("Dump directory")), - OPT_LIST( 'c', NULL, &conf_file , "FILE", _("Configuration file (may be given many times)")), - OPT_OPTSTRING('t', "ticket", &ticket_no, "ID", _("Attach file to a bugzilla id")), -+ OPT_BOOL( 'b', NULL, NULL, _("When creating bug, attach binary files too")), - OPT_END() - }; - unsigned opts = parse_opts(argc, argv, program_options, program_usage_string); -@@ -353,29 +358,8 @@ int main(int argc, char **argv) - continue; - } - -- off_t size = lseek(fd, 0, SEEK_END); -- if (size < 0) -- { -- perror_msg("Can't lseek '%s'", filename); -- close(fd); -- continue; -- } -- lseek(fd, 0, SEEK_SET); -- -- /* FIXME: what if the file is tens of gigabytes? */ -- char *data = xmalloc(size + 1); -- ssize_t r = full_read(fd, data, size); -- if (r < 0) -- { -- free(data); -- perror_msg("Can't read '%s'", filename); -- close(fd); -- continue; -- } -+ rhbz_attach_fd(client, filename, ticket_no, fd, /*flags*/ 0); - close(fd); -- -- rhbz_attachment(client, filename, ticket_no, data, r, /*flags*/ 0); -- free(data); - } - - log(_("Logging out")); -@@ -385,7 +369,7 @@ int main(int argc, char **argv) - else - { - report_to_bugzilla(dump_dir_name, login, password, bugzilla_xmlrpc, -- bugzilla_url, ssl_verify); -+ bugzilla_url, ssl_verify, opts & OPT_b); - } - - free_map_string(settings); -diff --git a/src/plugins/reporter-bugzilla.txt b/src/plugins/reporter-bugzilla.txt -index c78a1ba..4285600 100644 ---- a/src/plugins/reporter-bugzilla.txt -+++ b/src/plugins/reporter-bugzilla.txt -@@ -10,7 +10,7 @@ reporter-bugzilla - Reports problem to Bugzilla. - - SYNOPSIS - -------- --'reporter-bugzilla' [-v] [-c CONFFILE] -d DIR -+'reporter-bugzilla' [-vb] [-c CONFFILE] -d DIR - - DESCRIPTION - ----------- -@@ -62,6 +62,12 @@ OPTIONS - - -c CONFFILE:: - Path to configuration file. -+ -+-b: -+ When creating bug, attach binary files too. -+ -+-t[ID]:: -+ Upload FILEs to the already created bug on Bugzilla site - - SEE ALSO - -------- -diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c -index e086042..8ccb72b 100644 ---- a/src/plugins/rhbz.c -+++ b/src/plugins/rhbz.c -@@ -380,7 +380,7 @@ int rhbz_new_bug(struct abrt_xmlrpc *ax, problem_data_t *problem_data, - } - - /* suppress mail notify by {s:i} (nomail:1) (driven by flag) */ --int rhbz_attachment(struct abrt_xmlrpc *ax, const char *filename, -+int rhbz_attach_blob(struct abrt_xmlrpc *ax, const char *filename, - const char *bug_id, const char *data, int data_len, int flags) - { - char *encoded64 = encode_base64(data, data_len); -@@ -406,8 +406,38 @@ int rhbz_attachment(struct abrt_xmlrpc *ax, const char *filename, - return 0; - } - -+int rhbz_attach_fd(struct abrt_xmlrpc *ax, const char *filename, -+ const char *bug_id, int fd, int flags) -+{ -+ off_t size = lseek(fd, 0, SEEK_END); -+ if (size < 0) -+ { -+ perror_msg("Can't lseek '%s'", filename); -+ return -1; -+ } -+ if (size > INT_MAX / 2) -+ { -+ error_msg("Can't upload '%s', it's too large (%llu bytes)", filename, (long long)size); -+ return -1; -+ } -+ lseek(fd, 0, SEEK_SET); -+ -+ char *data = xmalloc(size + 1); -+ ssize_t r = full_read(fd, data, size); -+ if (r < 0) -+ { -+ free(data); -+ perror_msg("Can't read '%s'", filename); -+ return -1; -+ } -+ -+ int res = rhbz_attach_blob(ax, filename, bug_id, data, size, flags); -+ free(data); -+ return res; -+} -+ - /* suppress mail notify by {s:i} (nomail:1) (driven by flag) */ --int rhbz_attachments(struct abrt_xmlrpc *ax, const char *bug_id, -+int rhbz_attach_big_files(struct abrt_xmlrpc *ax, const char *bug_id, - problem_data_t *problem_data, int flags) - { - GHashTableIter iter; -@@ -427,8 +457,26 @@ int rhbz_attachments(struct abrt_xmlrpc *ax, const char *bug_id, - /* This text item wasn't added in comments, it is too big - * for that. Attach it as a file. - */ -- rhbz_attachment(ax, name, bug_id, content, len, flags); -+ rhbz_attach_blob(ax, name, bug_id, content, len, flags); -+ } -+ } -+ if ((flags & RHBZ_ATTACH_BINARY_FILES) && (value->flags & CD_FLAG_BIN)) -+ { -+ int fd = open(value->content, O_RDONLY); -+ if (fd < 0) -+ { -+ perror_msg("Can't open '%s'", value->content); -+ continue; -+ } -+ struct stat st; -+ if (fstat(fd, &st) != 0 || !S_ISREG(st.st_mode)) -+ { -+ error_msg("'%s': not a regular file", value->content); -+ close(fd); -+ continue; - } -+ rhbz_attach_fd(ax, name, bug_id, fd, flags); -+ close(fd); - } - } - -diff --git a/src/plugins/rhbz.h b/src/plugins/rhbz.h -index 29908b6..8e782b8 100644 ---- a/src/plugins/rhbz.h -+++ b/src/plugins/rhbz.h -@@ -36,6 +36,7 @@ enum { - RHBZ_READ_INT = (1 << 2), - RHBZ_NOMAIL_NOTIFY = (1 << 3), - RHBZ_PRIVATE = (1 << 4), -+ RHBZ_ATTACH_BINARY_FILES = (1 << 5), - }; - - #define IS_MANDATORY(flags) ((flags) & RHBZ_MANDATORY_MEMB) -@@ -82,12 +83,15 @@ int rhbz_bug_id(xmlrpc_value *xml); - int rhbz_new_bug(struct abrt_xmlrpc *ax, problem_data_t *problem_data, - int depend_on_bug); - --int rhbz_attachments(struct abrt_xmlrpc *ax, const char *bug_id, -+int rhbz_attach_big_files(struct abrt_xmlrpc *ax, const char *bug_id, - problem_data_t *problem_data, int flags); - --int rhbz_attachment(struct abrt_xmlrpc *ax, const char *filename, -+int rhbz_attach_blob(struct abrt_xmlrpc *ax, const char *filename, - const char *bug_id, const char *data, int data_len, int flags); - -+int rhbz_attach_fd(struct abrt_xmlrpc *ax, const char *filename, -+ const char *bug_id, int fd, int flags); -+ - GList *rhbz_bug_cc(xmlrpc_value *result_xml); - - struct bug_info *rhbz_bug_info(struct abrt_xmlrpc *ax, int bug_id); --- -1.7.6.1 - diff --git a/0001-reporter-bugzilla-fix-file-attaching-was-using-strle.patch b/0001-reporter-bugzilla-fix-file-attaching-was-using-strle.patch deleted file mode 100644 index 7b694a7..0000000 --- a/0001-reporter-bugzilla-fix-file-attaching-was-using-strle.patch +++ /dev/null @@ -1,102 +0,0 @@ -From 07e991785371cf119e47b7efe063decf38c96dc4 Mon Sep 17 00:00:00 2001 -From: Denys Vlasenko -Date: Tue, 30 Aug 2011 12:54:26 +0200 -Subject: [PATCH 1/2] reporter-bugzilla: fix file attaching (was using strlen - even on binary files) - -Signed-off-by: Denys Vlasenko ---- - src/plugins/reporter-bugzilla.c | 5 +++-- - src/plugins/rhbz.c | 26 +++++++++++++++----------- - src/plugins/rhbz.h | 2 +- - 3 files changed, 19 insertions(+), 14 deletions(-) - -diff --git a/src/plugins/reporter-bugzilla.c b/src/plugins/reporter-bugzilla.c -index 745ecbb..4bf8708 100644 ---- a/src/plugins/reporter-bugzilla.c -+++ b/src/plugins/reporter-bugzilla.c -@@ -357,12 +357,13 @@ int main(int argc, char **argv) - off_t size = lseek(fd, 0, SEEK_END); - if (size < 0) - { -- close(fd); - perror_msg("Can't lseek '%s'", filename); -+ close(fd); - continue; - } - lseek(fd, 0, SEEK_SET); - -+ /* FIXME: what if the file is tens of gigabytes? */ - char *data = xmalloc(size + 1); - ssize_t r = full_read(fd, data, size); - if (r < 0) -@@ -374,7 +375,7 @@ int main(int argc, char **argv) - } - close(fd); - -- rhbz_attachment(client, filename, ticket_no, data, /*flags*/ 0); -+ rhbz_attachment(client, filename, ticket_no, data, r, /*flags*/ 0); - free(data); - } - -diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c -index 5b53465..e086042 100644 ---- a/src/plugins/rhbz.c -+++ b/src/plugins/rhbz.c -@@ -381,9 +381,9 @@ int rhbz_new_bug(struct abrt_xmlrpc *ax, problem_data_t *problem_data, - - /* suppress mail notify by {s:i} (nomail:1) (driven by flag) */ - int rhbz_attachment(struct abrt_xmlrpc *ax, const char *filename, -- const char *bug_id, const char *data, int flags) -+ const char *bug_id, const char *data, int data_len, int flags) - { -- char *encoded64 = encode_base64(data, strlen(data)); -+ char *encoded64 = encode_base64(data, data_len); - char *fn = xasprintf("File: %s", filename); - xmlrpc_value* result; - int nomail_notify = IS_NOMAIL_NOTIFY(flags); -@@ -416,15 +416,19 @@ int rhbz_attachments(struct abrt_xmlrpc *ax, const char *bug_id, - g_hash_table_iter_init(&iter, problem_data); - while (g_hash_table_iter_next(&iter, (void**)&name, (void**)&value)) - { -- const char *content = value->content; -- -- // We were special-casing FILENAME_BACKTRACE here, but karel says -- // he can retrieve it in inlined form from comments too. -- if ((value->flags & CD_FLAG_TXT) -- && (strlen(content) > CD_TEXT_ATT_SIZE /*|| (strcmp(name, FILENAME_BACKTRACE) == 0)*/) -- ) { -- /* check if the attachment failed and try it once more */ -- rhbz_attachment(ax, name, bug_id, content, flags); -+ if (value->flags & CD_FLAG_TXT) -+ { -+ const char *content = value->content; -+ unsigned len = strlen(content); -+ // We were special-casing FILENAME_BACKTRACE here, but karel says -+ // he can retrieve it in inlined form from comments too. -+ if (len > CD_TEXT_ATT_SIZE /*|| (strcmp(name, FILENAME_BACKTRACE) == 0)*/) -+ { -+ /* This text item wasn't added in comments, it is too big -+ * for that. Attach it as a file. -+ */ -+ rhbz_attachment(ax, name, bug_id, content, len, flags); -+ } - } - } - -diff --git a/src/plugins/rhbz.h b/src/plugins/rhbz.h -index 6a12c68..29908b6 100644 ---- a/src/plugins/rhbz.h -+++ b/src/plugins/rhbz.h -@@ -86,7 +86,7 @@ int rhbz_attachments(struct abrt_xmlrpc *ax, const char *bug_id, - problem_data_t *problem_data, int flags); - - int rhbz_attachment(struct abrt_xmlrpc *ax, const char *filename, -- const char *bug_id, const char *data, int flags); -+ const char *bug_id, const char *data, int data_len, int flags); - - GList *rhbz_bug_cc(xmlrpc_value *result_xml); - --- -1.7.6.1 - 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 deleted file mode 100644 index 631328f..0000000 --- a/0001-warn-silently-if-keyring-is-not-available-rhbz-72585.patch +++ /dev/null @@ -1,186 +0,0 @@ -From b3256793135b3466b85090f081373c428cd2c571 Mon Sep 17 00:00:00 2001 -From: Jiri Moskovcak -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-Add-a-button-to-add-more-files-to-dump-dir.-Closes-1.patch b/0002-Add-a-button-to-add-more-files-to-dump-dir.-Closes-1.patch deleted file mode 100644 index e5f5ea9..0000000 --- a/0002-Add-a-button-to-add-more-files-to-dump-dir.-Closes-1.patch +++ /dev/null @@ -1,134 +0,0 @@ -From 431cad6bc413aaf296b49a510bf5e37aaffc2263 Mon Sep 17 00:00:00 2001 -From: Denys Vlasenko -Date: Tue, 19 Jul 2011 10:04:35 +0200 -Subject: [PATCH 02/12] Add a button to add more files to dump dir. Closes #17 - -Signed-off-by: Denys Vlasenko ---- - src/gui-wizard-gtk/wizard.c | 49 ++++++++++++++++++++++++++++++++++++++- - src/gui-wizard-gtk/wizard.glade | 28 ++++++++++++++++++++++ - 2 files changed, 76 insertions(+), 1 deletions(-) - -diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c -index ada9823..cdc4a5c 100644 ---- a/src/gui-wizard-gtk/wizard.c -+++ b/src/gui-wizard-gtk/wizard.c -@@ -63,6 +63,7 @@ static GtkWidget *g_widget_warnings_area; - static GtkBox *g_box_warning_labels; - static GtkToggleButton *g_tb_approve_bt; - static GtkButton *g_btn_refresh; -+static GtkButton *g_btn_add_file; - - static GtkLabel *g_lbl_reporters; - static GtkLabel *g_lbl_size; -@@ -1752,6 +1753,7 @@ static void add_pages() - g_search_entry_bt = GTK_ENTRY( gtk_builder_get_object(builder, "entry_search_bt")); - g_container_details1 = GTK_CONTAINER( gtk_builder_get_object(builder, "container_details1")); - g_container_details2 = GTK_CONTAINER( gtk_builder_get_object(builder, "container_details2")); -+ g_btn_add_file = GTK_BUTTON( gtk_builder_get_object(builder, "btn_add_file")); - g_lbl_reporters = GTK_LABEL( gtk_builder_get_object(builder, "lbl_reporters")); - g_lbl_size = GTK_LABEL( gtk_builder_get_object(builder, "lbl_size")); - -@@ -1861,7 +1863,50 @@ static void save_edited_one_liner(GtkCellRendererText *renderer, - } - } - --static void create_details_treeview() -+static void on_btn_add_file(GtkButton *button) -+{ -+ GtkWidget *dialog = gtk_file_chooser_dialog_new( -+ "Attach File", -+ GTK_WINDOW(g_assistant), -+ GTK_FILE_CHOOSER_ACTION_OPEN, -+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, -+ GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, -+ NULL -+ ); -+ if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) -+ { -+ char *filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); -+ -+ char *basename = strrchr(filename, '/'); -+ if (!basename) /* wtf? */ -+ goto free_and_ret; -+ basename++; -+ -+ struct stat statbuf; -+ if (stat(filename, &statbuf) != 0 || !S_ISREG(statbuf.st_mode)) -+ goto free_and_ret; -+ -+ struct problem_item *item = get_problem_data_item_or_NULL(g_cd, basename); -+ if (!item || (item->flags & CD_FLAG_ISEDITABLE)) -+ { -+ char *new_name = concat_path_file(g_dump_dir_name, basename); -+ /* TODO: error check */ -+ copy_file(filename, new_name, 0666); -+ free(new_name); -+ reload_problem_data_from_dump_dir(); -+ update_gui_state_from_problem_data(); -+ } -+ else -+ { -+ /* TODO: error dialog */ -+ } -+ free_and_ret: -+ g_free(filename); -+ } -+ gtk_widget_destroy(dialog); -+} -+ -+static void create_details_treeview(void) - { - GtkCellRenderer *renderer; - GtkTreeViewColumn *column; -@@ -1944,6 +1989,8 @@ void create_assistant(void) - g_signal_connect(g_btn_refresh, "clicked", G_CALLBACK(on_btn_refresh_clicked), NULL); - g_signal_connect(gtk_text_view_get_buffer(g_tv_comment), "changed", G_CALLBACK(on_comment_changed), NULL); - -+ g_signal_connect(g_btn_add_file, "clicked", G_CALLBACK(on_btn_add_file), NULL); -+ - /* init searching */ - GtkTextBuffer *backtrace_buf = gtk_text_view_get_buffer(g_tv_backtrace); - /* found items background */ -diff --git a/src/gui-wizard-gtk/wizard.glade b/src/gui-wizard-gtk/wizard.glade -index 49acd67..ba8b09a 100644 ---- a/src/gui-wizard-gtk/wizard.glade -+++ b/src/gui-wizard-gtk/wizard.glade -@@ -685,6 +685,34 @@ - 2 - - -+ -+ -+ True -+ False -+ -+ -+ Attach a file -+ True -+ True -+ True -+ False -+ -+ -+ False -+ False -+ 0 -+ -+ -+ -+ -+ -+ -+ -+ False -+ True -+ 3 -+ -+ - - - --- -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 deleted file mode 100644 index 2be8fcb..0000000 --- a/0002-don-t-reload-event-configuration-when-dump_dir-chang.patch +++ /dev/null @@ -1,30 +0,0 @@ -From e7b9e246430753fb31a39bc64d0f65ea9a716dca Mon Sep 17 00:00:00 2001 -From: Jiri Moskovcak -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/0002-wizard-support-shell-glob-patterns-in-.xml-item-sele.patch b/0002-wizard-support-shell-glob-patterns-in-.xml-item-sele.patch deleted file mode 100644 index 8f596e9..0000000 --- a/0002-wizard-support-shell-glob-patterns-in-.xml-item-sele.patch +++ /dev/null @@ -1,151 +0,0 @@ -From 625a3500d1292068ce5f8cfc56253c4d6d6defea Mon Sep 17 00:00:00 2001 -From: Denys Vlasenko -Date: Tue, 30 Aug 2011 14:05:40 +0200 -Subject: [PATCH 2/2] wizard: support shell glob patterns in .xml item - selectors - -We used to support "*" only. Example: - - backtrace - - * - yes - - 0 - -The patch below adds support for patterns like *.txt, abc* -As a consequence, special-casing code is removed. - -Signed-off-by: Denys Vlasenko ---- - src/gui-wizard-gtk/wizard.c | 24 ++++++------------------ - src/include/internal_libreport.h | 2 ++ - src/lib/is_in_comma_separated_list.c | 20 ++++++++++++++++++++ - src/lib/problem_data.c | 2 +- - 4 files changed, 29 insertions(+), 19 deletions(-) - -diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c -index a814278..c313bcb 100644 ---- a/src/gui-wizard-gtk/wizard.c -+++ b/src/gui-wizard-gtk/wizard.c -@@ -1846,18 +1846,6 @@ static void on_page_prepare(GtkAssistant *assistant, GtkWidget *page, gpointer u - /* Based on selected reporter, update item checkboxes */ - event_config_t *cfg = get_event_config(g_reporter_events_selected ? g_reporter_events_selected : ""); - //log("%s: event:'%s', cfg:'%p'", __func__, g_reporter_events_selected, cfg); -- int allowed_by_reporter = 1; -- int default_by_reporter = 1; -- if (cfg) -- { -- /* Default settings are... */ -- if (cfg->ec_exclude_items_always && strcmp(cfg->ec_exclude_items_always, "*") == 0) -- allowed_by_reporter = 0; -- default_by_reporter = allowed_by_reporter; -- if (cfg->ec_exclude_items_by_default && strcmp(cfg->ec_exclude_items_by_default, "*") == 0) -- default_by_reporter = 0; -- } -- - GHashTableIter iter; - char *name; - struct problem_item *item; -@@ -1865,28 +1853,28 @@ static void on_page_prepare(GtkAssistant *assistant, GtkWidget *page, gpointer u - while (g_hash_table_iter_next(&iter, (void**)&name, (void**)&item)) - { - /* Decide whether item is allowed, required, and what's the default */ -- item->allowed_by_reporter = allowed_by_reporter; -+ item->allowed_by_reporter = 1; - if (cfg) - { -- if (is_in_comma_separated_list(name, cfg->ec_exclude_items_always)) -+ if (is_in_comma_separated_list_of_glob_patterns(name, cfg->ec_exclude_items_always)) - item->allowed_by_reporter = 0; - if ((item->flags & CD_FLAG_BIN) && cfg->ec_exclude_binary_items) - item->allowed_by_reporter = 0; - } - -- item->default_by_reporter = item->allowed_by_reporter ? default_by_reporter : 0; -+ item->default_by_reporter = item->allowed_by_reporter; - if (cfg) - { -- if (is_in_comma_separated_list(name, cfg->ec_exclude_items_by_default)) -+ if (is_in_comma_separated_list_of_glob_patterns(name, cfg->ec_exclude_items_by_default)) - item->default_by_reporter = 0; -- if (is_in_comma_separated_list(name, cfg->ec_include_items_by_default)) -+ if (is_in_comma_separated_list_of_glob_patterns(name, cfg->ec_include_items_by_default)) - item->allowed_by_reporter = item->default_by_reporter = 1; - } - - item->required_by_reporter = 0; - if (cfg) - { -- if (is_in_comma_separated_list(name, cfg->ec_requires_items)) -+ if (is_in_comma_separated_list_of_glob_patterns(name, cfg->ec_requires_items)) - item->default_by_reporter = item->allowed_by_reporter = item->required_by_reporter = 1; - } - -diff --git a/src/include/internal_libreport.h b/src/include/internal_libreport.h -index 1fee5a3..afaf911 100644 ---- a/src/include/internal_libreport.h -+++ b/src/include/internal_libreport.h -@@ -236,6 +236,8 @@ bool is_in_string_list(const char *name, char **v); - - #define is_in_comma_separated_list libreport_is_in_comma_separated_list - bool is_in_comma_separated_list(const char *value, const char *list); -+#define is_in_comma_separated_list_of_glob_patterns libreport_is_in_comma_separated_list_of_glob_patterns -+bool is_in_comma_separated_list_of_glob_patterns(const char *value, const char *list); - - /* Frees every element'd data using free(), - * then frees list itself using g_list_free(list): -diff --git a/src/lib/is_in_comma_separated_list.c b/src/lib/is_in_comma_separated_list.c -index 0afaf7b..6bec243 100644 ---- a/src/lib/is_in_comma_separated_list.c -+++ b/src/lib/is_in_comma_separated_list.c -@@ -16,6 +16,7 @@ - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ -+#include - #include "internal_libreport.h" - - bool is_in_comma_separated_list(const char *value, const char *list) -@@ -34,3 +35,22 @@ bool is_in_comma_separated_list(const char *value, const char *list) - } - return false; - } -+ -+bool is_in_comma_separated_list_of_glob_patterns(const char *value, const char *list) -+{ -+ if (!list) -+ return false; -+ while (*list) -+ { -+ const char *comma = strchrnul(list, ','); -+ char *pattern = xstrndup(list, comma - list); -+ int match = !fnmatch(pattern, value, /*flags:*/ 0); -+ free(pattern); -+ if (match) -+ return true; -+ if (!*comma) -+ break; -+ list = comma + 1; -+ } -+ return false; -+} -diff --git a/src/lib/problem_data.c b/src/lib/problem_data.c -index 7ff1d59..33227ed 100644 ---- a/src/lib/problem_data.c -+++ b/src/lib/problem_data.c -@@ -433,10 +433,10 @@ static char **build_exclude_vector(const char *comma_separated_list) - - problem_data_t *create_problem_data_for_reporting(const char *dump_dir_name) - { -- char **exclude_items = build_exclude_vector(getenv("EXCLUDE_FROM_REPORT")); - struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0); - if (!dd) - return NULL; /* dd_opendir already emitted error msg */ -+ char **exclude_items = build_exclude_vector(getenv("EXCLUDE_FROM_REPORT")); - problem_data_t *problem_data = new_problem_data(); - load_problem_data_from_dump_dir(problem_data, dd, exclude_items); - dd_close(dd); --- -1.7.6.1 - diff --git a/0003-Ignore-files-which-seem-to-be-editor-backups.-Closes.patch b/0003-Ignore-files-which-seem-to-be-editor-backups.-Closes.patch deleted file mode 100644 index c4068c8..0000000 --- a/0003-Ignore-files-which-seem-to-be-editor-backups.-Closes.patch +++ /dev/null @@ -1,32 +0,0 @@ -From e4cc4a2a0dfdf644613861e6bd922152a67bf3b8 Mon Sep 17 00:00:00 2001 -From: Denys Vlasenko -Date: Tue, 19 Jul 2011 10:21:49 +0200 -Subject: [PATCH 03/12] Ignore files which seem to be editor backups. Closes - bz#707959 - -Signed-off-by: Denys Vlasenko ---- - src/lib/problem_data.c | 7 +++++++ - 1 files changed, 7 insertions(+), 0 deletions(-) - -diff --git a/src/lib/problem_data.c b/src/lib/problem_data.c -index fcaf8fa..0878b88 100644 ---- a/src/lib/problem_data.c -+++ b/src/lib/problem_data.c -@@ -309,6 +309,13 @@ void load_problem_data_from_dump_dir(problem_data_t *problem_data, struct dump_d - goto next; - } - -+ if (short_name[0] == '#' -+ || (short_name[0] && short_name[strlen(short_name) - 1] == '~') -+ ) { -+ //log("Excluded (editor backup file):'%s'", short_name); -+ goto next; -+ } -+ - ssize_t sz = 4*1024; - char *text = NULL; - bool editable = is_editable_file(short_name); --- -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 deleted file mode 100644 index 4713b98..0000000 --- a/0003-wizard-add-configure-event-button-to-wrong-settings-.patch +++ /dev/null @@ -1,87 +0,0 @@ -From a0a0fa18401bdfb715737adf47dc93dc9c5aa1f2 Mon Sep 17 00:00:00 2001 -From: Jiri Moskovcak -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-added-bugzilla_event.conf-to-enable-Bugzilla-for-all.patch b/0004-added-bugzilla_event.conf-to-enable-Bugzilla-for-all.patch deleted file mode 100644 index 876b754..0000000 --- a/0004-added-bugzilla_event.conf-to-enable-Bugzilla-for-all.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 973be6c9f86e6966985984fc647be1156605ff58 Mon Sep 17 00:00:00 2001 -From: Jiri Moskovcak -Date: Wed, 27 Jul 2011 19:57:00 +0200 -Subject: [PATCH 04/52] added bugzilla_event.conf to enable Bugzilla for all - problems not coming from ABRT rhbz#725970 - ---- - src/plugins/Makefile.am | 1 + - src/plugins/bugzilla_event.conf | 1 + - 3 files changed, 3 insertions(+), 0 deletions(-) - create mode 100644 src/plugins/bugzilla_event.conf - ---- a/src/plugins/Makefile.am -+++ b/src/plugins/Makefile.am -@@ -35,6 +35,7 @@ eventsconfdir = $(EVENTS_CONF_DIR) - dist_eventsconf_DATA = \ - mailx_event.conf \ - print_event.conf \ -+ bugzilla_event.conf \ - rhtsupport_event.conf - - MAN_TXT = \ -diff --git a/src/plugins/bugzilla_event.conf b/src/plugins/bugzilla_event.conf -new file mode 100644 -index 0000000..3fb604d ---- /dev/null -+++ b/src/plugins/bugzilla_event.conf -@@ -0,0 +1 @@ -+EVENT=report_Bugzilla analyzer=libreport reporter-bugzilla -\ No newline at end of file --- -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 deleted file mode 100644 index 259c762..0000000 --- a/0004-check-settings-only-for-last-selected-reporter.patch +++ /dev/null @@ -1,84 +0,0 @@ -From a7aae58e81de44a121f1d1c4a8df43692688afbd Mon Sep 17 00:00:00 2001 -From: Jiri Moskovcak -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/0004-wizard-steal-directory-before-copying-added-files-to.patch b/0004-wizard-steal-directory-before-copying-added-files-to.patch deleted file mode 100644 index b8998ef..0000000 --- a/0004-wizard-steal-directory-before-copying-added-files-to.patch +++ /dev/null @@ -1,195 +0,0 @@ -From 9e36fa04511b245ae904d67cbb9cd803d3a7e7c6 Mon Sep 17 00:00:00 2001 -From: Denys Vlasenko -Date: Tue, 19 Jul 2011 12:06:01 +0200 -Subject: [PATCH 04/12] wizard: steal directory before copying added files to - it - -Signed-off-by: Denys Vlasenko ---- - src/gui-wizard-gtk/wizard.c | 163 +++++++++++++++++++++++-------------------- - 1 files changed, 86 insertions(+), 77 deletions(-) - -diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c -index cdc4a5c..847e84c 100644 ---- a/src/gui-wizard-gtk/wizard.c -+++ b/src/gui-wizard-gtk/wizard.c -@@ -1675,6 +1675,92 @@ static void search_timeout(GtkEntry *entry) - g_timeout = g_timeout_add(500, &highlight_search, (gpointer)entry); - } - -+static void save_edited_one_liner(GtkCellRendererText *renderer, -+ gchar *tree_path, -+ gchar *new_text, -+ gpointer user_data) -+{ -+ //log("path:'%s' new_text:'%s'", tree_path, new_text); -+ -+ GtkTreeIter iter; -+ if (!gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(g_ls_details), &iter, tree_path)) -+ return; -+ gchar *item_name = NULL; -+ gtk_tree_model_get(GTK_TREE_MODEL(g_ls_details), &iter, -+ DETAIL_COLUMN_NAME, &item_name, -+ -1); -+ if (!item_name) /* paranoia, should never happen */ -+ return; -+ struct problem_item *item = get_problem_data_item_or_NULL(g_cd, item_name); -+ if (item && (item->flags & CD_FLAG_ISEDITABLE)) -+ { -+ struct dump_dir *dd = dd_opendir(g_dump_dir_name, DD_OPEN_READONLY); -+ dd = steal_if_needed(dd); -+ if (dd && dd->locked) -+ { -+ dd_save_text(dd, item_name, new_text); -+ free(item->content); -+ item->content = xstrdup(new_text); -+ gtk_list_store_set(g_ls_details, &iter, -+ DETAIL_COLUMN_VALUE, new_text, -+ -1); -+ } -+ dd_close(dd); -+ } -+} -+ -+static void on_btn_add_file(GtkButton *button) -+{ -+ GtkWidget *dialog = gtk_file_chooser_dialog_new( -+ "Attach File", -+ GTK_WINDOW(g_assistant), -+ GTK_FILE_CHOOSER_ACTION_OPEN, -+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, -+ GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, -+ NULL -+ ); -+ char *filename = NULL; -+ if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) -+ filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); -+ gtk_widget_destroy(dialog); -+ -+ if (filename) -+ { -+ char *basename = strrchr(filename, '/'); -+ if (!basename) /* wtf? */ -+ goto free_and_ret; -+ basename++; -+ -+ struct stat statbuf; -+ if (stat(filename, &statbuf) != 0 || !S_ISREG(statbuf.st_mode)) -+ goto free_and_ret; -+ -+ struct problem_item *item = get_problem_data_item_or_NULL(g_cd, basename); -+ if (!item || (item->flags & CD_FLAG_ISEDITABLE)) -+ { -+ struct dump_dir *dd = dd_opendir(g_dump_dir_name, DD_OPEN_READONLY); -+ dd = steal_if_needed(dd); -+ bool writable = (dd && dd->locked); -+ dd_close(dd); -+ if (writable) -+ { -+ char *new_name = concat_path_file(g_dump_dir_name, basename); -+ /* TODO: error check */ -+ copy_file(filename, new_name, 0666); -+ free(new_name); -+ reload_problem_data_from_dump_dir(); -+ update_gui_state_from_problem_data(); -+ } -+ } -+ else -+ { -+ /* TODO: show error dialog */ -+ } -+ free_and_ret: -+ g_free(filename); -+ } -+} -+ - - /* Initialization */ - -@@ -1829,83 +1915,6 @@ static void add_pages() - // g_signal_connect(g_tv_details, "key-press-event", G_CALLBACK(on_key_press_event_cb), NULL); - } - --static void save_edited_one_liner(GtkCellRendererText *renderer, -- gchar *tree_path, -- gchar *new_text, -- gpointer user_data) --{ -- //log("path:'%s' new_text:'%s'", tree_path, new_text); -- -- GtkTreeIter iter; -- if (!gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(g_ls_details), &iter, tree_path)) -- return; -- gchar *item_name = NULL; -- gtk_tree_model_get(GTK_TREE_MODEL(g_ls_details), &iter, -- DETAIL_COLUMN_NAME, &item_name, -- -1); -- if (!item_name) /* paranoia, should never happen */ -- return; -- struct problem_item *item = get_problem_data_item_or_NULL(g_cd, item_name); -- if (item && (item->flags & CD_FLAG_ISEDITABLE)) -- { -- struct dump_dir *dd = dd_opendir(g_dump_dir_name, DD_OPEN_READONLY); -- dd = steal_if_needed(dd); -- if (dd && dd->locked) -- { -- dd_save_text(dd, item_name, new_text); -- free(item->content); -- item->content = xstrdup(new_text); -- gtk_list_store_set(g_ls_details, &iter, -- DETAIL_COLUMN_VALUE, new_text, -- -1); -- } -- dd_close(dd); -- } --} -- --static void on_btn_add_file(GtkButton *button) --{ -- GtkWidget *dialog = gtk_file_chooser_dialog_new( -- "Attach File", -- GTK_WINDOW(g_assistant), -- GTK_FILE_CHOOSER_ACTION_OPEN, -- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, -- GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, -- NULL -- ); -- if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) -- { -- char *filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); -- -- char *basename = strrchr(filename, '/'); -- if (!basename) /* wtf? */ -- goto free_and_ret; -- basename++; -- -- struct stat statbuf; -- if (stat(filename, &statbuf) != 0 || !S_ISREG(statbuf.st_mode)) -- goto free_and_ret; -- -- struct problem_item *item = get_problem_data_item_or_NULL(g_cd, basename); -- if (!item || (item->flags & CD_FLAG_ISEDITABLE)) -- { -- char *new_name = concat_path_file(g_dump_dir_name, basename); -- /* TODO: error check */ -- copy_file(filename, new_name, 0666); -- free(new_name); -- reload_problem_data_from_dump_dir(); -- update_gui_state_from_problem_data(); -- } -- else -- { -- /* TODO: error dialog */ -- } -- free_and_ret: -- g_free(filename); -- } -- gtk_widget_destroy(dialog); --} -- - static void create_details_treeview(void) - { - GtkCellRenderer *renderer; --- -1.7.6 - diff --git a/0005-improved-compatibility-with-anaconda-rhbz-725857.patch b/0005-improved-compatibility-with-anaconda-rhbz-725857.patch deleted file mode 100644 index bad677b..0000000 --- a/0005-improved-compatibility-with-anaconda-rhbz-725857.patch +++ /dev/null @@ -1,288 +0,0 @@ -From 43d9b58ca0ef0242a3905253120c6dbc82c8bc0d Mon Sep 17 00:00:00 2001 -From: Jiri Moskovcak -Date: Thu, 28 Jul 2011 14:44:43 +0200 -Subject: [PATCH 05/52] improved compatibility with anaconda rhbz#725857 - -- + thoughts from the review ---- - src/lib/create_dump_dir.c | 9 ++- - src/lib/dump_dir.c | 15 ++++- - src/lib/parse_release.c | 6 ++ - src/report-python/__init__.py | 144 +++++++++++++++++++++++------------------ - 4 files changed, 107 insertions(+), 67 deletions(-) - -diff --git a/src/lib/create_dump_dir.c b/src/lib/create_dump_dir.c -index 13c42e4..27e3761 100644 ---- a/src/lib/create_dump_dir.c -+++ b/src/lib/create_dump_dir.c -@@ -23,8 +23,6 @@ static struct dump_dir *try_dd_create(const char *base_dir_name, const char *dir - { - char *path = concat_path_file(base_dir_name, dir_name); - struct dump_dir *dd = dd_create(path, (uid_t)-1L, 0640); -- if (dd) -- dd_create_basic_files(dd, (uid_t)-1L); - free(path); - return dd; - } -@@ -81,5 +79,12 @@ struct dump_dir *create_dump_dir_from_problem_data(problem_data_t *problem_data, - next: ; - } - -+ /* need to create basic files AFTER we save the pd to dump_dir -+ * otherwise we can't skip already created files like in case when -+ * reporting from anaconda where we can't read /etc/{system,redhat}-release -+ * and os_release is taken from anaconda -+ */ -+ dd_create_basic_files(dd, (uid_t)-1L); -+ - return dd; - } -diff --git a/src/lib/dump_dir.c b/src/lib/dump_dir.c -index e4e7fad..d11eeb7 100644 ---- a/src/lib/dump_dir.c -+++ b/src/lib/dump_dir.c -@@ -492,8 +492,19 @@ void dd_create_basic_files(struct dump_dir *dd, uid_t uid) - dd_save_text(dd, FILENAME_ARCHITECTURE, buf.machine); - dd_save_text(dd, FILENAME_HOSTNAME, buf.nodename); - -- char *release = load_text_file("/etc/system-release", -- DD_LOAD_TEXT_RETURN_NULL_ON_FAILURE); -+ /* if release exists in dumpdir don't create it, but don't warn -+ * if it doesn't -+ * i.e: anaconda doesn't have /etc/{fedora,redhat}-release and trying to load it -+ * results in errors: rhbz#725857 -+ */ -+ char *release = dd_load_text_ext(dd, FILENAME_OS_RELEASE, -+ DD_FAIL_QUIETLY_ENOENT | DD_LOAD_TEXT_RETURN_NULL_ON_FAILURE); -+ -+ if (release) -+ return; -+ -+ release = load_text_file("/etc/system-release", -+ DD_LOAD_TEXT_RETURN_NULL_ON_FAILURE); - if (!release) - release = load_text_file("/etc/redhat-release", /*flags:*/ 0); - dd_save_text(dd, FILENAME_OS_RELEASE, release); -diff --git a/src/lib/parse_release.c b/src/lib/parse_release.c -index 2cc11ba..889f539 100644 ---- a/src/lib/parse_release.c -+++ b/src/lib/parse_release.c -@@ -40,6 +40,12 @@ static void parse_release(const char *release, char** product, char** version, b - strbuf_append_str(buf_product, release); - } - -+ /* examples of release strings: -+ * installed system: Red Hat Enterprise Linux Server release 6.2 Beta (Santiago) -+ * anaconda: Red Hat Enterprise Linux 6.2 -+ * ^ note missing "release" -+ * so the following parsing would fail, workaround is in python bindings -+ */ - const char *r = strstr(release, "release"); - const char *space = r ? strchr(r, ' ') : NULL; - -diff --git a/src/report-python/__init__.py b/src/report-python/__init__.py -index 796d469..fbbc158 100644 ---- a/src/report-python/__init__.py -+++ b/src/report-python/__init__.py -@@ -16,108 +16,118 @@ from _pyreport import * - - - #Compatibility with report package: -+# Author(s): Gavin Romig-Koch -+# ABRT Team - - import os - - SYSTEM_RELEASE_PATHS = ["/etc/system-release","/etc/redhat-release"] --####SYSTEM_RELEASE_DEPS = ["system-release", "redhat-release"] -+SYSTEM_RELEASE_DEPS = ["system-release", "redhat-release"] - - _hardcoded_default_product = "" - _hardcoded_default_version = "" - --####def getProduct_fromPRODUCT(): --#### try: --#### import product --#### return product.productName --#### except: --#### return "" -- --####def getVersion_fromPRODUCT(): --#### try: --#### import product --#### return product.productVersion --#### except: --#### return "" -- --####def getProduct_fromRPM(): --#### try: --#### import rpm --#### ts = rpm.TransactionSet() --#### for each_dep in SYSTEM_RELEASE_DEPS: --#### mi = ts.dbMatch('provides', each_dep) --#### for h in mi: --#### if h['name']: --#### return h['name'].split("-")[0].capitalize() --#### --#### return "" --#### except: --#### return "" -- --####def getVersion_fromRPM(): --#### try: --#### import rpm --#### ts = rpm.TransactionSet() --#### for each_dep in SYSTEM_RELEASE_DEPS: --#### mi = ts.dbMatch('provides', each_dep) --#### for h in mi: --#### if h['version']: --#### return str(h['version']) --#### return "" --#### except: --#### return "" -+""" -+def getProduct_fromRPM(): -+ try: -+ import rpm -+ ts = rpm.TransactionSet() -+ for each_dep in SYSTEM_RELEASE_DEPS: -+ mi = ts.dbMatch('provides', each_dep) -+ for h in mi: -+ if h['name']: -+ return h['name'].split("-")[0].capitalize() -+ -+ return "" -+ except: -+ return "" - - def getProduct_fromFILE(): - for each_path in SYSTEM_RELEASE_PATHS: -- try: -+ if os.path.exists(each_path): - file = open(each_path, "r") - content = file.read() - if content.startswith("Red Hat Enterprise Linux"): - return "Red Hat Enterprise Linux" -+ - if content.startswith("Fedora"): - return "Fedora" -+ - i = content.find(" release") - if i > -1: - return content[0:i] -- except: -- pass -+ - return "" - -+def getVersion_fromRPM(): -+ try: -+ import rpm -+ ts = rpm.TransactionSet() -+ for each_dep in SYSTEM_RELEASE_DEPS: -+ mi = ts.dbMatch('provides', each_dep) -+ for h in mi: -+ if h['version']: -+ return str(h['version']) -+ -+ return "" -+ except: -+ return "" -+ - def getVersion_fromFILE(): - for each_path in SYSTEM_RELEASE_PATHS: -- try: -+ if os.path.exists(each_path): - file = open(each_path, "r") - content = file.read() - if content.find("Rawhide") > -1: - return "rawhide" -+ - clist = content.split(" ") - i = clist.index("release") - return clist[i+1] -+ else: -+ return "" -+""" -+ -+def getProduct_fromPRODUCT(): -+ try: -+ from pyanaconda import product -+ return product.productName -+ except: -+ try: -+ import product -+ return product.productName - except: -- pass -- return "" -+ return "" -+ -+def getVersion_fromPRODUCT(): -+ try: -+ from pyanaconda import product -+ return product.productVersion -+ except: -+ try: -+ import product -+ return product.productVersion -+ except: -+ return "" -+ - - def getProduct(): -- ####product = getProduct_fromPRODUCT() -- ####if product: -- #### return product -- product = getProduct_fromFILE() -+ """Attempt to determine the product of the running system by asking anaconda -+ """ -+ product = getProduct_fromPRODUCT() - if product: - return product -- ####product = getProduct_fromRPM() -- ####if product: -- #### return product -+ - return _hardcoded_default_product - - def getVersion(): -- ####version = getVersion_fromPRODUCT() -- ####if version: -- #### return version -- version = getVersion_fromFILE() -+ """Attempt to determine the version of the running system by asking anaconda -+ Always return as a string. -+ """ -+ version = getVersion_fromPRODUCT() - if version: - return version -- ####version = getVersion_fromRPM() -- ####if version: -- #### return version -+ - return _hardcoded_default_version - - def createAlertSignature(component, hashmarkername, hashvalue, summary, alertSignature): -@@ -140,8 +150,16 @@ def createPythonUnhandledExceptionSignature(component, hashmarkername, hashvalue - pd.add("duphash", hashvalue) - pd.add("reason", summary) - pd.add("description", description) -- #pd.add("product", getProduct()) -- #pd.add("version", getVersion()) -+ product = getProduct() -+ if product: -+ pd.add("product", product) -+ version = getVersion() -+ if version: -+ pd.add("version", version) -+ #libreport expect the os_release as in /etc/redhat-release -+ if (version and product): -+ # need to add "release", parse_release() expects format " release " -+ 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 --- -1.7.6 - diff --git a/0005-wizard.glade-glade-generates-class-GtkBox-which-does.patch b/0005-wizard.glade-glade-generates-class-GtkBox-which-does.patch deleted file mode 100644 index 547cc6b..0000000 --- a/0005-wizard.glade-glade-generates-class-GtkBox-which-does.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 94660528f9423f7ef1cfd158627ce4208b01cf59 Mon Sep 17 00:00:00 2001 -From: Denys Vlasenko -Date: Tue, 19 Jul 2011 13:24:57 +0200 -Subject: [PATCH 05/12] wizard.glade: glade generates class="GtkBox" which - doesn't work, -> GtkHBox - -Signed-off-by: Denys Vlasenko ---- - src/gui-wizard-gtk/wizard.glade | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/src/gui-wizard-gtk/wizard.glade b/src/gui-wizard-gtk/wizard.glade -index ba8b09a..787b7f8 100644 ---- a/src/gui-wizard-gtk/wizard.glade -+++ b/src/gui-wizard-gtk/wizard.glade -@@ -686,7 +686,7 @@ - - - -- -+ - True - False - --- -1.7.6 - diff --git a/0006-support-interactive-plugins-in-GUI-and-CLI.patch b/0006-support-interactive-plugins-in-GUI-and-CLI.patch deleted file mode 100644 index 6ee443f..0000000 --- a/0006-support-interactive-plugins-in-GUI-and-CLI.patch +++ /dev/null @@ -1,496 +0,0 @@ -From da506c2b0f396ccb5a3f7c83b8fd976a763dd1ed Mon Sep 17 00:00:00 2001 -From: Michal Toman -Date: Tue, 19 Jul 2011 13:43:15 +0200 -Subject: [PATCH 06/12] support interactive plugins in GUI and CLI - ---- - src/cli/cli-report.c | 19 +----- - src/gui-wizard-gtk/wizard.c | 179 ++++++++++++++++++++++++++++++++++++++++++- - src/include/client.h | 7 ++ - src/include/run_event.h | 1 + - src/lib/client.c | 43 +++++++++-- - src/lib/run_event.c | 72 ++++++++++++++++- - 6 files changed, 288 insertions(+), 33 deletions(-) - -diff --git a/src/cli/cli-report.c b/src/cli/cli-report.c -index 2598a7a..784b37e 100644 ---- a/src/cli/cli-report.c -+++ b/src/cli/cli-report.c -@@ -18,6 +18,7 @@ - #include "internal_libreport.h" - #include "run-command.h" - #include "cli-report.h" -+#include "client.h" - - /* Field separator for the crash report file that is edited by user. */ - #define FIELD_SEP "%----" -@@ -404,24 +405,6 @@ static bool ask_yesno(const char *question) - return 0 == strncmp(answer, yes, strlen(yes)); - } - --/* Returns true if echo has been changed from another state. */ --static bool set_echo(bool enable) --{ -- struct termios t; -- if (tcgetattr(STDIN_FILENO, &t) < 0) -- return false; -- -- /* No change needed? */ -- if ((bool)(t.c_lflag & ECHO) == enable) -- return false; -- -- t.c_lflag ^= ECHO; -- if (tcsetattr(STDIN_FILENO, TCSANOW, &t) < 0) -- perror_msg_and_die("tcsetattr"); -- -- return true; --} -- - /* Returns true if the string contains the specified number. */ - static bool is_number_in_string(unsigned number, const char *str) - { -diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c -index 847e84c..b100c13 100644 ---- a/src/gui-wizard-gtk/wizard.c -+++ b/src/gui-wizard-gtk/wizard.c -@@ -17,6 +17,7 @@ - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - #include -+#include "client.h" - #include "internal_libreport_gtk.h" - #include "wizard.h" - -@@ -1051,14 +1052,186 @@ static gboolean consume_cmd_output(GIOChannel *source, GIOCondition condition, g - - /* Read and insert the output into the log pane */ - char buf[257]; /* usually we get one line, no need to have big buf */ -+ char *msg; /* one line */ -+ char *newline; -+ char *raw; - int r; -- while ((r = read(evd->fd, buf, sizeof(buf)-1)) > 0) -+ struct strbuf *line = strbuf_new(); -+ -+ int alert_prefix_len = strlen(REPORT_PREFIX_ALERT); -+ int ask_prefix_len = strlen(REPORT_PREFIX_ASK); -+ int ask_yes_no_prefix_len = strlen(REPORT_PREFIX_ASK_YES_NO); -+ int ask_password_prefix_len = strlen(REPORT_PREFIX_ASK_PASSWORD); -+ -+ /* read buffered and split lines */ -+ while ((r = read(evd->fd, buf, sizeof(buf) - 1)) > 0) - { - buf[r] = '\0'; -- append_to_textview(evd->tv_log, buf); -- save_to_event_log(evd, buf); -+ raw = buf; -+ -+ /* split lines in the current buffer */ -+ while ((newline = strchr(raw, '\n')) != NULL) -+ { -+ *newline = '\0'; -+ /* finish line */ -+ strbuf_append_str(line, raw); -+ strbuf_append_char(line, '\n'); -+ -+ msg = line->buf; -+ -+ /* alert dialog */ -+ if (strncmp(REPORT_PREFIX_ALERT, msg, alert_prefix_len) == 0) -+ { -+ msg += alert_prefix_len; -+ -+ GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(g_assistant), -+ GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, -+ GTK_MESSAGE_WARNING, -+ GTK_BUTTONS_CLOSE, -+ msg); -+ -+ gtk_dialog_run(GTK_DIALOG(dialog)); -+ gtk_widget_destroy(dialog); -+ } -+ /* ask dialog with textbox */ -+ else if (strncmp(REPORT_PREFIX_ASK, msg, ask_prefix_len) == 0) -+ { -+ msg += ask_prefix_len; -+ -+ GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(g_assistant), -+ GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, -+ GTK_MESSAGE_QUESTION, -+ GTK_BUTTONS_OK_CANCEL, -+ msg); -+ -+ GtkWidget *vbox = gtk_dialog_get_content_area(GTK_DIALOG(dialog)); -+ GtkWidget *textbox = gtk_entry_new(); -+ gtk_entry_set_editable(GTK_ENTRY(textbox), TRUE); -+ gtk_box_pack_start(GTK_BOX(vbox), textbox, TRUE, TRUE, 0); -+ gtk_widget_show(textbox); -+ -+ if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK) -+ { -+ const char *text = gtk_entry_get_text(GTK_ENTRY(textbox)); -+ char *response = xasprintf("%s\n", text); -+ if (write(evd->run_state->command_in_fd, response, strlen(response)) < 0) -+ { -+ free(response); -+ VERB1 perror_msg("Unable to write %s\\n to child's stdin", text); -+ return FALSE; -+ } -+ -+ free(response); -+ } -+ else -+ { -+ if (write(evd->run_state->command_in_fd, "\n", strlen("\n")) < 0) -+ { -+ VERB1 perror_msg("Unable to write \\n to child's stdin"); -+ return FALSE; -+ } -+ } -+ -+ gtk_widget_destroy(textbox); -+ gtk_widget_destroy(dialog); -+ } -+ /* ask dialog with passwordbox */ -+ else if (strncmp(REPORT_PREFIX_ASK_PASSWORD, msg, ask_password_prefix_len) == 0) -+ { -+ msg += ask_password_prefix_len; -+ -+ GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(g_assistant), -+ GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, -+ GTK_MESSAGE_QUESTION, -+ GTK_BUTTONS_OK_CANCEL, -+ msg); -+ -+ GtkWidget *vbox = gtk_dialog_get_content_area(GTK_DIALOG(dialog)); -+ GtkWidget *textbox = gtk_entry_new(); -+ gtk_entry_set_editable(GTK_ENTRY(textbox), TRUE); -+ gtk_entry_set_visibility(GTK_ENTRY(textbox), FALSE); -+ gtk_box_pack_start(GTK_BOX(vbox), textbox, TRUE, TRUE, 0); -+ gtk_widget_show(textbox); -+ -+ if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK) -+ { -+ const char *text = gtk_entry_get_text(GTK_ENTRY(textbox)); -+ char *response = xasprintf("%s\n", text); -+ if (write(evd->run_state->command_in_fd, response, strlen(response)) < 0) -+ { -+ free(response); -+ VERB1 perror_msg("Unable to write %s\\n to child's stdin", text); -+ return FALSE; -+ } -+ -+ free(response); -+ } -+ else -+ { -+ if (write(evd->run_state->command_in_fd, "\n", strlen("\n")) < 0) -+ { -+ VERB1 perror_msg("Unable to write \\n to child's stdin"); -+ return FALSE; -+ } -+ } -+ -+ gtk_widget_destroy(textbox); -+ gtk_widget_destroy(dialog); -+ } -+ /* yes/no dialog */ -+ else if (strncmp(REPORT_PREFIX_ASK_YES_NO, msg, ask_yes_no_prefix_len) == 0) -+ { -+ msg += ask_yes_no_prefix_len; -+ -+ GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(g_assistant), -+ GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, -+ GTK_MESSAGE_QUESTION, -+ GTK_BUTTONS_YES_NO, -+ msg); -+ -+ if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_YES) -+ { -+ char *yes = _("y"); -+ char *response = xasprintf("%s\n", yes); -+ if (write(evd->run_state->command_in_fd, response, strlen(response)) < 0) -+ { -+ free(response); -+ VERB1 perror_msg("Unable to write %s\\n to child's stdin", yes); -+ return FALSE; -+ } -+ -+ free(response); -+ } -+ else -+ { -+ if (write(evd->run_state->command_in_fd, "\n", strlen("\n")) < 0) -+ { -+ VERB1 perror_msg("Unable to write \\n to child's stdin"); -+ return FALSE; -+ } -+ } -+ -+ gtk_widget_destroy(dialog); -+ } -+ /* no special prefix - forward to log */ -+ else -+ { -+ append_to_textview(evd->tv_log, msg); -+ save_to_event_log(evd, msg); -+ } -+ -+ strbuf_clear(line); -+ -+ /* jump to next line */ -+ raw = newline + 1; -+ } -+ -+ /* beginning of next line. the line continues by next read() */ -+ 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)" */ -diff --git a/src/include/client.h b/src/include/client.h -index bbd2f10..8074145 100644 ---- a/src/include/client.h -+++ b/src/include/client.h -@@ -22,18 +22,25 @@ - - #define REPORT_PREFIX_ASK_YES_NO "ASK_YES_NO " - #define REPORT_PREFIX_ASK "ASK " -+#define REPORT_PREFIX_ASK_PASSWORD "ASK_PASSWORD " - #define REPORT_PREFIX_ALERT "ALERT " - - #ifdef __cplusplus - extern "C" { - #endif - -+#define set_echo libreport_set_echo -+int set_echo(int enable); -+ - #define ask_yes_no libreport_ask_yes_no - int ask_yes_no(const char *question); - - #define ask libreport_ask - char *ask(const char *question, char *response, int response_len); - -+#define ask_password libreport_ask_password -+char *ask_password(const char *question, char *response, int response_len); -+ - #define alert libreport_alert - void alert(const char *message); - -diff --git a/src/include/run_event.h b/src/include/run_event.h -index f7ae9ed..43730ce 100644 ---- a/src/include/run_event.h -+++ b/src/include/run_event.h -@@ -44,6 +44,7 @@ struct run_event_state { - GList *rule_list; - pid_t command_pid; - int command_out_fd; -+ int command_in_fd; - }; - struct run_event_state *new_run_event_state(void); - void free_run_event_state(struct run_event_state *state); -diff --git a/src/lib/client.c b/src/lib/client.c -index 88a995b..103828b 100644 ---- a/src/lib/client.c -+++ b/src/lib/client.c -@@ -25,6 +25,24 @@ static int is_slave_mode() - return getenv("REPORT_CLIENT_SLAVE") != NULL; - } - -+/* Returns 1 if echo has been changed from another state. */ -+int set_echo(int enable) -+{ -+ struct termios t; -+ if (tcgetattr(STDIN_FILENO, &t) < 0) -+ return 0; -+ -+ /* No change needed? */ -+ if ((t.c_lflag & ECHO) == enable) -+ return 0; -+ -+ t.c_lflag ^= ECHO; -+ if (tcsetattr(STDIN_FILENO, TCSANOW, &t) < 0) -+ perror_msg_and_die("tcsetattr"); -+ -+ return 1; -+} -+ - int ask_yes_no(const char *question) - { - const char *yes = _("y"); -@@ -32,12 +50,7 @@ int ask_yes_no(const char *question) - - char *env_response = getenv("REPORT_CLIENT_RESPONSE"); - if (env_response) -- { -- if (strncasecmp(yes, env_response, strlen(yes)) == 0) -- return true; -- if (strncasecmp(no, env_response, strlen(no)) == 0) -- return false; -- } -+ return strncasecmp(yes, env_response, strlen(yes)) == 0; - - if (is_slave_mode()) - printf(REPORT_PREFIX_ASK_YES_NO "%s\n", question); -@@ -48,7 +61,7 @@ int ask_yes_no(const char *question) - - char response[16]; - if (NULL == fgets(response, sizeof(response), stdin)) -- return false; -+ return 0; - - return strncasecmp(yes, response, strlen(yes)) == 0; - } -@@ -65,6 +78,22 @@ char *ask(const char *question, char *response, int response_len) - return fgets(response, response_len, stdin); - } - -+char *ask_password(const char *question, char *response, int response_len) -+{ -+ if (is_slave_mode()) -+ printf(REPORT_PREFIX_ASK_PASSWORD "%s\n", question); -+ else -+ printf("%s ", question); -+ -+ fflush(stdout); -+ -+ set_echo(false); -+ char *result = fgets(response, response_len, stdin); -+ set_echo(true); -+ -+ return result; -+} -+ - void alert(const char *message) - { - if (is_slave_mode()) -diff --git a/src/lib/run_event.c b/src/lib/run_event.c -index 0594bde..ba9920c 100644 ---- a/src/lib/run_event.c -+++ b/src/lib/run_event.c -@@ -18,6 +18,7 @@ - */ - #include - #include -+#include "client.h" - #include "internal_libreport.h" - - struct run_event_state *new_run_event_state() -@@ -393,7 +394,7 @@ int spawn_next_command(struct run_event_state *state, - VERB1 log("Executing '%s'", cmd); - - /* Export some useful environment variables for children */ -- char *env_vec[3]; -+ char *env_vec[4]; - /* Just exporting dump_dir_name isn't always ok: it can be "." - * and some children want to cd to other directory but still - * be able to find dump directory by using $DUMP_DIR... -@@ -402,7 +403,8 @@ int spawn_next_command(struct run_event_state *state, - env_vec[0] = xasprintf("DUMP_DIR=%s", (full_name ? full_name : dump_dir_name)); - free(full_name); - env_vec[1] = xasprintf("EVENT=%s", event); -- env_vec[2] = NULL; -+ env_vec[2] = xasprintf("REPORT_CLIENT_SLAVE=1"); -+ env_vec[3] = NULL; - - char *argv[4]; - argv[0] = (char*)"/bin/sh"; // TODO: honor $SHELL? -@@ -412,7 +414,7 @@ int spawn_next_command(struct run_event_state *state, - - int pipefds[2]; - state->command_pid = fork_execv_on_steroids( -- EXECFLG_INPUT_NUL + EXECFLG_OUTPUT + EXECFLG_ERR2OUT, -+ EXECFLG_INPUT + EXECFLG_OUTPUT + EXECFLG_ERR2OUT, - argv, - pipefds, - /* env_vec: */ env_vec, -@@ -420,9 +422,11 @@ int spawn_next_command(struct run_event_state *state, - /* uid(unused): */ 0 - ); - state->command_out_fd = pipefds[0]; -+ state->command_in_fd = pipefds[1]; - - free(env_vec[0]); - free(env_vec[1]); -+ free(env_vec[2]); - free(cmd); - - return 0; -@@ -447,10 +451,68 @@ int run_event_on_dir_name(struct run_event_state *state, - if (!fp) - die_out_of_memory(); - char *buf; -+ char *msg; -+ -+ int alert_prefix_len = strlen(REPORT_PREFIX_ALERT); -+ int ask_prefix_len = strlen(REPORT_PREFIX_ASK); -+ int ask_yes_no_prefix_len = strlen(REPORT_PREFIX_ASK_YES_NO); -+ int ask_password_prefix_len = strlen(REPORT_PREFIX_ASK_PASSWORD); -+ - while ((buf = xmalloc_fgetline(fp)) != NULL) - { -- if (state->logging_callback) -- buf = state->logging_callback(buf, state->logging_param); -+ msg = buf; -+ -+ /* just cut off prefix, no waiting */ -+ if (strncmp(REPORT_PREFIX_ALERT, msg, alert_prefix_len) == 0) -+ { -+ msg += alert_prefix_len; -+ printf("%s\n", msg); -+ fflush(stdout); -+ } -+ /* wait for y/N response on the same line */ -+ else if (strncmp(REPORT_PREFIX_ASK_YES_NO, msg, ask_yes_no_prefix_len) == 0) -+ { -+ msg += ask_yes_no_prefix_len; -+ printf("%s [%s/%s] ", msg, _("y"), _("N")); -+ fflush(stdout); -+ char buf[16]; -+ if (!fgets(buf, sizeof(buf), stdin)) -+ buf[0] = '\0'; -+ -+ if (write(state->command_in_fd, buf, strlen(buf)) < 0) -+ perror_msg_and_die("write"); -+ } -+ /* wait for the string on the same line */ -+ else if (strncmp(REPORT_PREFIX_ASK, msg, ask_prefix_len) == 0) -+ { -+ msg += ask_prefix_len; -+ printf("%s ", msg); -+ fflush(stdout); -+ char buf[256]; -+ if (!fgets(buf, sizeof(buf), stdin)) -+ buf[0] = '\0'; -+ -+ if (write(state->command_in_fd, buf, strlen(buf)) < 0) -+ perror_msg_and_die("write"); -+ } -+ /* set echo off and wait for password on the same line */ -+ else if (strncmp(REPORT_PREFIX_ASK_PASSWORD, msg, ask_password_prefix_len) == 0) -+ { -+ msg += ask_password_prefix_len; -+ printf("%s ", msg); -+ fflush(stdout); -+ char buf[256]; -+ set_echo(false); -+ if (!fgets(buf, sizeof(buf), stdin)) -+ buf[0] = '\0'; -+ set_echo(true); -+ -+ if (write(state->command_in_fd, buf, strlen(buf)) < 0) -+ perror_msg_and_die("write"); -+ } -+ /* no special prefix -> forward to log if applicable */ -+ else if (state->logging_callback) -+ msg = state->logging_callback(msg, state->logging_param); - free(buf); - } - fclose(fp); /* Got EOF, close. This also closes state->command_out_fd */ --- -1.7.6 - diff --git a/0007-wizard-if-more-than-one-reporter-is-chosen-select-al.patch b/0007-wizard-if-more-than-one-reporter-is-chosen-select-al.patch deleted file mode 100644 index d5ac2b1..0000000 --- a/0007-wizard-if-more-than-one-reporter-is-chosen-select-al.patch +++ /dev/null @@ -1,150 +0,0 @@ -From 929176564c779031bec181474364923d6869e30e Mon Sep 17 00:00:00 2001 -From: Denys Vlasenko -Date: Tue, 19 Jul 2011 14:37:41 +0200 -Subject: [PATCH 07/12] wizard: if more than one reporter is chosen, select - all items. Helps with bz#723021 - -Before this change, in such case all items were unselected. - -Signed-off-by: Denys Vlasenko ---- - src/gui-wizard-gtk/wizard.c | 100 +++++++++++++++++++++++------------------- - 1 files changed, 55 insertions(+), 45 deletions(-) - -diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c -index b100c13..3eea380 100644 ---- a/src/gui-wizard-gtk/wizard.c -+++ b/src/gui-wizard-gtk/wizard.c -@@ -1655,74 +1655,84 @@ static void on_page_prepare(GtkAssistant *assistant, GtkWidget *page, gpointer u - /* Based on selected reporter, update item checkboxes */ - event_config_t *cfg = get_event_config(g_reporter_events_selected ? g_reporter_events_selected : ""); - //log("%s: event:'%s', cfg:'%p'", __func__, g_reporter_events_selected, cfg); -+ int allowed_by_reporter = 1; -+ int default_by_reporter = 1; - if (cfg) - { - /* Default settings are... */ -- int allowed_by_reporter = 1; - if (cfg->ec_exclude_items_always && strcmp(cfg->ec_exclude_items_always, "*") == 0) - allowed_by_reporter = 0; -- int default_by_reporter = allowed_by_reporter; -+ default_by_reporter = allowed_by_reporter; - if (cfg->ec_exclude_items_by_default && strcmp(cfg->ec_exclude_items_by_default, "*") == 0) - default_by_reporter = 0; -+ } - -- GHashTableIter iter; -- char *name; -- struct problem_item *item; -- g_hash_table_iter_init(&iter, g_cd); -- while (g_hash_table_iter_next(&iter, (void**)&name, (void**)&item)) -+ GHashTableIter iter; -+ char *name; -+ struct problem_item *item; -+ g_hash_table_iter_init(&iter, g_cd); -+ while (g_hash_table_iter_next(&iter, (void**)&name, (void**)&item)) -+ { -+ /* Decide whether item is allowed, required, and what's the default */ -+ item->allowed_by_reporter = allowed_by_reporter; -+ if (cfg) - { -- /* Decide whether item is allowed, required, and what's the default */ -- item->allowed_by_reporter = allowed_by_reporter; - if (is_in_comma_separated_list(name, cfg->ec_exclude_items_always)) - item->allowed_by_reporter = 0; - if ((item->flags & CD_FLAG_BIN) && cfg->ec_exclude_binary_items) - item->allowed_by_reporter = 0; -+ } - -- item->default_by_reporter = item->allowed_by_reporter ? default_by_reporter : 0; -+ item->default_by_reporter = item->allowed_by_reporter ? default_by_reporter : 0; -+ if (cfg) -+ { - if (is_in_comma_separated_list(name, cfg->ec_exclude_items_by_default)) - item->default_by_reporter = 0; - if (is_in_comma_separated_list(name, cfg->ec_include_items_by_default)) - item->allowed_by_reporter = item->default_by_reporter = 1; -+ } - -- item->required_by_reporter = 0; -+ item->required_by_reporter = 0; -+ if (cfg) -+ { - if (is_in_comma_separated_list(name, cfg->ec_requires_items)) - item->default_by_reporter = item->allowed_by_reporter = item->required_by_reporter = 1; -+ } - -- int cur_value; -- if (item->selected_by_user == 0) -- cur_value = item->default_by_reporter; -- else -- cur_value = !!(item->selected_by_user + 1); /* map -1,1 to 0,1 */ -- -- //log("%s: '%s' allowed:%d reqd:%d def:%d user:%d", __func__, name, -- // item->allowed_by_reporter, -- // item->required_by_reporter, -- // item->default_by_reporter, -- // item->selected_by_user -- //); -- -- /* Find corresponding line and update checkbox */ -- GtkTreeIter iter; -- if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(g_ls_details), &iter)) -- { -- do { -- gchar *item_name = NULL; -- gtk_tree_model_get(GTK_TREE_MODEL(g_ls_details), &iter, -- DETAIL_COLUMN_NAME, &item_name, -- -1); -- if (!item_name) /* paranoia, should never happen */ -- continue; -- int differ = strcmp(name, item_name); -- g_free(item_name); -- if (differ) -- continue; -- gtk_list_store_set(g_ls_details, &iter, -- DETAIL_COLUMN_CHECKBOX, cur_value, -+ int cur_value; -+ if (item->selected_by_user == 0) -+ cur_value = item->default_by_reporter; -+ else -+ cur_value = !!(item->selected_by_user + 1); /* map -1,1 to 0,1 */ -+ -+ //log("%s: '%s' allowed:%d reqd:%d def:%d user:%d", __func__, name, -+ // item->allowed_by_reporter, -+ // item->required_by_reporter, -+ // item->default_by_reporter, -+ // item->selected_by_user -+ //); -+ -+ /* Find corresponding line and update checkbox */ -+ GtkTreeIter iter; -+ if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(g_ls_details), &iter)) -+ { -+ do { -+ gchar *item_name = NULL; -+ gtk_tree_model_get(GTK_TREE_MODEL(g_ls_details), &iter, -+ DETAIL_COLUMN_NAME, &item_name, - -1); -- //log("%s: changed gtk_list_store_set to %d", __func__, (item->allowed_by_reporter && item->selected_by_user >= 0)); -- break; -- } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(g_ls_details), &iter)); -- } -+ if (!item_name) /* paranoia, should never happen */ -+ continue; -+ int differ = strcmp(name, item_name); -+ g_free(item_name); -+ if (differ) -+ continue; -+ gtk_list_store_set(g_ls_details, &iter, -+ DETAIL_COLUMN_CHECKBOX, cur_value, -+ -1); -+ //log("%s: changed gtk_list_store_set to %d", __func__, (item->allowed_by_reporter && item->selected_by_user >= 0)); -+ break; -+ } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(g_ls_details), &iter)); - } - } - } --- -1.7.6 - diff --git a/0008-added-xml-file-for-Logger-event.patch b/0008-added-xml-file-for-Logger-event.patch deleted file mode 100644 index d570e61..0000000 --- a/0008-added-xml-file-for-Logger-event.patch +++ /dev/null @@ -1,84 +0,0 @@ -From ddbdc3f2451e061f57b350379d2daecb65bcd7fc Mon Sep 17 00:00:00 2001 -From: Jiri Moskovcak -Date: Wed, 20 Jul 2011 14:25:34 +0200 -Subject: [PATCH 08/12] added xml file for Logger event - ---- - src/plugins/Makefile.am | 2 ++ - src/plugins/print_event.conf | 2 +- - src/plugins/report_Logger.conf | 4 ++-- - src/plugins/report_Logger.xml.in | 25 +++++++++++++++++++++++++ - 5 files changed, 31 insertions(+), 3 deletions(-) - create mode 100644 src/plugins/report_Logger.xml.in - -diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am -index 4435357..d616ee5 100644 ---- a/src/plugins/Makefile.am -+++ b/src/plugins/Makefile.am -@@ -23,6 +23,7 @@ dist_events_DATA = \ - report_Bugzilla.xml \ - report_Bugzilla.conf \ - report_Logger.conf \ -+ report_Logger.xml \ - report_Mailx.xml \ - report_RHTSupport.xml \ - report_Kerneloops.xml -@@ -62,6 +63,7 @@ EXTRA_DIST = \ - report_Bugzilla.xml.in \ - report_Bugzilla.conf \ - report_Logger.conf \ -+ report_Logger.xml.in \ - report_Mailx.xml.in \ - report_RHTSupport.xml.in \ - report_Kerneloops.xml.in -diff --git a/src/plugins/print_event.conf b/src/plugins/print_event.conf -index 7b94aba..6e6e38e 100644 ---- a/src/plugins/print_event.conf -+++ b/src/plugins/print_event.conf -@@ -1,2 +1,2 @@ - EVENT=report_Logger -- reporter-print -o "${Log_File:-/tmp/abrt.log}" -a "${Append:-no}" -r -+ reporter-print -o "${Logger_Log_File:-/tmp/abrt.log}" -a "${Logger_Append:-no}" -r -diff --git a/src/plugins/report_Logger.conf b/src/plugins/report_Logger.conf -index d885ce5..45f6b5d 100644 ---- a/src/plugins/report_Logger.conf -+++ b/src/plugins/report_Logger.conf -@@ -1,2 +1,2 @@ --Log_File=/tmp/abrt.log --Append=yes -+Logger_Log_File=/tmp/abrt.log -+Logger_Append=yes -diff --git a/src/plugins/report_Logger.xml.in b/src/plugins/report_Logger.xml.in -new file mode 100644 -index 0000000..f7230e0 ---- /dev/null -+++ b/src/plugins/report_Logger.xml.in -@@ -0,0 +1,25 @@ -+ -+ -+ <_name>Logger -+ <_description>Save the report locally -+ -+ -+ coredump -+ -+ no -+ -+ -+ -+ -+ -+ -+ --- -1.7.6 - diff --git a/0009-report-cli-don-t-crash-when-invalid-analyzer-is-sele.patch b/0009-report-cli-don-t-crash-when-invalid-analyzer-is-sele.patch deleted file mode 100644 index d725299..0000000 --- a/0009-report-cli-don-t-crash-when-invalid-analyzer-is-sele.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 68b8aaa4f2c54fbdf9fa3bacfe93c8fcefa35067 Mon Sep 17 00:00:00 2001 -From: Miroslav Lichvar -Date: Wed, 20 Jul 2011 15:53:32 +0200 -Subject: [PATCH 09/12] report-cli: don't crash when invalid analyzer is - selected (trac#294) - ---- - src/cli/cli-report.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/src/cli/cli-report.c b/src/cli/cli-report.c -index 784b37e..6ec7f96 100644 ---- a/src/cli/cli-report.c -+++ b/src/cli/cli-report.c -@@ -620,7 +620,7 @@ char *select_event_option(GList *list_options) - continue; - - picked = xatou(answer); -- if (picked > count) -+ if (picked > count || picked < 1) - { - fprintf(stdout, _("You have chosen number out of range")); - fprintf(stdout, "\n"); --- -1.7.6 - diff --git a/0010-Add-another-reporting-flag-LIBREPORT_GETPID.patch b/0010-Add-another-reporting-flag-LIBREPORT_GETPID.patch deleted file mode 100644 index b8872d0..0000000 --- a/0010-Add-another-reporting-flag-LIBREPORT_GETPID.patch +++ /dev/null @@ -1,94 +0,0 @@ -From 6a69e7ad5186709bd3dbaa8e843a1e16b39bb501 Mon Sep 17 00:00:00 2001 -From: Denys Vlasenko -Date: Thu, 21 Jul 2011 09:51:57 +0200 -Subject: [PATCH 10/12] Add another reporting flag, LIBREPORT_GETPID. - -This flag means "return the pid of reporting process". - -IOW: LIBREPORT_NOWAIT will reparent reporter to init -and return 0, LIBREPORT_NOWAIT | LIBREPORT_GETPID will not, -and will return pid. - -Signed-off-by: Denys Vlasenko ---- - src/include/report.h | 9 ++++++--- - src/lib/report.c | 14 +++++++++++--- - src/report-python/reportmodule.c | 1 + - 3 files changed, 18 insertions(+), 6 deletions(-) - -diff --git a/src/include/report.h b/src/include/report.h -index 18bb20b..410a24d 100644 ---- a/src/include/report.h -+++ b/src/include/report.h -@@ -28,10 +28,13 @@ extern "C" { - enum { - LIBREPORT_NOWAIT = 0, - LIBREPORT_WAIT = (1 << 0), /* wait for report to finish and reload the problem data */ -- LIBREPORT_ANALYZE = (1 << 1), /* run analyzers? */ -+ LIBREPORT_GETPID = (1 << 1), /* return pid of child. Use with LIBREPORT_NOWAIT. */ -+ /* Note: without LIBREPORT_GETPID, child will be detached */ -+ /* (reparented to init) */ -+ LIBREPORT_ANALYZE = (1 << 2), /* run analyzers? */ - /* ("run reporters" is always on, has no flag (for now?)) */ -- LIBREPORT_RELOAD_DATA = (1 << 3), /* reload problem data after run (needs WAIT) */ -- LIBREPORT_DEL_DIR = (1 << 4), /* delete directory after reporting */ -+ LIBREPORT_RELOAD_DATA = (1 << 5), /* reload problem data after run (needs WAIT) */ -+ LIBREPORT_DEL_DIR = (1 << 6), /* delete directory after reporting */ - }; - - int report_problem_in_dir(const char *dirname, int flags); -diff --git a/src/lib/report.c b/src/lib/report.c -index aaf5326..3c365ae 100644 ---- a/src/lib/report.c -+++ b/src/lib/report.c -@@ -74,9 +74,10 @@ int report_problem_in_dir(const char *dirname, int flags) - */ - signal(SIGCHLD, SIG_DFL); - -- if (!(flags & LIBREPORT_WAIT)) -+ if (!(flags & (LIBREPORT_WAIT | LIBREPORT_GETPID))) - { -- /* Caller doesn't want to wait for completion. -+ /* Caller doesn't want to wait for completion (!LIBREPORT_WAIT), -+ * and doesn't want to have pid returned (!LIBREPORT_GETPID). - * Create a grandchild, and then exit. - * This reparents grandchild to init, and makes waitpid - * in parent detect our exit and return almost immediately. -@@ -120,6 +121,13 @@ int report_problem_in_dir(const char *dirname, int flags) - } - - /* parent */ -+ if (!(flags & LIBREPORT_WAIT) && (flags & LIBREPORT_GETPID)) -+ return pid; -+ -+ /* we are here either if LIBREPORT_WAIT (caller wants exitcode) -+ * or !LIBREPORT_GETPID (caller doesn't want to have a child). -+ * In both cases, we need to wait for child: -+ */ - int status; - do - pid = waitpid(pid, &status, 0); -@@ -150,7 +158,7 @@ int report_problem_in_memory(problem_data_t *pd, int flags) - dd_close(dd); - VERB2 log("Temp problem dir: '%s'", dir_name); - -- if (!(flags & LIBREPORT_WAIT)) -+ if (flags & LIBREPORT_NOWAIT) - flags |= LIBREPORT_DEL_DIR; - result = report_problem_in_dir(dir_name, flags); - -diff --git a/src/report-python/reportmodule.c b/src/report-python/reportmodule.c -index 3d802f9..b99ed49 100644 ---- a/src/report-python/reportmodule.c -+++ b/src/report-python/reportmodule.c -@@ -90,6 +90,7 @@ init_pyreport(void) - /* for include/report/report.h */ - PyModule_AddObject(m, "LIBREPORT_NOWAIT" , Py_BuildValue("i", LIBREPORT_NOWAIT )); - PyModule_AddObject(m, "LIBREPORT_WAIT" , Py_BuildValue("i", LIBREPORT_WAIT )); -+ PyModule_AddObject(m, "LIBREPORT_GETPID" , Py_BuildValue("i", LIBREPORT_GETPID )); - PyModule_AddObject(m, "LIBREPORT_ANALYZE" , Py_BuildValue("i", LIBREPORT_ANALYZE )); - PyModule_AddObject(m, "LIBREPORT_RELOAD_DATA", Py_BuildValue("i", LIBREPORT_RELOAD_DATA)); - PyModule_AddObject(m, "LIBREPORT_DEL_DIR" , Py_BuildValue("i", LIBREPORT_DEL_DIR )); --- -1.7.6 - diff --git a/0011-add-python-bindings-for-interactive-plugins.patch b/0011-add-python-bindings-for-interactive-plugins.patch deleted file mode 100644 index 9059841..0000000 --- a/0011-add-python-bindings-for-interactive-plugins.patch +++ /dev/null @@ -1,268 +0,0 @@ -From 02e0e56b5903f5f0e905f20be8413914ab6aa529 Mon Sep 17 00:00:00 2001 -From: Michal Toman -Date: Thu, 21 Jul 2011 14:25:32 +0200 -Subject: [PATCH 11/12] add python bindings for interactive plugins - ---- - configure.ac | 1 + - src/Makefile.am | 2 +- - src/client-python/Makefile.am | 29 +++++++++++++ - src/client-python/__init__.py | 15 +++++++ - src/client-python/client.c | 83 ++++++++++++++++++++++++++++++++++++++ - src/client-python/clientmodule.c | 42 +++++++++++++++++++ - src/client-python/common.h | 27 ++++++++++++ - 8 files changed, 199 insertions(+), 1 deletions(-) - create mode 100644 src/client-python/Makefile.am - create mode 100644 src/client-python/__init__.py - create mode 100644 src/client-python/client.c - create mode 100644 src/client-python/clientmodule.c - create mode 100644 src/client-python/common.h - -diff --git a/configure.ac b/configure.ac -index 61f16ae..4b01af6 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -126,6 +126,7 @@ AC_CONFIG_FILES([ - src/cli/Makefile - src/report-newt/Makefile - src/plugins/Makefile -+ src/client-python/Makefile - po/Makefile.in - ]) - -diff --git a/src/Makefile.am b/src/Makefile.am -index 24dfeb2..3a6da3f 100644 ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -1 +1 @@ --SUBDIRS = include lib plugins report-python gtk-helpers gui-wizard-gtk cli report-newt -+SUBDIRS = include lib plugins report-python gtk-helpers gui-wizard-gtk cli report-newt client-python -diff --git a/src/client-python/Makefile.am b/src/client-python/Makefile.am -new file mode 100644 -index 0000000..5a2a58f ---- /dev/null -+++ b/src/client-python/Makefile.am -@@ -0,0 +1,29 @@ -+clientexecdir = $(pyexecdir)/reportclient -+ -+clientexec_PYTHON = \ -+ __init__.py -+ -+clientexec_LTLIBRARIES = _reportclient.la -+ -+_reportclient_la_SOURCES = \ -+ clientmodule.c \ -+ client.c \ -+ common.h -+_reportclient_la_CPPFLAGS = \ -+ -I$(srcdir)/../include/report -I$(srcdir)/../include \ -+ -DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" \ -+ -DPLUGINS_LIB_DIR=\"$(PLUGINS_LIB_DIR)\" \ -+ -DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \ -+ -DLOCALSTATEDIR='"$(localstatedir)"' \ -+ -DCONF_DIR=\"$(CONF_DIR)\" \ -+ -DVAR_RUN=\"$(VAR_RUN)\" \ -+ $(GLIB_CFLAGS) \ -+ $(PYTHON_CFLAGS) \ -+ -D_GNU_SOURCE \ -+ -Wall -Wwrite-strings -Werror -+_reportclient_la_LDFLAGS = \ -+ -module \ -+ -avoid-version \ -+ -export-symbols-regex init_reportclient -+_reportclient_la_LIBADD = \ -+ ../lib/libreport.la -diff --git a/src/client-python/__init__.py b/src/client-python/__init__.py -new file mode 100644 -index 0000000..6114b5a ---- /dev/null -+++ b/src/client-python/__init__.py -@@ -0,0 +1,15 @@ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -+ -+from _reportclient import * -diff --git a/src/client-python/client.c b/src/client-python/client.c -new file mode 100644 -index 0000000..7177ae3 ---- /dev/null -+++ b/src/client-python/client.c -@@ -0,0 +1,83 @@ -+/* -+ Copyright (C) 2010 Abrt team. -+ Copyright (C) 2010 RedHat inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License along -+ with this program; if not, write to the Free Software Foundation, Inc., -+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -+*/ -+#include -+ -+#include "common.h" -+ -+/* C: void alert(const char *message); */ -+PyObject *p_alert(PyObject *pself, PyObject *args) -+{ -+ const char *message; -+ if (!PyArg_ParseTuple(args, "s", &message)) -+ { -+ return NULL; -+ } -+ alert(message); -+ Py_RETURN_NONE; -+} -+ -+/* C: char *ask(const char *question, char *response, int response_len); */ -+PyObject *p_ask(PyObject *pself, PyObject *args) -+{ -+ const char *question; -+ if (!PyArg_ParseTuple(args, "s", &question)) -+ { -+ return NULL; -+ } -+ -+ char response[256]; -+ if (!ask(question, response, sizeof(response))) -+ { -+ Py_RETURN_NONE; -+ } -+ -+ return Py_BuildValue("s", response); -+} -+ -+/* C: char *ask_password(const char *question, char *response, int response_len); */ -+PyObject *p_ask_password(PyObject *pself, PyObject *args) -+{ -+ const char *question; -+ if (!PyArg_ParseTuple(args, "s", &question)) -+ { -+ return NULL; -+ } -+ -+ char response[256]; -+ if (!ask_password(question, response, sizeof(response))) -+ { -+ Py_RETURN_NONE; -+ } -+ -+ return Py_BuildValue("s", response); -+} -+ -+/* C: int ask_yes_no(const char *question); */ -+PyObject *p_ask_yes_no(PyObject *pself, PyObject *args) -+{ -+ const char *question; -+ if (!PyArg_ParseTuple(args, "s", &question)) -+ { -+ return NULL; -+ } -+ -+ int response = ask_yes_no(question); -+ -+ return Py_BuildValue("i", response); -+} -diff --git a/src/client-python/clientmodule.c b/src/client-python/clientmodule.c -new file mode 100644 -index 0000000..e4584dd ---- /dev/null -+++ b/src/client-python/clientmodule.c -@@ -0,0 +1,42 @@ -+/* -+ Copyright (C) 2010 Abrt team. -+ Copyright (C) 2010 RedHat inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License along -+ with this program; if not, write to the Free Software Foundation, Inc., -+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -+*/ -+#include -+ -+#include "common.h" -+ -+static PyMethodDef module_methods[] = { -+ /* method_name, func, flags, doc_string */ -+ /* for include/client.h */ -+ { "alert" , p_alert , METH_VARARGS }, -+ { "ask" , p_ask , METH_VARARGS }, -+ { "ask_password" , p_ask_password , METH_VARARGS }, -+ { "ask_yes_no" , p_ask_yes_no , METH_VARARGS }, -+ { NULL } -+}; -+ -+#ifndef PyMODINIT_FUNC /* declarations for DLL import/export */ -+#define PyMODINIT_FUNC void -+#endif -+PyMODINIT_FUNC -+init_reportclient(void) -+{ -+ PyObject *m = Py_InitModule("_reportclient", module_methods); -+ if (!m) -+ printf("m == NULL\n"); -+} -diff --git a/src/client-python/common.h b/src/client-python/common.h -new file mode 100644 -index 0000000..02f685f ---- /dev/null -+++ b/src/client-python/common.h -@@ -0,0 +1,27 @@ -+/* -+ Copyright (C) 2009 Abrt team. -+ Copyright (C) 2009 RedHat inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License along -+ with this program; if not, write to the Free Software Foundation, Inc., -+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -+*/ -+#include -+ -+#include "client.h" -+/* module-level functions */ -+/* for include/client.h */ -+PyObject *p_alert(PyObject *pself, PyObject *args); -+PyObject *p_ask(PyObject *pself, PyObject *args); -+PyObject *p_ask_password(PyObject *pself, PyObject *args); -+PyObject *p_ask_yes_no(PyObject *pself, PyObject *args); --- -1.7.6 - diff --git a/0012-run_event_on_dir-fix-double-free.patch b/0012-run_event_on_dir-fix-double-free.patch deleted file mode 100644 index 8277113..0000000 --- a/0012-run_event_on_dir-fix-double-free.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 3ad62d790e546d18d6970e8b49f6f7e0d689c01d Mon Sep 17 00:00:00 2001 -From: Martin Milata -Date: Thu, 21 Jul 2011 15:01:07 +0200 -Subject: [PATCH 12/12] run_event_on_dir: fix double free - -Run_event_on_dir freed the message buffer even if the logging callback -took ownership (like do_log_and_save_line does). Fix that. ---- - src/lib/run_event.c | 6 ++++-- - 1 files changed, 4 insertions(+), 2 deletions(-) - -diff --git a/src/lib/run_event.c b/src/lib/run_event.c -index ba9920c..77d2819 100644 ---- a/src/lib/run_event.c -+++ b/src/lib/run_event.c -@@ -510,9 +510,11 @@ int run_event_on_dir_name(struct run_event_state *state, - if (write(state->command_in_fd, buf, strlen(buf)) < 0) - perror_msg_and_die("write"); - } -- /* no special prefix -> forward to log if applicable */ -+ /* no special prefix -> forward to log if applicable -+ * note that callback may take ownership of buf by returning NULL */ - else if (state->logging_callback) -- msg = state->logging_callback(msg, state->logging_param); -+ buf = state->logging_callback(buf, state->logging_param); -+ - free(buf); - } - fclose(fp); /* Got EOF, close. This also closes state->command_out_fd */ --- -1.7.6 - diff --git a/0015-honor-minimal-rating.patch b/0015-honor-minimal-rating.patch deleted file mode 100644 index 6497662..0000000 --- a/0015-honor-minimal-rating.patch +++ /dev/null @@ -1,139 +0,0 @@ -From 4625b41eb61eb32dd5ddfd59f0b1e6c4e0c351b7 Mon Sep 17 00:00:00 2001 -From: Nikola Pajkovsky -Date: Fri, 22 Jul 2011 13:57:10 +0200 -Subject: [PATCH 15/26] honor minimal rating - -Signed-off-by: Nikola Pajkovsky ---- - 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/0017-interactive-plugins-do-not-truncate-message-on-EAGAI.patch b/0017-interactive-plugins-do-not-truncate-message-on-EAGAI.patch deleted file mode 100644 index 9539e1a..0000000 --- a/0017-interactive-plugins-do-not-truncate-message-on-EAGAI.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 6aab2606ce1bcbdfc2198eafa08afc22597768cf Mon Sep 17 00:00:00 2001 -From: Michal Toman -Date: Mon, 1 Aug 2011 16:11:51 +0200 -Subject: [PATCH 17/52] interactive plugins: do not truncate message on EAGAIN - ---- - src/gui-wizard-gtk/wizard.c | 10 +++++++--- - 1 files changed, 7 insertions(+), 3 deletions(-) - -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); - --- -1.7.6 - diff --git a/0018-report-cli-sync-man-page-with-actual-switches.patch b/0018-report-cli-sync-man-page-with-actual-switches.patch deleted file mode 100644 index 0b45c86..0000000 --- a/0018-report-cli-sync-man-page-with-actual-switches.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 73f3e237baedb448778e6a56a06102df6deee921 Mon Sep 17 00:00:00 2001 -From: Martin Milata -Date: Mon, 1 Aug 2011 15:14:14 +0200 -Subject: [PATCH 18/52] report-cli: sync man page with actual switches - ---- - src/cli/report-cli.txt | 27 +++++++-------------------- - 1 files changed, 7 insertions(+), 20 deletions(-) - -diff --git a/src/cli/report-cli.txt b/src/cli/report-cli.txt -index 7ee1170..30bbfa2 100644 ---- a/src/cli/report-cli.txt -+++ b/src/cli/report-cli.txt -@@ -7,19 +7,15 @@ report-cli - Work with ABRT dump directories from command line. - - SYNOPSIS - -------- --'report-cli' [-vsp] -l[f] [-D BASE_DIR]... -- --'report-cli' [-vsp] -i[f] DUMP_DIR -- - 'report-cli' [-vsp] -L[PREFIX] [DUMP_DIR] - - 'report-cli' [-vsp] -e EVENT DUMP_DIR - - 'report-cli' [-vsp] -a[y] DUMP_DIR - --'report-cli' [-vsp] -r[y|o] DUMP_DIR -+'report-cli' [-vsp] -c[y] DUMP_DIR - --'report-cli' [-vsp] -d DUMP_DIR -+'report-cli' [-vsp] -r[y|o|d] DUMP_DIR - - DESCRIPTION - ----------- -@@ -29,15 +25,6 @@ It enables access to, manipulation of problem data, and reporting. - - OPTIONS - ------- ---l:: -- List not yet reported problems, or all problems with -f -- ---D BASE_DIR:: -- Directory to list problems from (default: -D $HOME/.abrt/spool -D /var/spool/abrt) -- ---i, --info:: -- Print information about DUMP_DIR (detailed with -f) -- - -L[PREFIX]:: - List possible events [which start with PREFIX] - -@@ -47,14 +34,14 @@ OPTIONS - -a, --analyze:: - Run analyze event(s) on DUMP_DIR - -+-c, --collect:: -+ Run collect event(s) on DUMP_DIR -+ - -r, --report:: -- Analyze and report problem data in DUMP_DIR -+ Analyze, collect and report problem data in DUMP_DIR - - -d, --delete:: -- Remove DUMP_DIR -- ---f, --full:: -- Full listing -+ Remove DUMP_DIR after reporting - - -y, --always:: - Noninteractive: don't ask questions, assume positive answer to all of them --- -1.7.6 - diff --git a/0019-compare-problem-data-by-content-of-file-FILENAME_.patch b/0019-compare-problem-data-by-content-of-file-FILENAME_.patch deleted file mode 100644 index b28fa6d..0000000 --- a/0019-compare-problem-data-by-content-of-file-FILENAME_.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 6b208e8762e2ec07ed4ad2fb5a80a4acf53a005a Mon Sep 17 00:00:00 2001 -From: Nikola Pajkovsky -Date: Wed, 27 Jul 2011 16:10:56 +0200 -Subject: [PATCH 19/52] compare problem data by content of file (FILENAME_*) - -Signed-off-by: Nikola Pajkovsky ---- - src/include/internal_libreport.h | 4 ++++ - src/lib/problem_data.c | 20 ++++++++++++++++++++ - 2 files changed, 24 insertions(+), 0 deletions(-) - -diff --git a/src/include/internal_libreport.h b/src/include/internal_libreport.h -index 1959d40..6538edb 100644 ---- a/src/include/internal_libreport.h -+++ b/src/include/internal_libreport.h -@@ -637,6 +637,10 @@ GList *kernel_tainted_long(unsigned tainted); - - // Not stored as files, added "on the fly": - #define CD_DUMPDIR "Directory" -+ -+#define cmp_problem_data libreport_cmp_problem_data -+gint cmp_problem_data(gconstpointer a, gconstpointer b, gpointer filename); -+ - //UNUSED: - //// "Which events are possible (make sense) on this dump dir?" - //// (a string with "\n" terminated event names) -diff --git a/src/lib/problem_data.c b/src/lib/problem_data.c -index 0878b88..cee9527 100644 ---- a/src/lib/problem_data.c -+++ b/src/lib/problem_data.c -@@ -459,3 +459,23 @@ void log_problem_data(problem_data_t *problem_data, const char *pfx) - ); - } - } -+ -+gint cmp_problem_data(gconstpointer a, gconstpointer b, gpointer filename) -+{ -+ problem_data_t *a_data = (problem_data_t *) a; -+ const char *a_time_str = get_problem_item_content_or_NULL(a_data, filename); -+ unsigned long a_time= strtoul(a_time_str, NULL, 10); -+ -+ problem_data_t *b_data = (problem_data_t *) b; -+ const char *b_time_str = get_problem_item_content_or_NULL(b_data, filename); -+ unsigned long b_time= strtoul(b_time_str, NULL, 10); -+ -+ /* newer first */ -+ if (a_time > b_time) -+ return -1; -+ -+ if (a_time == b_time) -+ return 0; -+ -+ return 1; -+} --- -1.7.6 - diff --git a/0021-fix-wrong-casting.patch b/0021-fix-wrong-casting.patch deleted file mode 100644 index 3754cf1..0000000 --- a/0021-fix-wrong-casting.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 153c540b9a6d7d09f6d570a0e65fd4f328e9a3b2 Mon Sep 17 00:00:00 2001 -From: Nikola Pajkovsky -Date: Tue, 2 Aug 2011 11:26:10 +0200 -Subject: [PATCH 21/52] fix wrong casting - -Signed-off-by: Nikola Pajkovsky ---- - src/lib/problem_data.c | 4 ++-- - 1 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/lib/problem_data.c b/src/lib/problem_data.c -index cee9527..7ff1d59 100644 ---- a/src/lib/problem_data.c -+++ b/src/lib/problem_data.c -@@ -462,11 +462,11 @@ void log_problem_data(problem_data_t *problem_data, const char *pfx) - - gint cmp_problem_data(gconstpointer a, gconstpointer b, gpointer filename) - { -- problem_data_t *a_data = (problem_data_t *) a; -+ problem_data_t *a_data = *(problem_data_t **) a; - const char *a_time_str = get_problem_item_content_or_NULL(a_data, filename); - unsigned long a_time= strtoul(a_time_str, NULL, 10); - -- problem_data_t *b_data = (problem_data_t *) b; -+ problem_data_t *b_data = *(problem_data_t **) b; - const char *b_time_str = get_problem_item_content_or_NULL(b_data, filename); - unsigned long b_time= strtoul(b_time_str, NULL, 10); - --- -1.7.6 - diff --git a/0024-wizard-rename-Configure-Event-Preferences.patch b/0024-wizard-rename-Configure-Event-Preferences.patch deleted file mode 100644 index 320594a..0000000 --- a/0024-wizard-rename-Configure-Event-Preferences.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 0a71181b81a5ba2e24dd812b998fc36cf2a31c79 Mon Sep 17 00:00:00 2001 -From: Jiri Moskovcak -Date: Wed, 3 Aug 2011 15:18:39 +0200 -Subject: [PATCH 07/13] wizard: rename Configure Event -> Preferences, - -- users don't know what Events are, so preferences sounds more user friendly ---- - src/gui-wizard-gtk/wizard.glade | 9 ++++++--- - 1 files changed, 6 insertions(+), 3 deletions(-) - -diff --git a/src/gui-wizard-gtk/wizard.glade b/src/gui-wizard-gtk/wizard.glade -index c57b13d..076de96 100644 ---- a/src/gui-wizard-gtk/wizard.glade -+++ b/src/gui-wizard-gtk/wizard.glade -@@ -210,12 +210,13 @@ - False - - -- Configure _Events -+ gtk-preferences - True - True - True - False - True -+ True - right - - -@@ -466,12 +468,13 @@ - False - - -- Configure _Events -+ gtk-preferences - True - True - True - False - True -+ True - right - - --- -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 deleted file mode 100644 index 7df1305..0000000 --- a/0025-added-minimal-rating-entry-to-all-event-xml-files.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 4bcab27c3aec24b7df68996155dc32b4de7a93d1 Mon Sep 17 00:00:00 2001 -From: Jiri Moskovcak -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 @@ - * - yes - -+ 0 - - -