Signed-off-by: Nikola Pajkovsky npajkovs@redhat.com --- src/lib/abrt_xmlrpc.c | 4 ++-- src/plugins/reporter-bugzilla.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/lib/abrt_xmlrpc.c b/src/lib/abrt_xmlrpc.c index 1741445..8bd63c8 100644 --- a/src/lib/abrt_xmlrpc.c +++ b/src/lib/abrt_xmlrpc.c @@ -22,12 +22,12 @@
void abrt_xmlrpc_die(xmlrpc_env *env) { - error_msg_and_die("fatal: XML-RPC(%d): %s", env->fault_code, env->fault_string); + error_msg_and_die("fatal: %s", env->fault_string); }
void abrt_xmlrpc_error(xmlrpc_env *env) { - error_msg("error: XML-RPC (%d): %s", env->fault_code, env->fault_string); + error_msg("error: %s", env->fault_string); }
struct abrt_xmlrpc *abrt_xmlrpc_new_client(const char *url, int ssl_verify) diff --git a/src/plugins/reporter-bugzilla.c b/src/plugins/reporter-bugzilla.c index bc1ff69..cf33d5e 100644 --- a/src/plugins/reporter-bugzilla.c +++ b/src/plugins/reporter-bugzilla.c @@ -116,7 +116,7 @@ int main(int argc, char **argv) xmlrpc_env_init(&env); xmlrpc_client_setup_global_const(&env); if (env.fault_occurred) - error_msg_and_die("XML-RPC Fault: %s(%d)", env.fault_string, env.fault_code); + abrt_xmlrpc_die(&env); xmlrpc_env_clean(&env);
const char *environ;
Signed-off-by: Nikola Pajkovsky npajkovs@redhat.com --- src/plugins/reporter-bugzilla.c | 89 ++++++++++++++++++++------------------- src/plugins/rhbz.c | 4 +- src/plugins/rhbz.h | 15 ++++++- 3 files changed, 61 insertions(+), 47 deletions(-)
diff --git a/src/plugins/reporter-bugzilla.c b/src/plugins/reporter-bugzilla.c index cf33d5e..b941d49 100644 --- a/src/plugins/reporter-bugzilla.c +++ b/src/plugins/reporter-bugzilla.c @@ -23,6 +23,27 @@
#define XML_RPC_SUFFIX "/xmlrpc.cgi"
+static void set_settings(struct bugzilla_struct *b, map_string_h *settings) +{ + const char *environ; + + environ = getenv("Bugzilla_Login"); + b->b_login = environ ? environ : get_map_string_item_or_empty(settings, "Login"); + environ = getenv("Bugzilla_Password"); + b->b_password = environ ? environ : get_map_string_item_or_empty(settings, "Password"); + environ = getenv("Bugzilla_BugzillaURL"); + b->b_bugzilla_url = environ ? environ : get_map_string_item_or_empty(settings, "BugzillaURL"); + if (!b->b_bugzilla_url[0]) + b->b_bugzilla_url = "https://bugzilla.redhat.com"; + b->b_bugzilla_xmlrpc = xasprintf("%s"XML_RPC_SUFFIX, b->b_bugzilla_url); + + environ = getenv("Bugzilla_SSLVerify"); + b->b_ssl_verify = string_to_bool(environ ? environ : get_map_string_item_or_empty(settings, "SSLVerify")); + + environ = getenv("Bugzilla_OSRelease"); + b->b_release = environ ? environ : get_map_string_item_or_NULL(settings, "OSRelease"); +} + int main(int argc, char **argv) { abrt_init(argv); @@ -119,32 +140,11 @@ int main(int argc, char **argv) abrt_xmlrpc_die(&env); xmlrpc_env_clean(&env);
- const char *environ; - const char *login; - const char *password; - const char *bugzilla_xmlrpc; - const char *bugzilla_url; - bool ssl_verify; - const char *release; - char *product; - - environ = getenv("Bugzilla_Login"); - login = environ ? environ : get_map_string_item_or_empty(settings, "Login"); - environ = getenv("Bugzilla_Password"); - password = environ ? environ : get_map_string_item_or_empty(settings, "Password"); - environ = getenv("Bugzilla_BugzillaURL"); - bugzilla_url = environ ? environ : get_map_string_item_or_empty(settings, "BugzillaURL"); - if (!bugzilla_url[0]) - bugzilla_url = "https://bugzilla.redhat.com"; - bugzilla_xmlrpc = xasprintf("%s"XML_RPC_SUFFIX, bugzilla_url); - - environ = getenv("Bugzilla_SSLVerify"); - ssl_verify = string_to_bool(environ ? environ : get_map_string_item_or_empty(settings, "SSLVerify")); - - environ = getenv("Bugzilla_OSRelease"); - release = environ ? environ : get_map_string_item_or_NULL(settings, "OSRelease"); + INIT_BUGZILLA(rhbz); + set_settings(&rhbz, settings);
- struct abrt_xmlrpc *client = abrt_xmlrpc_new_client(bugzilla_xmlrpc, ssl_verify); + struct abrt_xmlrpc *client; + client = abrt_xmlrpc_new_client(rhbz.b_bugzilla_xmlrpc, rhbz.b_ssl_verify);
if (abrt_hash) { @@ -175,7 +175,7 @@ int main(int argc, char **argv) exit(EXIT_SUCCESS); }
- if (!login[0] || !password[0]) + if (!rhbz.b_login[0] || !rhbz.b_password[0]) error_msg_and_die(_("Empty login or password, please check your configuration"));
struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0); @@ -206,8 +206,8 @@ int main(int argc, char **argv) if (!argv[0]) show_usage_and_die(program_usage_string, program_options);
- log(_("Logging into Bugzilla at %s"), bugzilla_url); - rhbz_login(client, login, password); + log(_("Logging into Bugzilla at %s"), rhbz.b_bugzilla_url); + rhbz_login(client, &rhbz);
while (*argv) { @@ -265,18 +265,19 @@ int main(int argc, char **argv) const char *duphash = get_problem_item_content_or_NULL(problem_data, FILENAME_DUPHASH); //COMPAT, remove after 2.1 release if (!duphash) duphash = get_problem_item_content_or_die(problem_data, "global_uuid"); - if (!release || !*release) /* if not overridden or empty... */ + if (!rhbz.b_release || !*rhbz.b_release) /* if not overridden or empty... */ { - release = get_problem_item_content_or_NULL(problem_data, FILENAME_OS_RELEASE); + rhbz.b_release = get_problem_item_content_or_NULL(problem_data, FILENAME_OS_RELEASE); //COMPAT, remove in abrt-2.1 - if (!release) release = get_problem_item_content_or_die(problem_data, "release"); + if (!rhbz.b_release) + rhbz.b_release = get_problem_item_content_or_die(problem_data, "release"); }
- log(_("Logging into Bugzilla at %s"), bugzilla_url); - rhbz_login(client, login, password); + log(_("Logging into Bugzilla at %s"), rhbz.b_bugzilla_url); + rhbz_login(client, &rhbz);
char *version = NULL; - parse_release_for_bz(release, &product, &version); + parse_release_for_bz(rhbz.b_release, &rhbz.b_product, &version); free(version);
log(_("Checking for duplicates")); @@ -292,7 +293,7 @@ int main(int argc, char **argv) so if bug is moved from component selinux-policy to other, then query returns NULL and creates a new bug. */ - const char *product_substitute = (!strcmp(product, "Fedora")) ? product : NULL; + const char *product_substitute = (!strcmp(rhbz.b_product, "Fedora")) ? rhbz.b_product : NULL; const char *component_substitute = (!strcmp(component, "selinux-policy")) ? NULL : component; xmlrpc_value *result = rhbz_search_duphash(client, component_substitute, product_substitute, duphash); @@ -316,7 +317,7 @@ int main(int argc, char **argv) xmlrpc_DECREF(all_bugs); bz = rhbz_bug_info(client, bug_id);
- if (strcmp(bz->bi_product, product) != 0) + if (strcmp(bz->bi_product, rhbz.b_product) != 0) { /* found something, but its a different product */ free_bug_info(bz); @@ -340,7 +341,7 @@ int main(int argc, char **argv) { /* Create new bug */ log(_("Creating a new bug")); - bug_id = rhbz_new_bug(client, problem_data, release, bug_id); + bug_id = rhbz_new_bug(client, problem_data, rhbz.b_release, bug_id);
log(_("Adding attachments to bug %i"), bug_id); char bug_id_str[sizeof(int)*3 + 2]; @@ -375,11 +376,11 @@ int main(int argc, char **argv) if (strcmp(bz->bi_status, "CLOSED") != 0) { /* Add user's login to CC if not there already */ - if (strcmp(bz->bi_reporter, login) != 0 - && !g_list_find_custom(bz->bi_cc_list, login, (GCompareFunc)g_strcmp0) + if (strcmp(bz->bi_reporter, rhbz.b_login) != 0 + && !g_list_find_custom(bz->bi_cc_list, rhbz.b_login, (GCompareFunc)g_strcmp0) ) { - log(_("Add %s to CC list"), login); - rhbz_mail_to_cc(client, bz->bi_id, login, RHBZ_NOMAIL_NOTIFY); + log(_("Add %s to CC list"), rhbz.b_login); + rhbz_mail_to_cc(client, bz->bi_id, rhbz.b_login, RHBZ_NOMAIL_NOTIFY); }
/* Add comment */ @@ -406,7 +407,7 @@ int main(int argc, char **argv) { VERB3 log("not adding the arch: %s because rep_plat is %s", arch, bz->bi_platform); } - strbuf_append_strf(full_desc, "OS Release: %s\n", release); + strbuf_append_strf(full_desc, "OS Release: %s\n", rhbz.b_release);
/* unused code, enable it when gui/cli will be ready int is_priv = is_private && string_to_bool(is_private); @@ -452,13 +453,13 @@ int main(int argc, char **argv) bz->bi_status, bz->bi_resolution ? " " : "", bz->bi_resolution ? bz->bi_resolution : "", - bugzilla_url, + rhbz.b_bugzilla_url, bz->bi_id);
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); + char *msg = xasprintf("Bugzilla: URL=%s/show_bug.cgi?id=%u", rhbz.b_bugzilla_url, bz->bi_id); add_reported_to(dd, msg); free(msg); dd_close(dd); diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c index 2c6e4d9..ebe3616 100644 --- a/src/plugins/rhbz.c +++ b/src/plugins/rhbz.c @@ -147,10 +147,10 @@ static unsigned find_best_bt_rating_in_comments(GList *comments) return best_bt_rating; }
-void rhbz_login(struct abrt_xmlrpc *ax, const char* login, const char* passwd) +void rhbz_login(struct abrt_xmlrpc *ax, struct bugzilla_struct *b) { xmlrpc_value* result = abrt_xmlrpc_call(ax, "User.login", "({s:s,s:s})", - "login", login, "password", passwd); + "login", b->b_login, "password", b->b_password);
//TODO: with URL like http://bugzilla.redhat.com (that is, with http: instead of https:) //we are getting this error: diff --git a/src/plugins/rhbz.h b/src/plugins/rhbz.h index 4b39dc3..38c6430 100644 --- a/src/plugins/rhbz.h +++ b/src/plugins/rhbz.h @@ -60,10 +60,23 @@ struct bug_info { GList *bi_comments; };
+struct bugzilla_struct { + const char *b_login; + const char *b_password; + const char *b_bugzilla_xmlrpc; + const char *b_bugzilla_url; + const char *b_release; + char *b_product; + int b_ssl_verify; +}; + +#define INIT_BUGZILLA(name) \ + static struct bugzilla_struct name + struct bug_info *new_bug_info(); void free_bug_info(struct bug_info *bz);
-void rhbz_login(struct abrt_xmlrpc *ax, const char *login, const char *passwd); +void rhbz_login(struct abrt_xmlrpc *ax, struct bugzilla_struct *b);
void rhbz_mail_to_cc(struct abrt_xmlrpc *ax, int bug_id, const char *mail, int flags);
Ack.
On 02/13/2012 12:03 PM, Nikola Pajkovsky wrote:
Signed-off-by: Nikola Pajkovskynpajkovs@redhat.com
src/plugins/reporter-bugzilla.c | 89 ++++++++++++++++++++------------------- src/plugins/rhbz.c | 4 +- src/plugins/rhbz.h | 15 ++++++- 3 files changed, 61 insertions(+), 47 deletions(-)
diff --git a/src/plugins/reporter-bugzilla.c b/src/plugins/reporter-bugzilla.c index cf33d5e..b941d49 100644 --- a/src/plugins/reporter-bugzilla.c +++ b/src/plugins/reporter-bugzilla.c @@ -23,6 +23,27 @@
#define XML_RPC_SUFFIX "/xmlrpc.cgi"
+static void set_settings(struct bugzilla_struct *b, map_string_h *settings) +{
- const char *environ;
- environ = getenv("Bugzilla_Login");
- b->b_login = environ ? environ : get_map_string_item_or_empty(settings, "Login");
- environ = getenv("Bugzilla_Password");
- b->b_password = environ ? environ : get_map_string_item_or_empty(settings, "Password");
- environ = getenv("Bugzilla_BugzillaURL");
- b->b_bugzilla_url = environ ? environ : get_map_string_item_or_empty(settings, "BugzillaURL");
- if (!b->b_bugzilla_url[0])
b->b_bugzilla_url = "https://bugzilla.redhat.com";
- b->b_bugzilla_xmlrpc = xasprintf("%s"XML_RPC_SUFFIX, b->b_bugzilla_url);
- environ = getenv("Bugzilla_SSLVerify");
- b->b_ssl_verify = string_to_bool(environ ? environ : get_map_string_item_or_empty(settings, "SSLVerify"));
- environ = getenv("Bugzilla_OSRelease");
- b->b_release = environ ? environ : get_map_string_item_or_NULL(settings, "OSRelease");
+}
- int main(int argc, char **argv) { abrt_init(argv);
@@ -119,32 +140,11 @@ int main(int argc, char **argv) abrt_xmlrpc_die(&env); xmlrpc_env_clean(&env);
- const char *environ;
- const char *login;
- const char *password;
- const char *bugzilla_xmlrpc;
- const char *bugzilla_url;
- bool ssl_verify;
- const char *release;
- char *product;
- environ = getenv("Bugzilla_Login");
- login = environ ? environ : get_map_string_item_or_empty(settings, "Login");
- environ = getenv("Bugzilla_Password");
- password = environ ? environ : get_map_string_item_or_empty(settings, "Password");
- environ = getenv("Bugzilla_BugzillaURL");
- bugzilla_url = environ ? environ : get_map_string_item_or_empty(settings, "BugzillaURL");
- if (!bugzilla_url[0])
bugzilla_url = "https://bugzilla.redhat.com";
- bugzilla_xmlrpc = xasprintf("%s"XML_RPC_SUFFIX, bugzilla_url);
- environ = getenv("Bugzilla_SSLVerify");
- ssl_verify = string_to_bool(environ ? environ : get_map_string_item_or_empty(settings, "SSLVerify"));
- environ = getenv("Bugzilla_OSRelease");
- release = environ ? environ : get_map_string_item_or_NULL(settings, "OSRelease");
- INIT_BUGZILLA(rhbz);
- set_settings(&rhbz, settings);
- struct abrt_xmlrpc *client = abrt_xmlrpc_new_client(bugzilla_xmlrpc, ssl_verify);
struct abrt_xmlrpc *client;
client = abrt_xmlrpc_new_client(rhbz.b_bugzilla_xmlrpc, rhbz.b_ssl_verify);
if (abrt_hash) {
@@ -175,7 +175,7 @@ int main(int argc, char **argv) exit(EXIT_SUCCESS); }
- if (!login[0] || !password[0])
if (!rhbz.b_login[0] || !rhbz.b_password[0]) error_msg_and_die(_("Empty login or password, please check your configuration"));
struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0);
@@ -206,8 +206,8 @@ int main(int argc, char **argv) if (!argv[0]) show_usage_and_die(program_usage_string, program_options);
log(_("Logging into Bugzilla at %s"), bugzilla_url);
rhbz_login(client, login, password);
log(_("Logging into Bugzilla at %s"), rhbz.b_bugzilla_url);
rhbz_login(client,&rhbz); while (*argv) {
@@ -265,18 +265,19 @@ int main(int argc, char **argv) const char *duphash = get_problem_item_content_or_NULL(problem_data, FILENAME_DUPHASH); //COMPAT, remove after 2.1 release if (!duphash) duphash = get_problem_item_content_or_die(problem_data, "global_uuid");
- if (!release || !*release) /* if not overridden or empty... */
- if (!rhbz.b_release || !*rhbz.b_release) /* if not overridden or empty... */ {
release = get_problem_item_content_or_NULL(problem_data, FILENAME_OS_RELEASE);
//COMPAT, remove in abrt-2.1rhbz.b_release = get_problem_item_content_or_NULL(problem_data, FILENAME_OS_RELEASE);
if (!release) release = get_problem_item_content_or_die(problem_data, "release");
if (!rhbz.b_release)
}rhbz.b_release = get_problem_item_content_or_die(problem_data, "release");
- log(_("Logging into Bugzilla at %s"), bugzilla_url);
- rhbz_login(client, login, password);
log(_("Logging into Bugzilla at %s"), rhbz.b_bugzilla_url);
rhbz_login(client,&rhbz);
char *version = NULL;
- parse_release_for_bz(release,&product,&version);
parse_release_for_bz(rhbz.b_release,&rhbz.b_product,&version); free(version);
log(_("Checking for duplicates"));
@@ -292,7 +293,7 @@ int main(int argc, char **argv) so if bug is moved from component selinux-policy to other, then query returns NULL and creates a new bug. */
- const char *product_substitute = (!strcmp(product, "Fedora")) ? product : NULL;
- const char *product_substitute = (!strcmp(rhbz.b_product, "Fedora")) ? rhbz.b_product : NULL; const char *component_substitute = (!strcmp(component, "selinux-policy")) ? NULL : component; xmlrpc_value *result = rhbz_search_duphash(client, component_substitute, product_substitute, duphash);
@@ -316,7 +317,7 @@ int main(int argc, char **argv) xmlrpc_DECREF(all_bugs); bz = rhbz_bug_info(client, bug_id);
if (strcmp(bz->bi_product, product) != 0)
if (strcmp(bz->bi_product, rhbz.b_product) != 0) { /* found something, but its a different product */ free_bug_info(bz);
@@ -340,7 +341,7 @@ int main(int argc, char **argv) { /* Create new bug */ log(_("Creating a new bug"));
bug_id = rhbz_new_bug(client, problem_data, release, bug_id);
bug_id = rhbz_new_bug(client, problem_data, rhbz.b_release, bug_id); log(_("Adding attachments to bug %i"), bug_id); char bug_id_str[sizeof(int)*3 + 2];
@@ -375,11 +376,11 @@ int main(int argc, char **argv) if (strcmp(bz->bi_status, "CLOSED") != 0) { /* Add user's login to CC if not there already */
if (strcmp(bz->bi_reporter, login) != 0
-&& !g_list_find_custom(bz->bi_cc_list, login, (GCompareFunc)g_strcmp0)
if (strcmp(bz->bi_reporter, rhbz.b_login) != 0
+&& !g_list_find_custom(bz->bi_cc_list, rhbz.b_login, (GCompareFunc)g_strcmp0) ) {
log(_("Add %s to CC list"), login);
rhbz_mail_to_cc(client, bz->bi_id, login, RHBZ_NOMAIL_NOTIFY);
log(_("Add %s to CC list"), rhbz.b_login);
rhbz_mail_to_cc(client, bz->bi_id, rhbz.b_login, RHBZ_NOMAIL_NOTIFY); } /* Add comment */
@@ -406,7 +407,7 @@ int main(int argc, char **argv) { VERB3 log("not adding the arch: %s because rep_plat is %s", arch, bz->bi_platform); }
strbuf_append_strf(full_desc, "OS Release: %s\n", release);
strbuf_append_strf(full_desc, "OS Release: %s\n", rhbz.b_release); /* unused code, enable it when gui/cli will be ready int is_priv = is_private&& string_to_bool(is_private);
@@ -452,13 +453,13 @@ int main(int argc, char **argv) bz->bi_status, bz->bi_resolution ? " " : "", bz->bi_resolution ? bz->bi_resolution : "",
bugzilla_url,
rhbz.b_bugzilla_url, bz->bi_id); 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);
char *msg = xasprintf("Bugzilla: URL=%s/show_bug.cgi?id=%u", rhbz.b_bugzilla_url, bz->bi_id); add_reported_to(dd, msg); free(msg); dd_close(dd);
diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c index 2c6e4d9..ebe3616 100644 --- a/src/plugins/rhbz.c +++ b/src/plugins/rhbz.c @@ -147,10 +147,10 @@ static unsigned find_best_bt_rating_in_comments(GList *comments) return best_bt_rating; }
-void rhbz_login(struct abrt_xmlrpc *ax, const char* login, const char* passwd) +void rhbz_login(struct abrt_xmlrpc *ax, struct bugzilla_struct *b) { xmlrpc_value* result = abrt_xmlrpc_call(ax, "User.login", "({s:s,s:s})",
"login", login, "password", passwd);
"login", b->b_login, "password", b->b_password);
//TODO: with URL like http://bugzilla.redhat.com (that is, with http: instead of https:) //we are getting this error:
diff --git a/src/plugins/rhbz.h b/src/plugins/rhbz.h index 4b39dc3..38c6430 100644 --- a/src/plugins/rhbz.h +++ b/src/plugins/rhbz.h @@ -60,10 +60,23 @@ struct bug_info { GList *bi_comments; };
+struct bugzilla_struct {
- const char *b_login;
- const char *b_password;
- const char *b_bugzilla_xmlrpc;
- const char *b_bugzilla_url;
- const char *b_release;
- char *b_product;
- int b_ssl_verify;
+};
+#define INIT_BUGZILLA(name) \
- static struct bugzilla_struct name
- struct bug_info *new_bug_info(); void free_bug_info(struct bug_info *bz);
-void rhbz_login(struct abrt_xmlrpc *ax, const char *login, const char *passwd); +void rhbz_login(struct abrt_xmlrpc *ax, struct bugzilla_struct *b);
void rhbz_mail_to_cc(struct abrt_xmlrpc *ax, int bug_id, const char *mail, int flags);
we called more then once get_problem_* function for the same static value. This will merge static values into structure and thus simplify rhbz_* call. rhbz_* calls will take only bugzilla_struct and all information will be read from that.
Another benefit is, that if we put bugzilla_struct into list and than we can read multiple different configuration for one problem-dir and send them to different locations at once or vice versa.
Signed-off-by: Nikola Pajkovsky npajkovs@redhat.com --- src/include/internal_libreport.h | 7 ++- src/lib/parse_release.c | 8 +--- src/plugins/abrt-bodhi.c | 2 +- src/plugins/reporter-bugzilla.c | 39 ++++++++++-------- src/plugins/rhbz.c | 80 ++++++++++++------------------------- src/plugins/rhbz.h | 18 +++++++- 6 files changed, 68 insertions(+), 86 deletions(-)
diff --git a/src/include/internal_libreport.h b/src/include/internal_libreport.h index 95b600b..884e815 100644 --- a/src/include/internal_libreport.h +++ b/src/include/internal_libreport.h @@ -583,11 +583,12 @@ char* make_description_logger(problem_data_t *problem_data, unsigned max_text_si //#define make_description_mailx libreport_make_description_mailx //char* make_description_mailx(problem_data_t *problem_data);
-#define parse_release_for_bz libreport_parse_release_for_bz -void parse_release_for_bz(const char *pRelease, char **product, char **version); +//#define parse_release_for_bz libreport_parse_release_for_bz +//void parse_release_for_bz(const char *pRelease, char **product, char **version); #define parse_release_for_rhts libreport_parse_release_for_rhts void parse_release_for_rhts(const char *pRelease, char **product, char **version); - +#define parse_release libreport_parse_release +void parse_release(const char *release, char** product, char** version, bool append_rhel_version); /** * Loads settings and stores it in second parameter. On success it * returns true, otherwise returns false. diff --git a/src/lib/parse_release.c b/src/lib/parse_release.c index 9a4f69f..3f3ecc1 100644 --- a/src/lib/parse_release.c +++ b/src/lib/parse_release.c @@ -19,7 +19,7 @@ #include "internal_libreport.h"
// caller is reposible for freeing *product* and *version* -static void parse_release(const char *release, char** product, char** version, bool append_rhel_version) +void parse_release(const char *release, char** product, char** version, bool append_rhel_version) { if (strstr(release, "Rawhide")) { @@ -84,12 +84,6 @@ static void parse_release(const char *release, char** product, char** version, b VERB3 log("%s: version:'%s' product:'%s'", __func__, *version, *product); }
-void parse_release_for_bz(const char *release, char** product, char** version) -{ - /* Fedora/RH bugzilla uses "Red Hat Enterprise Linux N" product RHEL */ - parse_release(release, product, version, /*append_rhel_version:*/ true); -} - void parse_release_for_rhts(const char *release, char** product, char** version) { /* RHTS uses "Red Hat Enterprise Linux" product for RHEL */ diff --git a/src/plugins/abrt-bodhi.c b/src/plugins/abrt-bodhi.c index 43a3b42..5bb3024 100644 --- a/src/plugins/abrt-bodhi.c +++ b/src/plugins/abrt-bodhi.c @@ -415,7 +415,7 @@ int main(int argc, char **argv) //COMPAT, remove in abrt-2.1 if (!release) release = get_problem_item_content_or_die(problem_data, "release"); char *product = NULL, *version = NULL; - parse_release_for_bz(release, &product, &version); + parse_release(release, &product, &version, /* fedora */ true); query = strbuf_append_strf(query, "release=f%s&", version); } } diff --git a/src/plugins/reporter-bugzilla.c b/src/plugins/reporter-bugzilla.c index b941d49..cd31f5b 100644 --- a/src/plugins/reporter-bugzilla.c +++ b/src/plugins/reporter-bugzilla.c @@ -261,10 +261,10 @@ int main(int argc, char **argv) if (!problem_data) xfunc_die(); /* create_problem_data_for_reporting already emitted error msg */
- const char *component = get_problem_item_content_or_die(problem_data, FILENAME_COMPONENT); - const char *duphash = get_problem_item_content_or_NULL(problem_data, FILENAME_DUPHASH); + rhbz.b_component = get_problem_item_content_or_die(problem_data, FILENAME_COMPONENT); + rhbz.b_duphash = get_problem_item_content_or_NULL(problem_data, FILENAME_DUPHASH); //COMPAT, remove after 2.1 release - if (!duphash) duphash = get_problem_item_content_or_die(problem_data, "global_uuid"); + if (!rhbz.b_duphash) rhbz.b_duphash = get_problem_item_content_or_die(problem_data, "global_uuid"); if (!rhbz.b_release || !*rhbz.b_release) /* if not overridden or empty... */ { rhbz.b_release = get_problem_item_content_or_NULL(problem_data, FILENAME_OS_RELEASE); @@ -273,15 +273,20 @@ int main(int argc, char **argv) rhbz.b_release = get_problem_item_content_or_die(problem_data, "release"); }
+ rhbz.b_arch = get_problem_item_content_or_NULL(problem_data, FILENAME_ARCHITECTURE); + rhbz.b_package = get_problem_item_content_or_NULL(problem_data, FILENAME_PACKAGE); + rhbz.b_reason = get_problem_item_content_or_NULL(problem_data, FILENAME_REASON); + rhbz.b_function = get_problem_item_content_or_NULL(problem_data, FILENAME_CRASH_FUNCTION); + rhbz.b_analyzer = get_problem_item_content_or_NULL(problem_data, FILENAME_ANALYZER); + rhbz.b_tainted_short = get_problem_item_content_or_NULL(problem_data, + FILENAME_TAINTED_SHORT); + log(_("Logging into Bugzilla at %s"), rhbz.b_bugzilla_url); rhbz_login(client, &rhbz);
- char *version = NULL; - parse_release_for_bz(rhbz.b_release, &rhbz.b_product, &version); - free(version); + rhbz_parse_release(&rhbz);
log(_("Checking for duplicates")); - /* selinux guy's almost always move filled bug from component selinux-policy to right component. @@ -294,9 +299,9 @@ int main(int argc, char **argv) returns NULL and creates a new bug. */ const char *product_substitute = (!strcmp(rhbz.b_product, "Fedora")) ? rhbz.b_product : NULL; - const char *component_substitute = (!strcmp(component, "selinux-policy")) ? NULL : component; + const char *component_substitute = (!strcmp(rhbz.b_component, "selinux-policy")) ? NULL : rhbz.b_component; xmlrpc_value *result = rhbz_search_duphash(client, component_substitute, - product_substitute, duphash); + product_substitute, rhbz.b_duphash);
xmlrpc_value *all_bugs = rhbz_get_member("bugs", result); xmlrpc_DECREF(result); @@ -307,7 +312,7 @@ int main(int argc, char **argv) // When someone clones bug it has same duphash, so we can find more than 1. // Need to be checked if component is same. VERB3 log("Bugzilla has %i reports with same duphash '%s'", - all_bugs_size, duphash); + all_bugs_size, rhbz.b_duphash);
int bug_id = -1; struct bug_info *bz = NULL; @@ -323,7 +328,7 @@ int main(int argc, char **argv) free_bug_info(bz);
xmlrpc_value *result = rhbz_search_duphash(client, component_substitute, - product_substitute, duphash); + product_substitute, rhbz.b_duphash); xmlrpc_value *all_bugs = rhbz_get_member("bugs", result); xmlrpc_DECREF(result);
@@ -341,7 +346,7 @@ int main(int argc, char **argv) { /* Create new bug */ log(_("Creating a new bug")); - bug_id = rhbz_new_bug(client, problem_data, rhbz.b_release, bug_id); + bug_id = rhbz_new_bug(client, problem_data, &rhbz, bug_id);
log(_("Adding attachments to bug %i"), bug_id); char bug_id_str[sizeof(int)*3 + 2]; @@ -387,8 +392,6 @@ int main(int argc, char **argv) const char *comment = get_problem_item_content_or_NULL(problem_data, FILENAME_COMMENT); if (comment && comment[0]) { - const char *package = get_problem_item_content_or_NULL(problem_data, FILENAME_PACKAGE); - const char *arch = get_problem_item_content_or_NULL(problem_data, FILENAME_ARCHITECTURE); const char *rating_str = get_problem_item_content_or_NULL(problem_data, FILENAME_RATING);
struct strbuf *full_desc = strbuf_new(); @@ -397,15 +400,15 @@ int main(int argc, char **argv) /* python doesn't have rating file */ if (rating_str) strbuf_append_strf(full_desc, "%s: %s\n", FILENAME_RATING, rating_str); - strbuf_append_strf(full_desc, "Package: %s\n", package); + strbuf_append_strf(full_desc, "Package: %s\n", rhbz.b_package); /* attach the architecture only if it's different from the initial report */ if ((strcmp(bz->bi_platform, "All") != 0) && (strcmp(bz->bi_platform, "Unspecified") != 0) && - (strcmp(bz->bi_platform, arch) !=0)) - strbuf_append_strf(full_desc, "Architecture: %s\n", arch); + (strcmp(bz->bi_platform, rhbz.b_arch) !=0)) + strbuf_append_strf(full_desc, "Architecture: %s\n", rhbz.b_arch); else { - VERB3 log("not adding the arch: %s because rep_plat is %s", arch, bz->bi_platform); + VERB3 log("not adding the arch: %s because rep_plat is %s", rhbz.b_arch, bz->bi_platform); } strbuf_append_strf(full_desc, "OS Release: %s\n", rhbz.b_release);
diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c index ebe3616..fbf5bba 100644 --- a/src/plugins/rhbz.c +++ b/src/plugins/rhbz.c @@ -383,94 +383,60 @@ struct bug_info *rhbz_bug_info(struct abrt_xmlrpc *ax, int bug_id)
/* suppress mail notify by {s:i} (nomail:1) (driven by flag) */ int rhbz_new_bug(struct abrt_xmlrpc *ax, problem_data_t *problem_data, - const char *release, - int depend_on_bug) + struct bugzilla_struct *b, int depend_on_bug) { - const char *package = get_problem_item_content_or_NULL(problem_data, - FILENAME_PACKAGE); - const char *component = get_problem_item_content_or_NULL(problem_data, - FILENAME_COMPONENT); - if (!release) - { - release = get_problem_item_content_or_NULL(problem_data, - FILENAME_OS_RELEASE); - if (!release) /* Old dump dir format compat. Remove in abrt-2.1 */ - release = get_problem_item_content_or_NULL(problem_data, "release"); - } - const char *arch = get_problem_item_content_or_NULL(problem_data, - FILENAME_ARCHITECTURE); - const char *duphash = get_problem_item_content_or_NULL(problem_data, - FILENAME_DUPHASH); -//COMPAT, remove after 2.1 release - if (!duphash) duphash = get_problem_item_content_or_NULL(problem_data, - "global_uuid"); - const char *reason = get_problem_item_content_or_NULL(problem_data, - FILENAME_REASON); - const char *function = get_problem_item_content_or_NULL(problem_data, - FILENAME_CRASH_FUNCTION); - const char *analyzer = get_problem_item_content_or_NULL(problem_data, - FILENAME_ANALYZER); - const char *tainted_short = get_problem_item_content_or_NULL(problem_data, - FILENAME_TAINTED_SHORT); - struct strbuf *buf_summary = strbuf_new(); - if (analyzer && strcmp(analyzer, "libreport") == 0) + if (b->b_analyzer && strcmp(b->b_analyzer, "libreport") == 0) { - strbuf_append_str(buf_summary, reason); + strbuf_append_str(buf_summary, b->b_reason); } else { - strbuf_append_strf(buf_summary, "[abrt] %s", package); - if (function && strlen(function) < 30) - strbuf_append_strf(buf_summary, ": %s", function); + strbuf_append_strf(buf_summary, "[abrt] %s", b->b_package); + if (b->b_function && strlen(b->b_function) < 30) + strbuf_append_strf(buf_summary, ": %s", b->b_function);
- if (reason) - strbuf_append_strf(buf_summary, ": %s", reason); + if (b->b_reason) + strbuf_append_strf(buf_summary, ": %s", b->b_reason);
- if (tainted_short && analyzer - && (strcmp(analyzer, "Kerneloops") == 0)) + if (b->b_tainted_short && b->b_analyzer + && (strcmp(b->b_analyzer, "Kerneloops") == 0)) { - strbuf_append_strf(buf_summary, ": TAINTED %s", tainted_short); + strbuf_append_strf(buf_summary, ": TAINTED %s", b->b_tainted_short); } } - char *status_whiteboard = xasprintf("abrt_hash:%s", duphash); + char *status_whiteboard = xasprintf("abrt_hash:%s", b->b_duphash);
char *bz_dsc = make_description_bz(problem_data, CD_TEXT_ATT_SIZE_BZ); char *full_dsc = xasprintf("libreport version: "VERSION"\n%s", bz_dsc); free(bz_dsc);
- char *product = NULL; - char *version = NULL; - parse_release_for_bz(release, &product, &version); - xmlrpc_value* result = NULL; char *summary = strbuf_free_nobuf(buf_summary); if (depend_on_bug > -1) { result = abrt_xmlrpc_call(ax, "Bug.create", "({s:s,s:s,s:s,s:s,s:s,s:s,s:s,s:i})", - "product", product, - "component", component, - "version", version, + "product", b->b_product, + "component", b->b_component, + "version", b->b_version, "summary", summary, "description", full_dsc, "status_whiteboard", status_whiteboard, - "platform", arch, + "platform", b->b_arch, "dependson", depend_on_bug); } else { result = abrt_xmlrpc_call(ax, "Bug.create", "({s:s,s:s,s:s,s:s,s:s,s:s,s:s})", - "product", product, - "component", component, - "version", version, + "product", b->b_product, + "component", b->b_component, + "version", b->b_version, "summary", summary, "description", full_dsc, "status_whiteboard", status_whiteboard, - "platform", arch); + "platform", b->b_arch); } free(status_whiteboard); - free(product); - free(version); free(summary); free(full_dsc);
@@ -665,3 +631,9 @@ void rhbz_add_comment(struct abrt_xmlrpc *ax, int bug_id, const char *comment, if (result) xmlrpc_DECREF(result); } + +void rhbz_parse_release(struct bugzilla_struct *b) +{ + /* Fedora/RH bugzilla uses "Red Hat Enterprise Linux N" product RHEL */ + parse_release(b->b_release, &b->b_product, &b->b_version, /*append_rhel_version:*/ true); +} diff --git a/src/plugins/rhbz.h b/src/plugins/rhbz.h index 38c6430..d517052 100644 --- a/src/plugins/rhbz.h +++ b/src/plugins/rhbz.h @@ -65,9 +65,19 @@ struct bugzilla_struct { const char *b_password; const char *b_bugzilla_xmlrpc; const char *b_bugzilla_url; + int b_ssl_verify; + + const char *b_component; const char *b_release; + const char *b_duphash; + const char *b_package; + const char *b_reason; + const char *b_function; + const char *b_tainted_short; + const char *b_analyzer; + const char *b_arch; char *b_product; - int b_ssl_verify; + char *b_version; };
#define INIT_BUGZILLA(name) \ @@ -97,8 +107,8 @@ int rhbz_array_size(xmlrpc_value *xml); int rhbz_bug_id(xmlrpc_value *xml);
int rhbz_new_bug(struct abrt_xmlrpc *ax, problem_data_t *problem_data, - const char *release, - int depend_on_bug); + struct bugzilla_struct *b, int depend_on_bug); +
int rhbz_attach_big_files(struct abrt_xmlrpc *ax, const char *bug_id, problem_data_t *problem_data, int flags); @@ -109,6 +119,8 @@ int rhbz_attach_blob(struct abrt_xmlrpc *ax, const char *filename, int rhbz_attach_fd(struct abrt_xmlrpc *ax, const char *filename, const char *bug_id, int fd, int flags);
+void rhbz_parse_release(struct bugzilla_struct *b); + int is_comment_dup(GList *comments, const char *comment);
GList *rhbz_bug_cc(xmlrpc_value *result_xml);
On 02/13/2012 12:03 PM, Nikola Pajkovsky wrote:
we called more then once get_problem_* function for the same static value. This will merge static values into structure and thus simplify rhbz_* call. rhbz_* calls will take only bugzilla_struct and all information will be read from that.
Another benefit is, that if we put bugzilla_struct into list and than we can read multiple different configuration for one problem-dir and send them to different locations at once or vice versa.
Signed-off-by: Nikola Pajkovskynpajkovs@redhat.com
src/include/internal_libreport.h | 7 ++- src/lib/parse_release.c | 8 +--- src/plugins/abrt-bodhi.c | 2 +- src/plugins/reporter-bugzilla.c | 39 ++++++++++-------- src/plugins/rhbz.c | 80 ++++++++++++------------------------- src/plugins/rhbz.h | 18 +++++++- 6 files changed, 68 insertions(+), 86 deletions(-)
diff --git a/src/include/internal_libreport.h b/src/include/internal_libreport.h index 95b600b..884e815 100644 --- a/src/include/internal_libreport.h +++ b/src/include/internal_libreport.h @@ -583,11 +583,12 @@ char* make_description_logger(problem_data_t *problem_data, unsigned max_text_si //#define make_description_mailx libreport_make_description_mailx //char* make_description_mailx(problem_data_t *problem_data);
-#define parse_release_for_bz libreport_parse_release_for_bz -void parse_release_for_bz(const char *pRelease, char **product, char **version); +//#define parse_release_for_bz libreport_parse_release_for_bz +//void parse_release_for_bz(const char *pRelease, char **product, char **version); #define parse_release_for_rhts libreport_parse_release_for_rhts void parse_release_for_rhts(const char *pRelease, char **product, char **version);
+#define parse_release libreport_parse_release +void parse_release(const char *release, char** product, char** version, bool append_rhel_version);
- no, the wrapper function parse_release_for_bz makes it more readable
/**
- Loads settings and stores it in second parameter. On success it
- returns true, otherwise returns false.
diff --git a/src/lib/parse_release.c b/src/lib/parse_release.c index 9a4f69f..3f3ecc1 100644 --- a/src/lib/parse_release.c +++ b/src/lib/parse_release.c @@ -19,7 +19,7 @@ #include "internal_libreport.h"
// caller is reposible for freeing *product* and *version* -static void parse_release(const char *release, char** product, char** version, bool append_rhel_version) +void parse_release(const char *release, char** product, char** version, bool append_rhel_version) { if (strstr(release, "Rawhide")) { @@ -84,12 +84,6 @@ static void parse_release(const char *release, char** product, char** version, b VERB3 log("%s: version:'%s' product:'%s'", __func__, *version, *product); }
-void parse_release_for_bz(const char *release, char** product, char** version) -{
- /* Fedora/RH bugzilla uses "Red Hat Enterprise Linux N" product RHEL */
- parse_release(release, product, version, /*append_rhel_version:*/ true);
-}
- void parse_release_for_rhts(const char *release, char** product, char** version) { /* RHTS uses "Red Hat Enterprise Linux" product for RHEL */
diff --git a/src/plugins/abrt-bodhi.c b/src/plugins/abrt-bodhi.c index 43a3b42..5bb3024 100644 --- a/src/plugins/abrt-bodhi.c +++ b/src/plugins/abrt-bodhi.c @@ -415,7 +415,7 @@ int main(int argc, char **argv) //COMPAT, remove in abrt-2.1 if (!release) release = get_problem_item_content_or_die(problem_data, "release"); char *product = NULL, *version = NULL;
parse_release_for_bz(release,&product,&version);
parse_release(release,&product,&version, /* fedora */ true);
- and here we go.... ^ the previous version using the wrapper is more readable, so please keep it...
query = strbuf_append_strf(query, "release=f%s&", version); } }
diff --git a/src/plugins/reporter-bugzilla.c b/src/plugins/reporter-bugzilla.c index b941d49..cd31f5b 100644 --- a/src/plugins/reporter-bugzilla.c +++ b/src/plugins/reporter-bugzilla.c @@ -261,10 +261,10 @@ int main(int argc, char **argv) if (!problem_data) xfunc_die(); /* create_problem_data_for_reporting already emitted error msg */
- const char *component = get_problem_item_content_or_die(problem_data, FILENAME_COMPONENT);
- const char *duphash = get_problem_item_content_or_NULL(problem_data, FILENAME_DUPHASH);
- rhbz.b_component = get_problem_item_content_or_die(problem_data, FILENAME_COMPONENT);
- rhbz.b_duphash = get_problem_item_content_or_NULL(problem_data, FILENAME_DUPHASH); //COMPAT, remove after 2.1 release
- if (!duphash) duphash = get_problem_item_content_or_die(problem_data, "global_uuid");
- if (!rhbz.b_duphash) rhbz.b_duphash = get_problem_item_content_or_die(problem_data, "global_uuid"); if (!rhbz.b_release || !*rhbz.b_release) /* if not overridden or empty... */ { rhbz.b_release = get_problem_item_content_or_NULL(problem_data, FILENAME_OS_RELEASE);
@@ -273,15 +273,20 @@ int main(int argc, char **argv) rhbz.b_release = get_problem_item_content_or_die(problem_data, "release"); }
- rhbz.b_arch = get_problem_item_content_or_NULL(problem_data, FILENAME_ARCHITECTURE);
- rhbz.b_package = get_problem_item_content_or_NULL(problem_data, FILENAME_PACKAGE);
- rhbz.b_reason = get_problem_item_content_or_NULL(problem_data, FILENAME_REASON);
- rhbz.b_function = get_problem_item_content_or_NULL(problem_data, FILENAME_CRASH_FUNCTION);
- rhbz.b_analyzer = get_problem_item_content_or_NULL(problem_data, FILENAME_ANALYZER);
- rhbz.b_tainted_short = get_problem_item_content_or_NULL(problem_data,
FILENAME_TAINTED_SHORT);
log(_("Logging into Bugzilla at %s"), rhbz.b_bugzilla_url); rhbz_login(client,&rhbz);
- char *version = NULL;
- parse_release_for_bz(rhbz.b_release,&rhbz.b_product,&version);
- free(version);
rhbz_parse_release(&rhbz);
log(_("Checking for duplicates"));
/* selinux guy's almost always move filled bug from component selinux-policy to right component.
@@ -294,9 +299,9 @@ int main(int argc, char **argv) returns NULL and creates a new bug. */ const char *product_substitute = (!strcmp(rhbz.b_product, "Fedora")) ? rhbz.b_product : NULL;
- const char *component_substitute = (!strcmp(component, "selinux-policy")) ? NULL : component;
- const char *component_substitute = (!strcmp(rhbz.b_component, "selinux-policy")) ? NULL : rhbz.b_component; xmlrpc_value *result = rhbz_search_duphash(client, component_substitute,
product_substitute, duphash);
product_substitute, rhbz.b_duphash); xmlrpc_value *all_bugs = rhbz_get_member("bugs", result); xmlrpc_DECREF(result);
@@ -307,7 +312,7 @@ int main(int argc, char **argv) // When someone clones bug it has same duphash, so we can find more than 1. // Need to be checked if component is same. VERB3 log("Bugzilla has %i reports with same duphash '%s'",
all_bugs_size, duphash);
all_bugs_size, rhbz.b_duphash); int bug_id = -1; struct bug_info *bz = NULL;
@@ -323,7 +328,7 @@ int main(int argc, char **argv) free_bug_info(bz);
xmlrpc_value *result = rhbz_search_duphash(client, component_substitute,
product_substitute, duphash);
product_substitute, rhbz.b_duphash); xmlrpc_value *all_bugs = rhbz_get_member("bugs", result); xmlrpc_DECREF(result);
@@ -341,7 +346,7 @@ int main(int argc, char **argv) { /* Create new bug */ log(_("Creating a new bug"));
bug_id = rhbz_new_bug(client, problem_data, rhbz.b_release, bug_id);
bug_id = rhbz_new_bug(client, problem_data,&rhbz, bug_id); log(_("Adding attachments to bug %i"), bug_id); char bug_id_str[sizeof(int)*3 + 2];
@@ -387,8 +392,6 @@ int main(int argc, char **argv) const char *comment = get_problem_item_content_or_NULL(problem_data, FILENAME_COMMENT); if (comment&& comment[0]) {
const char *package = get_problem_item_content_or_NULL(problem_data, FILENAME_PACKAGE);
const char *arch = get_problem_item_content_or_NULL(problem_data, FILENAME_ARCHITECTURE); const char *rating_str = get_problem_item_content_or_NULL(problem_data, FILENAME_RATING); struct strbuf *full_desc = strbuf_new();
@@ -397,15 +400,15 @@ int main(int argc, char **argv) /* python doesn't have rating file */ if (rating_str) strbuf_append_strf(full_desc, "%s: %s\n", FILENAME_RATING, rating_str);
strbuf_append_strf(full_desc, "Package: %s\n", package);
strbuf_append_strf(full_desc, "Package: %s\n", rhbz.b_package); /* attach the architecture only if it's different from the initial report */ if ((strcmp(bz->bi_platform, "All") != 0)&& (strcmp(bz->bi_platform, "Unspecified") != 0)&&
(strcmp(bz->bi_platform, arch) !=0))
strbuf_append_strf(full_desc, "Architecture: %s\n", arch);
(strcmp(bz->bi_platform, rhbz.b_arch) !=0))
strbuf_append_strf(full_desc, "Architecture: %s\n", rhbz.b_arch); else {
VERB3 log("not adding the arch: %s because rep_plat is %s", arch, bz->bi_platform);
VERB3 log("not adding the arch: %s because rep_plat is %s", rhbz.b_arch, bz->bi_platform); } strbuf_append_strf(full_desc, "OS Release: %s\n", rhbz.b_release);
diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c index ebe3616..fbf5bba 100644 --- a/src/plugins/rhbz.c +++ b/src/plugins/rhbz.c @@ -383,94 +383,60 @@ struct bug_info *rhbz_bug_info(struct abrt_xmlrpc *ax, int bug_id)
/* suppress mail notify by {s:i} (nomail:1) (driven by flag) */ int rhbz_new_bug(struct abrt_xmlrpc *ax, problem_data_t *problem_data,
const char *release,
int depend_on_bug)
{struct bugzilla_struct *b, int depend_on_bug)
- const char *package = get_problem_item_content_or_NULL(problem_data,
FILENAME_PACKAGE);
- const char *component = get_problem_item_content_or_NULL(problem_data,
FILENAME_COMPONENT);
- if (!release)
- {
release = get_problem_item_content_or_NULL(problem_data,
FILENAME_OS_RELEASE);
if (!release) /* Old dump dir format compat. Remove in abrt-2.1 */
release = get_problem_item_content_or_NULL(problem_data, "release");
- }
- const char *arch = get_problem_item_content_or_NULL(problem_data,
FILENAME_ARCHITECTURE);
- const char *duphash = get_problem_item_content_or_NULL(problem_data,
FILENAME_DUPHASH);
-//COMPAT, remove after 2.1 release
- if (!duphash) duphash = get_problem_item_content_or_NULL(problem_data,
"global_uuid");
- const char *reason = get_problem_item_content_or_NULL(problem_data,
FILENAME_REASON);
- const char *function = get_problem_item_content_or_NULL(problem_data,
FILENAME_CRASH_FUNCTION);
- const char *analyzer = get_problem_item_content_or_NULL(problem_data,
FILENAME_ANALYZER);
- const char *tainted_short = get_problem_item_content_or_NULL(problem_data,
FILENAME_TAINTED_SHORT);
struct strbuf *buf_summary = strbuf_new();
- if (analyzer&& strcmp(analyzer, "libreport") == 0)
- if (b->b_analyzer&& strcmp(b->b_analyzer, "libreport") == 0) {
strbuf_append_str(buf_summary, reason);
strbuf_append_str(buf_summary, b->b_reason); } else {
strbuf_append_strf(buf_summary, "[abrt] %s", package);
if (function&& strlen(function)< 30)
strbuf_append_strf(buf_summary, ": %s", function);
strbuf_append_strf(buf_summary, "[abrt] %s", b->b_package);
if (b->b_function&& strlen(b->b_function)< 30)
strbuf_append_strf(buf_summary, ": %s", b->b_function);
if (reason)
strbuf_append_strf(buf_summary, ": %s", reason);
if (b->b_reason)
strbuf_append_strf(buf_summary, ": %s", b->b_reason);
if (tainted_short&& analyzer
-&& (strcmp(analyzer, "Kerneloops") == 0))
if (b->b_tainted_short&& b->b_analyzer
+&& (strcmp(b->b_analyzer, "Kerneloops") == 0)) {
strbuf_append_strf(buf_summary, ": TAINTED %s", tainted_short);
strbuf_append_strf(buf_summary, ": TAINTED %s", b->b_tainted_short); } }
- char *status_whiteboard = xasprintf("abrt_hash:%s", duphash);
char *status_whiteboard = xasprintf("abrt_hash:%s", b->b_duphash);
char *bz_dsc = make_description_bz(problem_data, CD_TEXT_ATT_SIZE_BZ); char *full_dsc = xasprintf("libreport version: "VERSION"\n%s", bz_dsc); free(bz_dsc);
- char *product = NULL;
- char *version = NULL;
- parse_release_for_bz(release,&product,&version);
xmlrpc_value* result = NULL; char *summary = strbuf_free_nobuf(buf_summary); if (depend_on_bug> -1) { result = abrt_xmlrpc_call(ax, "Bug.create", "({s:s,s:s,s:s,s:s,s:s,s:s,s:s,s:i})",
"product", product,
"component", component,
"version", version,
"product", b->b_product,
"component", b->b_component,
"version", b->b_version, "summary", summary, "description", full_dsc, "status_whiteboard", status_whiteboard,
"platform", arch,
"platform", b->b_arch, "dependson", depend_on_bug); } else { result = abrt_xmlrpc_call(ax, "Bug.create", "({s:s,s:s,s:s,s:s,s:s,s:s,s:s})",
"product", product,
"component", component,
"version", version,
"product", b->b_product,
"component", b->b_component,
"version", b->b_version, "summary", summary, "description", full_dsc, "status_whiteboard", status_whiteboard,
"platform", arch);
"platform", b->b_arch); } free(status_whiteboard);
- free(product);
- free(version); free(summary); free(full_dsc);
@@ -665,3 +631,9 @@ void rhbz_add_comment(struct abrt_xmlrpc *ax, int bug_id, const char *comment, if (result) xmlrpc_DECREF(result); }
+void rhbz_parse_release(struct bugzilla_struct *b) +{
- /* Fedora/RH bugzilla uses "Red Hat Enterprise Linux N" product RHEL */
- parse_release(b->b_release,&b->b_product,&b->b_version, /*append_rhel_version:*/ true);
+} diff --git a/src/plugins/rhbz.h b/src/plugins/rhbz.h index 38c6430..d517052 100644 --- a/src/plugins/rhbz.h +++ b/src/plugins/rhbz.h @@ -65,9 +65,19 @@ struct bugzilla_struct { const char *b_password; const char *b_bugzilla_xmlrpc; const char *b_bugzilla_url;
- int b_ssl_verify;
- const char *b_component; const char *b_release;
- const char *b_duphash;
- const char *b_package;
- const char *b_reason;
- const char *b_function;
- const char *b_tainted_short;
- const char *b_analyzer;
- const char *b_arch; char *b_product;
- int b_ssl_verify;
- char *b_version; };
- since you want to represent the bug by this struct I think you should add also a summary, so everything is on one place - the rest seems ok
#define INIT_BUGZILLA(name) \ @@ -97,8 +107,8 @@ int rhbz_array_size(xmlrpc_value *xml); int rhbz_bug_id(xmlrpc_value *xml);
int rhbz_new_bug(struct abrt_xmlrpc *ax, problem_data_t *problem_data,
const char *release,
int depend_on_bug);
struct bugzilla_struct *b, int depend_on_bug);
int rhbz_attach_big_files(struct abrt_xmlrpc *ax, const char *bug_id, problem_data_t *problem_data, int flags);
@@ -109,6 +119,8 @@ int rhbz_attach_blob(struct abrt_xmlrpc *ax, const char *filename, int rhbz_attach_fd(struct abrt_xmlrpc *ax, const char *filename, const char *bug_id, int fd, int flags);
+void rhbz_parse_release(struct bugzilla_struct *b);
int is_comment_dup(GList *comments, const char *comment);
GList *rhbz_bug_cc(xmlrpc_value *result_xml);
test 'Attaching better backtrace' is broken. problem dir contains backtrace_rating 1 and servers response is backtrace_rating 3 ->> never upload.
Signed-off-by: Nikola Pajkovsky npajkovs@redhat.com --- src/plugins/reporter-bugzilla.c | 16 +++++++++------- src/plugins/rhbz.c | 20 ++++++++++---------- 2 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/src/plugins/reporter-bugzilla.c b/src/plugins/reporter-bugzilla.c index cd31f5b..c49ffe2 100644 --- a/src/plugins/reporter-bugzilla.c +++ b/src/plugins/reporter-bugzilla.c @@ -402,13 +402,14 @@ int main(int argc, char **argv) strbuf_append_strf(full_desc, "%s: %s\n", FILENAME_RATING, rating_str); strbuf_append_strf(full_desc, "Package: %s\n", rhbz.b_package); /* attach the architecture only if it's different from the initial report */ - if ((strcmp(bz->bi_platform, "All") != 0) && - (strcmp(bz->bi_platform, "Unspecified") != 0) && - (strcmp(bz->bi_platform, rhbz.b_arch) !=0)) + if ((strcmp(bz->bi_platform, "All") != 0) + && (strcmp(bz->bi_platform, "Unspecified") != 0) + && (strcmp(bz->bi_platform, rhbz.b_arch) !=0)) strbuf_append_strf(full_desc, "Architecture: %s\n", rhbz.b_arch); else { - VERB3 log("not adding the arch: %s because rep_plat is %s", rhbz.b_arch, bz->bi_platform); + VERB3 log("not adding the arch: %s because rep_plat is %s", + rhbz.b_arch, bz->bi_platform); } strbuf_append_strf(full_desc, "OS Release: %s\n", rhbz.b_release);
@@ -418,8 +419,8 @@ int main(int argc, char **argv) "is_private"); */
- int allow_comment = is_comment_dup(bz->bi_comments, full_desc->buf); - if (!allow_comment) + int dup_comment = is_comment_dup(bz->bi_comments, full_desc->buf); + if (!dup_comment) { log(_("Adding new comment to bug %d"), bz->bi_id); rhbz_add_comment(client, bz->bi_id, full_desc->buf, 0); @@ -434,7 +435,8 @@ int main(int argc, char **argv) /* python doesn't have rating file */ if (rating_str) rating = xatou(rating_str); - if (!allow_comment && (bz->bi_best_bt_rating < rating)) + + if (!dup_comment && (rating > bz->bi_best_bt_rating)) { char bug_id_str[sizeof(int)*3 + 2]; sprintf(bug_id_str, "%i", bz->bi_id); diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c index fbf5bba..ba88110 100644 --- a/src/plugins/rhbz.c +++ b/src/plugins/rhbz.c @@ -86,22 +86,22 @@ static char *trim_all_whitespace(const char *str) return trim; }
-int is_comment_dup(GList *comments, const char *comment) +int is_comment_dup(GList *srv_comments, const char *usr_comment) { - for (GList *l = comments; l; l = l->next) + char *trim_usr_comment = trim_all_whitespace(usr_comment); + for (GList *l = srv_comments; l; l = l->next) { - char *comment_body = (char *) l->data; - char *trim_comment_body = trim_all_whitespace(comment_body); - char *trim_comment = trim_all_whitespace(comment); - if (!strcmp(trim_comment_body, trim_comment)) + char *srv_comment = (char *) l->data; + char *trim_srv_comment = trim_all_whitespace(srv_comment); + if (!strcmp(trim_srv_comment, trim_usr_comment)) { - free(trim_comment_body); - free(trim_comment); + free(trim_usr_comment); + free(trim_srv_comment); return 1; } }
- return 0;; + return 0; }
static unsigned find_best_bt_rating_in_comments(GList *comments) @@ -122,7 +122,7 @@ static unsigned find_best_bt_rating_in_comments(GList *comments) continue; }
- start_rating_line += strlen("rating: "); + start_rating_line += strlen(FILENAME_RATING": "); char *end_rating_line = strchr(start_rating_line, '\n'); if (!end_rating_line) VERB3 error_msg("broken comment body");
On 02/13/2012 12:03 PM, Nikola Pajkovsky wrote:
test 'Attaching better backtrace' is broken. problem dir contains backtrace_rating 1 and servers response is backtrace_rating 3 ->> never upload.
Signed-off-by: Nikola Pajkovskynpajkovs@redhat.com
src/plugins/reporter-bugzilla.c | 16 +++++++++------- src/plugins/rhbz.c | 20 ++++++++++---------- 2 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/src/plugins/reporter-bugzilla.c b/src/plugins/reporter-bugzilla.c index cd31f5b..c49ffe2 100644 --- a/src/plugins/reporter-bugzilla.c +++ b/src/plugins/reporter-bugzilla.c @@ -402,13 +402,14 @@ int main(int argc, char **argv) strbuf_append_strf(full_desc, "%s: %s\n", FILENAME_RATING, rating_str); strbuf_append_strf(full_desc, "Package: %s\n", rhbz.b_package); /* attach the architecture only if it's different from the initial report */
if ((strcmp(bz->bi_platform, "All") != 0)&&
(strcmp(bz->bi_platform, "Unspecified") != 0)&&
(strcmp(bz->bi_platform, rhbz.b_arch) !=0))
if ((strcmp(bz->bi_platform, "All") != 0)
+&& (strcmp(bz->bi_platform, "Unspecified") != 0) +&& (strcmp(bz->bi_platform, rhbz.b_arch) !=0)) strbuf_append_strf(full_desc, "Architecture: %s\n", rhbz.b_arch); else {
VERB3 log("not adding the arch: %s because rep_plat is %s", rhbz.b_arch, bz->bi_platform);
VERB3 log("not adding the arch: %s because rep_plat is %s",
rhbz.b_arch, bz->bi_platform); } strbuf_append_strf(full_desc, "OS Release: %s\n", rhbz.b_release);
- just an indent fixes, please don't do that, it just ruins git history, these kind of problems should be noted at the review time, once it's pushed it's too late
@@ -418,8 +419,8 @@ int main(int argc, char **argv) "is_private"); */
int allow_comment = is_comment_dup(bz->bi_comments, full_desc->buf);
if (!allow_comment)
int dup_comment = is_comment_dup(bz->bi_comments, full_desc->buf);
if (!dup_comment) { log(_("Adding new comment to bug %d"), bz->bi_id); rhbz_add_comment(client, bz->bi_id, full_desc->buf, 0);
@@ -434,7 +435,8 @@ int main(int argc, char **argv) /* python doesn't have rating file */ if (rating_str) rating = xatou(rating_str);
if (!allow_comment&& (bz->bi_best_bt_rating< rating))
if (!dup_comment&& (rating> bz->bi_best_bt_rating)) {
- here it's just a variable rename, so the same as the above applies, but since the previous name was really wrong (wasn't that mine??) I will look away and let you push it :)
char bug_id_str[sizeof(int)*3 + 2]; sprintf(bug_id_str, "%i", bz->bi_id);
diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c index fbf5bba..ba88110 100644 --- a/src/plugins/rhbz.c +++ b/src/plugins/rhbz.c @@ -86,22 +86,22 @@ static char *trim_all_whitespace(const char *str) return trim; }
-int is_comment_dup(GList *comments, const char *comment) +int is_comment_dup(GList *srv_comments, const char *usr_comment) {
- for (GList *l = comments; l; l = l->next)
- char *trim_usr_comment = trim_all_whitespace(usr_comment);
- for (GList *l = srv_comments; l; l = l->next) {
char *comment_body = (char *) l->data;
char *trim_comment_body = trim_all_whitespace(comment_body);
char *trim_comment = trim_all_whitespace(comment);
if (!strcmp(trim_comment_body, trim_comment))
char *srv_comment = (char *) l->data;
char *trim_srv_comment = trim_all_whitespace(srv_comment);
if (!strcmp(trim_srv_comment, trim_usr_comment)) {
free(trim_comment_body);
free(trim_comment);
free(trim_usr_comment);
free(trim_srv_comment); return 1; } }
- and here it's really not that useful, so please don't do it...
- return 0;;
return 0; }
static unsigned find_best_bt_rating_in_comments(GList *comments)
@@ -122,7 +122,7 @@ static unsigned find_best_bt_rating_in_comments(GList *comments) continue; }
start_rating_line += strlen("rating: ");
start_rating_line += strlen(FILENAME_RATING": ");
- this is the actual fix? hm... looks too *easy* ;)
char *end_rating_line = strchr(start_rating_line, '\n'); if (!end_rating_line) VERB3 error_msg("broken comment body");
Jiri Moskovcak jmoskovc@redhat.com writes:
On 02/13/2012 12:03 PM, Nikola Pajkovsky wrote:
test 'Attaching better backtrace' is broken. problem dir contains backtrace_rating 1 and servers response is backtrace_rating 3 ->> never upload.
Signed-off-by: Nikola Pajkovskynpajkovs@redhat.com
src/plugins/reporter-bugzilla.c | 16 +++++++++------- src/plugins/rhbz.c | 20 ++++++++++---------- 2 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/src/plugins/reporter-bugzilla.c b/src/plugins/reporter-bugzilla.c index cd31f5b..c49ffe2 100644 --- a/src/plugins/reporter-bugzilla.c +++ b/src/plugins/reporter-bugzilla.c @@ -402,13 +402,14 @@ int main(int argc, char **argv) strbuf_append_strf(full_desc, "%s: %s\n", FILENAME_RATING, rating_str); strbuf_append_strf(full_desc, "Package: %s\n", rhbz.b_package); /* attach the architecture only if it's different from the initial report */
if ((strcmp(bz->bi_platform, "All") != 0)&&
(strcmp(bz->bi_platform, "Unspecified") != 0)&&
(strcmp(bz->bi_platform, rhbz.b_arch) !=0))
if ((strcmp(bz->bi_platform, "All") != 0)
+&& (strcmp(bz->bi_platform, "Unspecified") != 0) +&& (strcmp(bz->bi_platform, rhbz.b_arch) !=0)) strbuf_append_strf(full_desc, "Architecture: %s\n", rhbz.b_arch); else {
VERB3 log("not adding the arch: %s because rep_plat is %s", rhbz.b_arch, bz->bi_platform);
VERB3 log("not adding the arch: %s because rep_plat is %s",
rhbz.b_arch, bz->bi_platform); } strbuf_append_strf(full_desc, "OS Release: %s\n", rhbz.b_release);
- just an indent fixes, please don't do that, it just ruins git
history, these kind of problems should be noted at the review time, once it's pushed it's too late
hmm, ok
@@ -418,8 +419,8 @@ int main(int argc, char **argv) "is_private"); */
int allow_comment = is_comment_dup(bz->bi_comments, full_desc->buf);
if (!allow_comment)
int dup_comment = is_comment_dup(bz->bi_comments, full_desc->buf);
if (!dup_comment) { log(_("Adding new comment to bug %d"), bz->bi_id); rhbz_add_comment(client, bz->bi_id, full_desc->buf, 0);
@@ -434,7 +435,8 @@ int main(int argc, char **argv) /* python doesn't have rating file */ if (rating_str) rating = xatou(rating_str);
if (!allow_comment&& (bz->bi_best_bt_rating< rating))
if (!dup_comment&& (rating> bz->bi_best_bt_rating)) {
- here it's just a variable rename, so the same as the above applies,
but since the previous name was really wrong (wasn't that mine??) I will look away and let you push it :)
it's mine stupid variable name ;)
char bug_id_str[sizeof(int)*3 + 2]; sprintf(bug_id_str, "%i", bz->bi_id);
diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c index fbf5bba..ba88110 100644 --- a/src/plugins/rhbz.c +++ b/src/plugins/rhbz.c @@ -86,22 +86,22 @@ static char *trim_all_whitespace(const char *str) return trim; }
-int is_comment_dup(GList *comments, const char *comment) +int is_comment_dup(GList *srv_comments, const char *usr_comment) {
- for (GList *l = comments; l; l = l->next)
- char *trim_usr_comment = trim_all_whitespace(usr_comment);
- for (GList *l = srv_comments; l; l = l->next) {
char *comment_body = (char *) l->data;
char *trim_comment_body = trim_all_whitespace(comment_body);
char *trim_comment = trim_all_whitespace(comment);
if (!strcmp(trim_comment_body, trim_comment))
char *srv_comment = (char *) l->data;
char *trim_srv_comment = trim_all_whitespace(srv_comment);
if (!strcmp(trim_srv_comment, trim_usr_comment)) {
free(trim_comment_body);
free(trim_comment);
free(trim_usr_comment);
free(trim_srv_comment); return 1; } }
- and here it's really not that useful, so please don't do it...
it's way better to read, but I can push another dummy commit with variable renaming
- return 0;;
return 0; }
static unsigned find_best_bt_rating_in_comments(GList *comments)
@@ -122,7 +122,7 @@ static unsigned find_best_bt_rating_in_comments(GList *comments) continue; }
start_rating_line += strlen("rating: ");
start_rating_line += strlen(FILENAME_RATING": ");
- this is the actual fix? hm... looks too *easy* ;)
yes :)
char *end_rating_line = strchr(start_rating_line, '\n'); if (!end_rating_line) VERB3 error_msg("broken comment body");
On 02/13/2012 12:03 PM, Nikola Pajkovsky wrote:
Signed-off-by: Nikola Pajkovskynpajkovs@redhat.com
src/lib/abrt_xmlrpc.c | 4 ++-- src/plugins/reporter-bugzilla.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/lib/abrt_xmlrpc.c b/src/lib/abrt_xmlrpc.c index 1741445..8bd63c8 100644 --- a/src/lib/abrt_xmlrpc.c +++ b/src/lib/abrt_xmlrpc.c @@ -22,12 +22,12 @@
void abrt_xmlrpc_die(xmlrpc_env *env) {
- error_msg_and_die("fatal: XML-RPC(%d): %s", env->fault_code, env->fault_string);
- how about: VERB2 error_msg_and_die("fatal: XML-RPC(%d)", env->fault_code); - the rest of this patch seems sane, please push it
- error_msg_and_die("fatal: %s", env->fault_string); }
void abrt_xmlrpc_error(xmlrpc_env *env) {
- error_msg("error: XML-RPC (%d): %s", env->fault_code, env->fault_string);
error_msg("error: %s", env->fault_string); }
struct abrt_xmlrpc *abrt_xmlrpc_new_client(const char *url, int ssl_verify)
diff --git a/src/plugins/reporter-bugzilla.c b/src/plugins/reporter-bugzilla.c index bc1ff69..cf33d5e 100644 --- a/src/plugins/reporter-bugzilla.c +++ b/src/plugins/reporter-bugzilla.c @@ -116,7 +116,7 @@ int main(int argc, char **argv) xmlrpc_env_init(&env); xmlrpc_client_setup_global_const(&env); if (env.fault_occurred)
error_msg_and_die("XML-RPC Fault: %s(%d)", env.fault_string, env.fault_code);
abrt_xmlrpc_die(&env); xmlrpc_env_clean(&env); const char *environ;
Jiri Moskovcak jmoskovc@redhat.com writes:
On 02/13/2012 12:03 PM, Nikola Pajkovsky wrote:
Signed-off-by: Nikola Pajkovskynpajkovs@redhat.com
src/lib/abrt_xmlrpc.c | 4 ++-- src/plugins/reporter-bugzilla.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/lib/abrt_xmlrpc.c b/src/lib/abrt_xmlrpc.c index 1741445..8bd63c8 100644 --- a/src/lib/abrt_xmlrpc.c +++ b/src/lib/abrt_xmlrpc.c @@ -22,12 +22,12 @@
void abrt_xmlrpc_die(xmlrpc_env *env) {
- error_msg_and_die("fatal: XML-RPC(%d): %s", env->fault_code, env->fault_string);
- how about: VERB2 error_msg_and_die("fatal: XML-RPC(%d)", env->fault_code);
- the rest of this patch seems sane, please push it
env->fault_code is pretty pointless debugging information and honestly, I've never used it for before.
- error_msg_and_die("fatal: %s", env->fault_string); }
void abrt_xmlrpc_error(xmlrpc_env *env) {
- error_msg("error: XML-RPC (%d): %s", env->fault_code, env->fault_string);
error_msg("error: %s", env->fault_string); }
struct abrt_xmlrpc *abrt_xmlrpc_new_client(const char *url, int ssl_verify)
diff --git a/src/plugins/reporter-bugzilla.c b/src/plugins/reporter-bugzilla.c index bc1ff69..cf33d5e 100644 --- a/src/plugins/reporter-bugzilla.c +++ b/src/plugins/reporter-bugzilla.c @@ -116,7 +116,7 @@ int main(int argc, char **argv) xmlrpc_env_init(&env); xmlrpc_client_setup_global_const(&env); if (env.fault_occurred)
error_msg_and_die("XML-RPC Fault: %s(%d)", env.fault_string, env.fault_code);
abrt_xmlrpc_die(&env); xmlrpc_env_clean(&env); const char *environ;
On 02/13/2012 02:42 PM, Nikola Pajkovsky wrote:
Jiri Moskovcakjmoskovc@redhat.com writes:
On 02/13/2012 12:03 PM, Nikola Pajkovsky wrote:
Signed-off-by: Nikola Pajkovskynpajkovs@redhat.com
src/lib/abrt_xmlrpc.c | 4 ++-- src/plugins/reporter-bugzilla.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/lib/abrt_xmlrpc.c b/src/lib/abrt_xmlrpc.c index 1741445..8bd63c8 100644 --- a/src/lib/abrt_xmlrpc.c +++ b/src/lib/abrt_xmlrpc.c @@ -22,12 +22,12 @@
void abrt_xmlrpc_die(xmlrpc_env *env) {
- error_msg_and_die("fatal: XML-RPC(%d): %s", env->fault_code, env->fault_string);
- how about: VERB2 error_msg_and_die("fatal: XML-RPC(%d)", env->fault_code);
- the rest of this patch seems sane, please push it
env->fault_code is pretty pointless debugging information and honestly, I've never used it for before.
- ok then...
- error_msg_and_die("fatal: %s", env->fault_string); }
void abrt_xmlrpc_error(xmlrpc_env *env) {
- error_msg("error: XML-RPC (%d): %s", env->fault_code, env->fault_string);
error_msg("error: %s", env->fault_string); }
struct abrt_xmlrpc *abrt_xmlrpc_new_client(const char *url, int ssl_verify)
diff --git a/src/plugins/reporter-bugzilla.c b/src/plugins/reporter-bugzilla.c index bc1ff69..cf33d5e 100644 --- a/src/plugins/reporter-bugzilla.c +++ b/src/plugins/reporter-bugzilla.c @@ -116,7 +116,7 @@ int main(int argc, char **argv) xmlrpc_env_init(&env); xmlrpc_client_setup_global_const(&env); if (env.fault_occurred)
error_msg_and_die("XML-RPC Fault: %s(%d)", env.fault_string, env.fault_code);
abrt_xmlrpc_die(&env); xmlrpc_env_clean(&env); const char *environ;
crash-catcher@lists.fedorahosted.org