From 3e3a85ccb0fe39353ff7310c759310facc0ecf2b Mon Sep 17 00:00:00 2001 From: Jakub Filak Date: Tue, 9 Sep 2014 12:44:45 +0200 Subject: [PATCH] Fix a bug preventing users from repoting multiple problems at once Resolves: #1134407 --- 0035-testsuite-add-test-not-reportable.patch | 59 ++++++++++++++ ...make_description-show-not-reportable.patch | 79 +++++++++++++++++++ ...e-report-gtk-s-application-nonunique.patch | 28 +++++++ libreport.spec | 9 ++- 4 files changed, 174 insertions(+), 1 deletion(-) create mode 100644 0035-testsuite-add-test-not-reportable.patch create mode 100644 0036-lib-make_description-show-not-reportable.patch create mode 100644 0037-wizard-make-report-gtk-s-application-nonunique.patch diff --git a/0035-testsuite-add-test-not-reportable.patch b/0035-testsuite-add-test-not-reportable.patch new file mode 100644 index 0000000..fae2f11 --- /dev/null +++ b/0035-testsuite-add-test-not-reportable.patch @@ -0,0 +1,59 @@ +From 05453bdb8715f69bf026c9bd06ae8c537fb744c0 Mon Sep 17 00:00:00 2001 +From: Matej Habrnal +Date: Thu, 4 Sep 2014 05:19:41 -0400 +Subject: [PATCH 35/37] testsuite: add test not-reportable + +Testing make_description to print not-reportable. +--- + tests/make_description.at | 38 ++++++++++++++++++++++++++++++++++++++ + 1 file changed, 38 insertions(+) + +diff --git a/tests/make_description.at b/tests/make_description.at +index 87c1fd4..7415cf8 100644 +--- a/tests/make_description.at ++++ b/tests/make_description.at +@@ -188,3 +188,41 @@ int main(int argc, char **argv) + return 0; + } + ]]) ++ ++## -------------- ## ++## not_reportable ## ++## -------------- ## ++ ++AT_TESTFUN([not_reportable], ++[[ ++ ++#include "internal_libreport.h" ++#include ++int main(int argc, char **argv) ++{ ++ g_verbose = 3; ++ ++ problem_data_t *pd = problem_data_new(); ++ ++ problem_data_add_text_noteditable(pd, FILENAME_NOT_REPORTABLE, "not-reportable"); ++ ++ char *description = make_description(pd, /*skipped names*/NULL, CD_MAX_TEXT_SIZE, ++ MAKEDESC_SHOW_URLS); ++ ++ char *expected = xasprintf("%s: %*s%s\n", ++ "Reported", 14 - strlen("Reported"), "", "cannot be reported"); ++ ++ if (strstr(description, expected) == NULL) ++ { ++ printf("E:\n'%s'\n\nC:\n'%s'\n", expected, description); ++ assert(!"The description for not-reportable do not matches the expected description"); ++ } ++ ++ free(description); ++ free(expected); ++ problem_data_free(pd); ++ ++ return 0; ++} ++ ++]]) +-- +2.1.0 + diff --git a/0036-lib-make_description-show-not-reportable.patch b/0036-lib-make_description-show-not-reportable.patch new file mode 100644 index 0000000..2d2e49e --- /dev/null +++ b/0036-lib-make_description-show-not-reportable.patch @@ -0,0 +1,79 @@ +From 4f1646b26b967d0d4d9b93cf15fe71e31dd511b0 Mon Sep 17 00:00:00 2001 +From: Matej Habrnal +Date: Thu, 4 Sep 2014 05:27:42 -0400 +Subject: [PATCH 36/37] lib: make_description show not-reportable + +When the flag from desc_flags is set to MAKEDESC_SHOW_URLS and problem is +not-reportable. The abrt-cli shows not-reportable in listing. + +Related: rhbz#1066520 +--- + src/lib/make_descr.c | 45 +++++++++++++++++++++++++-------------------- + 1 file changed, 25 insertions(+), 20 deletions(-) + +diff --git a/src/lib/make_descr.c b/src/lib/make_descr.c +index d183ac1..7f5c10b 100644 +--- a/src/lib/make_descr.c ++++ b/src/lib/make_descr.c +@@ -101,33 +101,38 @@ char *make_description(problem_data_t *problem_data, char **names_to_skip, + + if (desc_flags & MAKEDESC_SHOW_URLS) + { +- const char *reported_to = problem_data_get_content_or_NULL(problem_data, FILENAME_REPORTED_TO); +- if (reported_to != NULL) ++ if (problem_data_get_content_or_NULL(problem_data, FILENAME_NOT_REPORTABLE) != NULL) ++ strbuf_append_strf(buf_dsc, "%s%*s%s\n", _("Reported:"), 16 - strlen(_("Reported:")), "" , _("cannot be reported")); ++ else + { +- GList *reports = read_entire_reported_to_data(reported_to); +- +- /* The value part begins on 17th column */ +- /* 0123456789ABCDEF*/ +- const char *pad_prefix = " "; +- char *first_prefix = xasprintf("%s%*s", _("Reported:"), 16 - strlen(_("Reported:")), ""); +- const char *prefix = first_prefix; +- for (GList *iter = reports; iter != NULL; iter = g_list_next(iter)) ++ const char *reported_to = problem_data_get_content_or_NULL(problem_data, FILENAME_REPORTED_TO); ++ if (reported_to != NULL) + { +- const report_result_t *const report = (report_result_t *)iter->data; ++ GList *reports = read_entire_reported_to_data(reported_to); ++ ++ /* The value part begins on 17th column */ ++ /* 0123456789ABCDEF*/ ++ const char *pad_prefix = " "; ++ char *first_prefix = xasprintf("%s%*s", _("Reported:"), 16 - strlen(_("Reported:")), ""); ++ const char *prefix = first_prefix; ++ for (GList *iter = reports; iter != NULL; iter = g_list_next(iter)) ++ { ++ const report_result_t *const report = (report_result_t *)iter->data; + +- if (report->url == NULL) +- continue; ++ if (report->url == NULL) ++ continue; + +- strbuf_append_strf(buf_dsc, "%s%s\n", prefix, report->url); ++ strbuf_append_strf(buf_dsc, "%s%s\n", prefix, report->url); + +- if (prefix == first_prefix) +- { /* Only the first URL is prefixed by 'Reported:' */ +- empty = false; +- prefix = pad_prefix; ++ if (prefix == first_prefix) ++ { /* Only the first URL is prefixed by 'Reported:' */ ++ empty = false; ++ prefix = pad_prefix; ++ } + } ++ free(first_prefix); ++ g_list_free_full(reports, (GDestroyNotify)free_report_result); + } +- free(first_prefix); +- g_list_free_full(reports, (GDestroyNotify)free_report_result); + } + } + +-- +2.1.0 + diff --git a/0037-wizard-make-report-gtk-s-application-nonunique.patch b/0037-wizard-make-report-gtk-s-application-nonunique.patch new file mode 100644 index 0000000..473953e --- /dev/null +++ b/0037-wizard-make-report-gtk-s-application-nonunique.patch @@ -0,0 +1,28 @@ +From e457344b79f872294338b7ec3006709a2d9f806a Mon Sep 17 00:00:00 2001 +From: Jakub Filak +Date: Tue, 9 Sep 2014 10:55:43 +0200 +Subject: [PATCH 37/37] wizard: make report-gtk's application nonunique + +Resolves: rhbz#1135782 + +Signed-off-by: Jakub Filak +--- + src/gui-wizard-gtk/main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/gui-wizard-gtk/main.c b/src/gui-wizard-gtk/main.c +index 697b91f..44918ec 100644 +--- a/src/gui-wizard-gtk/main.c ++++ b/src/gui-wizard-gtk/main.c +@@ -216,7 +216,7 @@ int main(int argc, char **argv) + problem_data_reload_from_dump_dir(); + + g_custom_logger = &show_error_as_msgbox; +- GtkApplication *app = gtk_application_new("org.freedesktop.libreport.report", G_APPLICATION_FLAGS_NONE); ++ GtkApplication *app = gtk_application_new("org.freedesktop.libreport.report", G_APPLICATION_NON_UNIQUE); + g_signal_connect(app, "activate", G_CALLBACK(activate_wizard), (gpointer)expert_mode); + g_signal_connect(app, "startup", G_CALLBACK(startup_wizard), NULL); + /* Enter main loop */ +-- +2.1.0 + diff --git a/libreport.spec b/libreport.spec index 870bb64..79e7a95 100644 --- a/libreport.spec +++ b/libreport.spec @@ -7,7 +7,7 @@ Summary: Generic library for reporting various problems Name: libreport Version: 2.2.3 -Release: 6%{?dist} +Release: 7%{?dist} License: GPLv2+ Group: System Environment/Libraries URL: https://fedorahosted.org/abrt/ @@ -48,6 +48,9 @@ Patch31: 0031-wizard-Next-button-insensitive-on-the-review-page-by.patch Patch32: 0032-report-parse-release-version-from-os-release.patch Patch33: 0033-testsuite-report-python-sanity-tests.patch Patch34: 0034-testsuite-work-around-the-issue-with-report-python.patch +Patch35: 0035-testsuite-add-test-not-reportable.patch +Patch36: 0036-lib-make_description-show-not-reportable.patch +Patch37: 0037-wizard-make-report-gtk-s-application-nonunique.patch # git is need for '%%autosetup -S git' which automatically applies all the # patches above. Please, be aware that the patches must be generated @@ -691,6 +694,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %changelog +* Tue Sep 09 2014 Jakub Filak 2.2.3-7 +- reporting GUI: allow users to run it multiple times +- Resolves: #1134407 + * Mon Sep 01 2014 Jakub Filak 2.2.3-6 - add "Details" button on the screen with comment - terminate reporting after the emergency analysis