doczkal / rpms / abrt

Forked from rpms/abrt 4 years ago
Clone

Blame SOURCES/0266-cli-print-out-the-not-reportable-reason.patch

a60cd7
From 9ec8e5c529b06ccbd1e1c4888118fd278ef4393b Mon Sep 17 00:00:00 2001
a60cd7
From: Jakub Filak <jfilak@redhat.com>
a60cd7
Date: Thu, 24 Nov 2016 09:06:09 +0100
a60cd7
Subject: [PATCH] cli: print out the not-reportable reason
a60cd7
a60cd7
But only in verbose mode. Users might be wondering why the problem is
a60cd7
not reportable. Users will intuitively try to run the command in verbose
a60cd7
mode to find out why the problem is not reportable.
a60cd7
a60cd7
Related to #1257159
a60cd7
a60cd7
Signed-off-by: Jakub Filak <jfilak@redhat.com>
a60cd7
---
a60cd7
 src/cli/report.c | 9 ++++++++-
a60cd7
 1 file changed, 8 insertions(+), 1 deletion(-)
a60cd7
a60cd7
diff --git a/src/cli/report.c b/src/cli/report.c
a60cd7
index efdca2d..a76923f 100644
a60cd7
--- a/src/cli/report.c
a60cd7
+++ b/src/cli/report.c
a60cd7
@@ -36,12 +36,19 @@ int _cmd_report(const char **dirs_strv, int flags)
a60cd7
             continue;
a60cd7
         }
a60cd7
 
a60cd7
-
a60cd7
         const int not_reportable = test_exist_over_dbus(real_problem_id, FILENAME_NOT_REPORTABLE);
a60cd7
         if (not_reportable != 0)
a60cd7
         {
a60cd7
             if (!(flags & CMD_REPORT_UNSAFE))
a60cd7
             {
a60cd7
+                if (g_verbose > 0)
a60cd7
+                {
a60cd7
+                    char *reason = load_text_over_dbus(real_problem_id, FILENAME_NOT_REPORTABLE);
a60cd7
+                    if (reason != NULL)
a60cd7
+                        log("%s\n", reason);
a60cd7
+                    free(reason);
a60cd7
+                }
a60cd7
+
a60cd7
                 error_msg(_("Problem '%s' cannot be reported"), real_problem_id);
a60cd7
                 free(real_problem_id);
a60cd7
                 ++ret;
a60cd7
-- 
a60cd7
1.8.3.1
a60cd7