Blame SOURCES/0194-rhtsupport-Discourage-users-from-opening-one-shot-cr.patch

28bab8
From 49ddc9209df746b83ca4767075c56f4df790a03c Mon Sep 17 00:00:00 2001
28bab8
From: Matej Habrnal <mhabrnal@redhat.com>
28bab8
Date: Tue, 29 Mar 2016 12:01:30 +0200
28bab8
Subject: [PATCH] rhtsupport: Discourage users from opening one-shot crashes
28bab8
28bab8
Related: #1258482
28bab8
28bab8
Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>
28bab8
---
28bab8
 src/plugins/reporter-rhtsupport.c | 17 +++++++++++++++++
28bab8
 1 file changed, 17 insertions(+)
28bab8
28bab8
diff --git a/src/plugins/reporter-rhtsupport.c b/src/plugins/reporter-rhtsupport.c
28bab8
index 90988fc..2374dd9 100644
28bab8
--- a/src/plugins/reporter-rhtsupport.c
28bab8
+++ b/src/plugins/reporter-rhtsupport.c
28bab8
@@ -630,6 +630,23 @@ int main(int argc, char **argv)
28bab8
     rhts_result_t *result_atch = NULL;
28bab8
     char *dsc = NULL;
28bab8
     char *summary = NULL;
28bab8
+
28bab8
+    const char *count = NULL;
28bab8
+    count = problem_data_get_content_or_NULL(problem_data, FILENAME_COUNT);
28bab8
+    if (count != NULL
28bab8
+        && strcmp(count, "1") == 0
28bab8
+        /* the 'count' file can lie */
28bab8
+        && get_problem_data_reproducible(problem_data) <= PROBLEM_REPRODUCIBLE_UNKNOWN)
28bab8
+    {
28bab8
+        int r = ask_yes_no(
28bab8
+            _("The problem has only occurred once and the ability to reproduce "
28bab8
+              "the problem is unknown. Please ensure you will be able to "
28bab8
+              "provide detailed information to our Support Team. "
28bab8
+              "Would you like to continue and open a new support case?"));
28bab8
+        if (!r)
28bab8
+            exit(EXIT_CANCEL_BY_USER);
28bab8
+    }
28bab8
+
28bab8
     const char *function;
28bab8
     const char *reason;
28bab8
     const char *package;
28bab8
-- 
28bab8
1.8.3.1
28bab8