From 2fa751f6d98995e73db4d0edd0d22b9560281644 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 1 Jun 2011 17:57:31 +0200 Subject: wizard: hook selection checkboxes to reporters. Checkboxes are controlled by the following elements in .xml: ITEM1,ITEM2 ITEM1,ITEM2 ITEM1,ITEM2 yes / no ITEM1,ITEM2 exclude-items-by-default and exclude-items-always can be "*" meaning "all". include-items-by-default specifies which items are included (checked) is exclude-items-by-default is "*". Else, all are checked by default. the set of iters NOT included is passed in $EXCLUDE_FROM_REPORT variable. bugzilla, kerneloops, mailx, print and rhtsupport are made aware of this variable. Signed-off-by: Denys Vlasenko --- src/plugins/abrt-action-bugzilla.c | 17 +++++++---------- src/plugins/abrt-action-kerneloops.c | 11 ++++------- src/plugins/abrt-action-mailx.c | 11 ++++------- src/plugins/abrt-action-print.c | 11 ++++------- src/plugins/abrt-action-rhtsupport.c | 11 ++++------- src/plugins/analyze_LocalGDB.xml.in | 2 +- src/plugins/analyze_RetraceServer.xml.in | 2 +- src/plugins/analyze_xsession_errors.xml.in | 2 +- src/plugins/report_Bugzilla.xml.in | 7 +++++++ 9 files changed, 33 insertions(+), 41 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/abrt-action-bugzilla.c b/src/plugins/abrt-action-bugzilla.c index 9290112a..956e11e5 100644 --- a/src/plugins/abrt-action-bugzilla.c +++ b/src/plugins/abrt-action-bugzilla.c @@ -22,15 +22,13 @@ #include "abrt_xmlrpc.h" #include "rhbz.h" -#define XML_RPC_SUFFIX "/xmlrpc.cgi" +#define XML_RPC_SUFFIX "/xmlrpc.cgi" static void report_to_bugzilla(const char *dump_dir_name, map_string_h *settings) { - struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0); - if (!dd) - xfunc_die(); /* dd_opendir already emitted error msg */ - problem_data_t *problem_data = create_problem_data_from_dump_dir(dd); - dd_close(dd); + problem_data_t *problem_data = create_problem_data_for_reporting(dump_dir_name); + if (!problem_data) + xfunc_die(); /* create_problem_data_for_reporting already emitted error msg */ const char *env; const char *login; @@ -100,7 +98,7 @@ static void report_to_bugzilla(const char *dump_dir_name, map_string_h *settings VERB3 log("Bugzilla has %i reports with same duphash '%s'", all_bugs_size, duphash); - int bug_id = -1, dependent_bug = -1; + int bug_id = -1; struct bug_info *bz = NULL; if (all_bugs_size > 0) { @@ -110,7 +108,6 @@ static void report_to_bugzilla(const char *dump_dir_name, map_string_h *settings if (strcmp(bz->bi_product, product) != 0) { - dependent_bug = bug_id; /* found something, but its a different product */ free_bug_info(bz); @@ -209,7 +206,7 @@ static void report_to_bugzilla(const char *dump_dir_name, map_string_h *settings bugzilla_url, bz->bi_id); - dd = dd_opendir(dump_dir_name, /*flags:*/ 0); + struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0); if (dd) { char *msg = xasprintf("Bugzilla: URL=%s/show_bug.cgi?id=%u", bugzilla_url, bz->bi_id); @@ -233,7 +230,7 @@ int main(int argc, char **argv) /* Can't keep these strings/structs static: _() doesn't support that */ const char *program_usage_string = _( - "\b [-v] -c CONFFILE -d DIR\n" + "\b [-v] [-c CONFFILE] -d DIR\n" "\n" "Reports problem to Bugzilla.\n" "\n" diff --git a/src/plugins/abrt-action-kerneloops.c b/src/plugins/abrt-action-kerneloops.c index 99b2fea9..b8f4337a 100644 --- a/src/plugins/abrt-action-kerneloops.c +++ b/src/plugins/abrt-action-kerneloops.c @@ -84,12 +84,9 @@ static void report_to_kerneloops( const char *dump_dir_name, map_string_h *settings) { - struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0); - if (!dd) - exit(1); /* error msg is already logged */ - - problem_data_t *problem_data = create_problem_data_from_dump_dir(dd); - dd_close(dd); + problem_data_t *problem_data = create_problem_data_for_reporting(dump_dir_name); + if (!problem_data) + xfunc_die(); /* create_problem_data_for_reporting already emitted error msg */ const char *backtrace = get_problem_item_content_or_NULL(problem_data, FILENAME_BACKTRACE); if (!backtrace) @@ -113,7 +110,7 @@ static void report_to_kerneloops( * RemoteIP: 34192fd15e34bf60fac6a5f01bba04ddbd3f0558 * - no URL or bug ID apparently... */ - dd = dd_opendir(dump_dir_name, /*flags:*/ 0); + struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0); if (dd) { char *msg = xasprintf("kerneloops: URL=%s", submitURL); diff --git a/src/plugins/abrt-action-mailx.c b/src/plugins/abrt-action-mailx.c index 21180854..d513fbb7 100644 --- a/src/plugins/abrt-action-mailx.c +++ b/src/plugins/abrt-action-mailx.c @@ -59,12 +59,9 @@ static void create_and_send_email( const char *dump_dir_name, map_string_h *settings) { - struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0); - if (!dd) - exit(1); /* error msg is already logged by dd_opendir */ - - problem_data_t *problem_data = create_problem_data_from_dump_dir(dd); - dd_close(dd); + problem_data_t *problem_data = create_problem_data_for_reporting(dump_dir_name); + if (!problem_data) + xfunc_die(); /* create_problem_data_for_reporting already emitted error msg */ char* env; env = getenv("Mailx_Subject"); @@ -116,7 +113,7 @@ static void create_and_send_email( free_problem_data(problem_data); - dd = dd_opendir(dump_dir_name, /*flags:*/ 0); + struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0); if (dd) { char *msg = xasprintf("email: %s", email_to); diff --git a/src/plugins/abrt-action-print.c b/src/plugins/abrt-action-print.c index d433fa52..0de1fbe6 100644 --- a/src/plugins/abrt-action-print.c +++ b/src/plugins/abrt-action-print.c @@ -64,12 +64,9 @@ int main(int argc, char **argv) perror_msg_and_die("Can't open '%s'", output_file); } - struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0); - if (!dd) - return 1; /* error message is already logged */ - - problem_data_t *problem_data = create_problem_data_from_dump_dir(dd); - dd_close(dd); + problem_data_t *problem_data = create_problem_data_for_reporting(dump_dir_name); + if (!problem_data) + xfunc_die(); /* create_problem_data_for_reporting already emitted error msg */ char *dsc = make_description_logger(problem_data); fputs(dsc, stdout); @@ -82,7 +79,7 @@ int main(int argc, char **argv) { if (opts & OPT_r) { - dd = dd_opendir(dump_dir_name, /*flags:*/ 0); + struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0); if (dd) { char *msg = xasprintf("file: %s", output_file); diff --git a/src/plugins/abrt-action-rhtsupport.c b/src/plugins/abrt-action-rhtsupport.c index 989fd75d..59d02eda 100644 --- a/src/plugins/abrt-action-rhtsupport.c +++ b/src/plugins/abrt-action-rhtsupport.c @@ -28,12 +28,9 @@ static void report_to_rhtsupport( const char *dump_dir_name, map_string_h *settings) { - struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0); - if (!dd) - exit(1); /* error msg is already logged by dd_opendir */ - - problem_data_t *problem_data = create_problem_data_from_dump_dir(dd); - dd_close(dd); + problem_data_t *problem_data = create_problem_data_for_reporting(dump_dir_name); + if (!problem_data) + xfunc_die(); /* create_problem_data_for_reporting already emitted error msg */ /* Gzipping e.g. 0.5gig coredump takes a while. Let client know what we are doing */ log(_("Compressing data")); @@ -245,7 +242,7 @@ static void report_to_rhtsupport( } /* No error */ - dd = dd_opendir(dump_dir_name, /*flags:*/ 0); + struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0); if (dd) { char *msg = xasprintf("RHTSupport: %s", result); diff --git a/src/plugins/analyze_LocalGDB.xml.in b/src/plugins/analyze_LocalGDB.xml.in index 4f7ccce1..b2975f76 100644 --- a/src/plugins/analyze_LocalGDB.xml.in +++ b/src/plugins/analyze_LocalGDB.xml.in @@ -5,5 +5,5 @@ <_long-description>Needs to downloads debuginfo packages, which might take significant time, and take up disk space. However, unlike RetraceServer, doesn't send coredump to remote machines. - backtrace + backtrace diff --git a/src/plugins/analyze_RetraceServer.xml.in b/src/plugins/analyze_RetraceServer.xml.in index d2072db5..139e114d 100644 --- a/src/plugins/analyze_RetraceServer.xml.in +++ b/src/plugins/analyze_RetraceServer.xml.in @@ -6,7 +6,7 @@ Pros: no need for debuginfo downloads. Retrace server's database of debuginfos is more complete. Retrace server may generate better backtraces. Cons: coredump you upload contains all the data from the crashed program, including your private data, if any. - backtrace + backtrace