doczkal / rpms / abrt

Forked from rpms/abrt 4 years ago
Clone

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

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