libreport/libreport-2.0.19-bugzilla_summary_formatting.patch
2012-11-26 16:10:46 +01:00

74 lines
2.4 KiB
Diff

From 86b383640cba5834e7185901d00edc35dbb8ff35 Mon Sep 17 00:00:00 2001
From: Jakub Filak <jfilak@redhat.com>
Date: Mon, 26 Nov 2012 15:59:29 +0100
Subject: [LIBREPORT PATCH] fix bugzilla summary formatting
Signed-off-by: Jakub Filak <jfilak@redhat.com>
---
src/plugins/bugzilla_event.conf | 4 +++-
src/plugins/reporter-bugzilla.c | 15 +++++----------
2 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/src/plugins/bugzilla_event.conf b/src/plugins/bugzilla_event.conf
index 109c581..d3355a3 100644
--- a/src/plugins/bugzilla_event.conf
+++ b/src/plugins/bugzilla_event.conf
@@ -1 +1,3 @@
-EVENT=report_Bugzilla analyzer=libreport reporter-bugzilla -b
+EVENT=report_Bugzilla analyzer=libreport
+ reporter-bugzilla -b \
+ -F /etc/libreport/plugins/bugzilla_format_libreport.conf
diff --git a/src/plugins/reporter-bugzilla.c b/src/plugins/reporter-bugzilla.c
index 78b8b11..2623122 100644
--- a/src/plugins/reporter-bugzilla.c
+++ b/src/plugins/reporter-bugzilla.c
@@ -224,9 +224,7 @@ char *format_percented_string(const char *str, problem_data_t *pd)
char *nextpercent = strchr(++str, '%');
if (!nextpercent)
{
- error_msg("Unterminated %%element%%: '%s'", str - 1);
- strbuf_free(result);
- return NULL;
+ error_msg_and_die("Unterminated %%element%%: '%s'", str - 1);
}
*nextpercent = '\0';
@@ -244,16 +242,12 @@ char *format_percented_string(const char *str, problem_data_t *pd)
if (opt_depth > 1)
{
- error_msg("Unbalanced [[ ]] bracket");
- strbuf_free(result);
- return NULL;
+ error_msg_and_die("Unbalanced [[ ]] bracket");
}
if (!okay[0])
{
error_msg("Undefined variable outside of [[ ]] bracket");
- strbuf_free(result);
- return NULL;
}
return strbuf_free_nobuf(result);
@@ -274,13 +268,14 @@ char *create_summary_string(problem_data_t *pd, GList *comment_fmt_spec)
GList *item = sec->items;
if (!item)
- return NULL;
+ /* not supposed to happen, there will be at least "" */
+ error_msg_and_die("BUG in %%summary parser");
const char *str = item->data;
return format_percented_string(str, pd);
}
- return format_percented_string("%comment%", pd);
+ return format_percented_string("%reason%", pd);
}
--
1.7.11.7