arrfab / rpms / abrt

Forked from rpms/abrt 5 years ago
Clone

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

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