From dd6e723b4bf2cf4d1229386aaeb5862de8634545 Mon Sep 17 00:00:00 2001 From: Jakub Filak Date: Aug 10 2012 11:25:46 +0000 Subject: removed unused patches --- diff --git a/0001-Add-cgroup-information-filename.patch b/0001-Add-cgroup-information-filename.patch deleted file mode 100644 index 73d6695..0000000 --- a/0001-Add-cgroup-information-filename.patch +++ /dev/null @@ -1,39 +0,0 @@ -From ea48d2cf5e703c4c72aa4c15aae72827d3da5d36 Mon Sep 17 00:00:00 2001 -From: Richard Marko -Date: Mon, 26 Mar 2012 14:37:04 +0200 -Subject: [PATCH 1/2] Add cgroup information filename - -Signed-off-by: Richard Marko -Signed-off-by: Nikola Pajkovsky ---- - src/include/internal_libreport.h | 1 + - src/lib/problem_data.c | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/src/include/internal_libreport.h b/src/include/internal_libreport.h -index 95b600b..d99d84c 100644 ---- a/src/include/internal_libreport.h -+++ b/src/include/internal_libreport.h -@@ -662,6 +662,7 @@ bool make_dir_recursive(char *dir, mode_t dir_mode); - #define FILENAME_BINARY "binary" - #define FILENAME_CMDLINE "cmdline" - #define FILENAME_COREDUMP "coredump" -+#define FILENAME_CGROUP "cgroup" - #define FILENAME_BACKTRACE "backtrace" - #define FILENAME_MAPS "maps" - #define FILENAME_SMAPS "smaps" -diff --git a/src/lib/problem_data.c b/src/lib/problem_data.c -index 2a7835a..536f7a1 100644 ---- a/src/lib/problem_data.c -+++ b/src/lib/problem_data.c -@@ -187,6 +187,7 @@ static const char *const editable_files[] = { - FILENAME_OPEN_FDS , /* user might want to hide sensitive file names */ - //FILENAME_LIMITS , - FILENAME_CMDLINE , -+ //FILENAME_CGROUP , - //FILENAME_COREDUMP , - FILENAME_BACKTRACE , - FILENAME_MAPS , --- -1.7.9.3 - diff --git a/0001-fixed-memory-leak-in-comment-dup.patch b/0001-fixed-memory-leak-in-comment-dup.patch deleted file mode 100644 index 6e1dcfe..0000000 --- a/0001-fixed-memory-leak-in-comment-dup.patch +++ /dev/null @@ -1,43 +0,0 @@ -commit f737cd88eef6c8cde03b3a317cd5ef390f0138e4 -Author: Jakub Filak -Date: Wed Apr 18 15:09:02 2012 +0200 - - trac#480 : fixed memory leak in is_comment_dup() function - - Signed-off-by: Jakub Filak - -diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c -index a3aa2ef..2e7d62c 100644 ---- a/src/plugins/rhbz.c -+++ b/src/plugins/rhbz.c -@@ -88,20 +88,19 @@ static char *trim_all_whitespace(const char *str) - - int is_comment_dup(GList *comments, const char *comment) - { -- for (GList *l = comments; l; l = l->next) -+ char * const trim_comment = trim_all_whitespace(comment); -+ bool same_comments = false; -+ -+ for (GList *l = comments; l && !same_comments; 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)) -- { -- free(trim_comment_body); -- free(trim_comment); -- return 1; -- } -+ const char * const comment_body = (const char *) l->data; -+ char * const trim_comment_body = trim_all_whitespace(comment_body); -+ same_comments = !strcmp(trim_comment_body, trim_comment); -+ free(trim_comment_body); - } - -- return 0;; -+ free(trim_comment); -+ return same_comments; - } - - static unsigned find_best_bt_rating_in_comments(GList *comments) diff --git a/0001-rhbz-820985-bz-4.2-doesn-t-have-bug_id-member-it-s-i.patch b/0001-rhbz-820985-bz-4.2-doesn-t-have-bug_id-member-it-s-i.patch deleted file mode 100644 index 461287f..0000000 --- a/0001-rhbz-820985-bz-4.2-doesn-t-have-bug_id-member-it-s-i.patch +++ /dev/null @@ -1,237 +0,0 @@ -From 386bcecdff5eeea2f0855e9b91b73f862fa11860 Mon Sep 17 00:00:00 2001 -From: Nikola Pajkovsky -Date: Mon, 14 May 2012 13:03:25 +0200 -Subject: [PATCH 1/3] rhbz#820985 - bz 4.2 doesn't have 'bug_id' member; it's - 'id' - -Signed-off-by: Nikola Pajkovsky ---- - src/plugins/rhbz.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++- - 1 file changed, 55 insertions(+), 1 deletion(-) - -diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c -index 2e7d62c..24bec16 100644 ---- a/src/plugins/rhbz.c -+++ b/src/plugins/rhbz.c -@@ -22,8 +22,20 @@ - - #define MAX_HOPS 5 - -+ -+//#define DEBUG -+#ifdef DEBUG -+#define func_entry() log("-- %s", __func__) -+#define func_entry_str(x) log("-- %s\t%s", __func__, (x)) -+#else -+#define func_entry() -+#define func_entry_str(x) -+#endif -+ - struct bug_info *new_bug_info() - { -+ func_entry(); -+ - struct bug_info *bi = xzalloc(sizeof(struct bug_info)); - bi->bi_dup_id = -1; - -@@ -32,6 +44,8 @@ struct bug_info *new_bug_info() - - void free_bug_info(struct bug_info *bi) - { -+ func_entry(); -+ - if (!bi) - return; - -@@ -47,6 +61,8 @@ void free_bug_info(struct bug_info *bi) - - static GList *parse_comments(xmlrpc_value *result_xml) - { -+ func_entry(); -+ - GList *comments = NULL; - xmlrpc_value *comments_memb = rhbz_get_member("longdescs", result_xml); - if (!comments_memb) -@@ -74,6 +90,8 @@ static GList *parse_comments(xmlrpc_value *result_xml) - - static char *trim_all_whitespace(const char *str) - { -+ func_entry(); -+ - char *trim = xzalloc(sizeof(char) * strlen(str) + 1); - int i = 0; - while (*str) -@@ -88,6 +106,8 @@ static char *trim_all_whitespace(const char *str) - - int is_comment_dup(GList *comments, const char *comment) - { -+ func_entry(); -+ - char * const trim_comment = trim_all_whitespace(comment); - bool same_comments = false; - -@@ -105,6 +125,8 @@ int is_comment_dup(GList *comments, const char *comment) - - static unsigned find_best_bt_rating_in_comments(GList *comments) - { -+ func_entry(); -+ - if (!comments) - return 0; - -@@ -148,6 +170,8 @@ static unsigned find_best_bt_rating_in_comments(GList *comments) - - void rhbz_login(struct abrt_xmlrpc *ax, struct bugzilla_struct *b) - { -+ func_entry(); -+ - xmlrpc_value* result = abrt_xmlrpc_call(ax, "User.login", "({s:s,s:s})", - "login", b->b_login, "password", b->b_password); - -@@ -162,6 +186,8 @@ void rhbz_login(struct abrt_xmlrpc *ax, struct bugzilla_struct *b) - xmlrpc_value *rhbz_search_duphash(struct abrt_xmlrpc *ax, const char *component, - const char *product, const char *duphash) - { -+ func_entry(); -+ - struct strbuf *query = strbuf_new(); - strbuf_append_strf(query, "ALL whiteboard:\"%s\"", duphash); - -@@ -181,6 +207,8 @@ xmlrpc_value *rhbz_search_duphash(struct abrt_xmlrpc *ax, const char *component, - - xmlrpc_value *rhbz_get_member(const char *member, xmlrpc_value *xml) - { -+ func_entry_str(member); -+ - xmlrpc_env env; - xmlrpc_env_init(&env); - -@@ -203,6 +231,8 @@ xmlrpc_value *rhbz_get_member(const char *member, xmlrpc_value *xml) - */ - int rhbz_array_size(xmlrpc_value *xml) - { -+ func_entry(); -+ - xmlrpc_env env; - xmlrpc_env_init(&env); - -@@ -216,6 +246,8 @@ int rhbz_array_size(xmlrpc_value *xml) - /* die or return bug id; each bug must have bug id otherwise xml is corrupted */ - int rhbz_bug_id(xmlrpc_value* xml) - { -+ func_entry(); -+ - xmlrpc_env env; - xmlrpc_env_init(&env); - -@@ -227,7 +259,7 @@ int rhbz_bug_id(xmlrpc_value* xml) - if (env.fault_occurred) - abrt_xmlrpc_die(&env); - -- bug = rhbz_get_member("bug_id", item); -+ bug = rhbz_get_member("id", item); - xmlrpc_DECREF(item); - if (!bug) - abrt_xmlrpc_die(&env); -@@ -247,6 +279,8 @@ int rhbz_bug_id(xmlrpc_value* xml) - // TODO: npajkovs: add flag to read xmlrpc_read_array_item first - void *rhbz_bug_read_item(const char *memb, xmlrpc_value *xml, int flags) - { -+ func_entry(); -+ - xmlrpc_env env; - xmlrpc_env_init(&env); - -@@ -293,6 +327,8 @@ die: - - GList *rhbz_bug_cc(xmlrpc_value* result_xml) - { -+ func_entry(); -+ - xmlrpc_env env; - xmlrpc_env_init(&env); - -@@ -335,6 +371,8 @@ GList *rhbz_bug_cc(xmlrpc_value* result_xml) - - struct bug_info *rhbz_bug_info(struct abrt_xmlrpc *ax, int bug_id) - { -+ func_entry(); -+ - struct bug_info *bz = new_bug_info(); - xmlrpc_value *xml_bug_response = abrt_xmlrpc_call(ax, "bugzilla.getBug", - "(i)", bug_id); -@@ -384,6 +422,8 @@ struct bug_info *rhbz_bug_info(struct abrt_xmlrpc *ax, int bug_id) - int rhbz_new_bug(struct abrt_xmlrpc *ax, problem_data_t *problem_data, - const char *release) - { -+ func_entry(); -+ - const char *package = get_problem_item_content_or_NULL(problem_data, - FILENAME_PACKAGE); - const char *component = get_problem_item_content_or_NULL(problem_data, -@@ -483,6 +523,8 @@ int rhbz_new_bug(struct abrt_xmlrpc *ax, problem_data_t *problem_data, - int rhbz_attach_blob(struct abrt_xmlrpc *ax, const char *filename, - const char *bug_id, const char *data, int data_len, int flags) - { -+ func_entry(); -+ - char *encoded64 = encode_base64(data, data_len); - char *fn = xasprintf("File: %s", filename); - xmlrpc_value* result; -@@ -509,6 +551,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) - { -+ func_entry(); -+ - off_t size = lseek(fd, 0, SEEK_END); - if (size < 0) - { -@@ -547,6 +591,8 @@ int rhbz_attach_fd(struct abrt_xmlrpc *ax, const char *filename, - int rhbz_attach_big_files(struct abrt_xmlrpc *ax, const char *bug_id, - problem_data_t *problem_data, int flags) - { -+ func_entry(); -+ - GHashTableIter iter; - char *name; - struct problem_item *value; -@@ -600,6 +646,8 @@ int rhbz_attach_big_files(struct abrt_xmlrpc *ax, const char *bug_id, - - void rhbz_logout(struct abrt_xmlrpc *ax) - { -+ func_entry(); -+ - xmlrpc_value* result = abrt_xmlrpc_call(ax, "User.logout", "(s)", ""); - if (result) - xmlrpc_DECREF(result); -@@ -608,6 +656,8 @@ void rhbz_logout(struct abrt_xmlrpc *ax) - struct bug_info *rhbz_find_origin_bug_closed_duplicate(struct abrt_xmlrpc *ax, - struct bug_info *bi) - { -+ func_entry(); -+ - struct bug_info *bi_tmp = new_bug_info(); - bi_tmp->bi_id = bi->bi_id; - bi_tmp->bi_dup_id = bi->bi_dup_id; -@@ -634,6 +684,8 @@ struct bug_info *rhbz_find_origin_bug_closed_duplicate(struct abrt_xmlrpc *ax, - /* suppress mail notify by {s:i} (nomail:1) */ - void rhbz_mail_to_cc(struct abrt_xmlrpc *ax, int bug_id, const char *mail, int flags) - { -+ func_entry(); -+ - xmlrpc_value *result; - int nomail_notify = IS_NOMAIL_NOTIFY(flags); - result = abrt_xmlrpc_call(ax, "Bug.update", "({s:i,s:{s:(s),s:i}})", -@@ -647,6 +699,8 @@ void rhbz_mail_to_cc(struct abrt_xmlrpc *ax, int bug_id, const char *mail, int f - void rhbz_add_comment(struct abrt_xmlrpc *ax, int bug_id, const char *comment, - int flags) - { -+ func_entry(); -+ - int private = IS_PRIVATE(flags); - int nomail_notify = IS_NOMAIL_NOTIFY(flags); - --- -1.7.10.1 - diff --git a/0001-rhbz795548-opt-out-smolt.patch b/0001-rhbz795548-opt-out-smolt.patch deleted file mode 100644 index c54beb4..0000000 --- a/0001-rhbz795548-opt-out-smolt.patch +++ /dev/null @@ -1,134 +0,0 @@ -commit f01bb3bc293f91eacb9196229746ab95580f8b58 -Author: Nikola Pajkovsky -Date: Tue Apr 3 16:31:10 2012 +0200 - - rhbz#795548 - opt kernel out of showing smolt information in abrt bug reports - - Signed-off-by: Nikola Pajkovsky - -diff --git a/src/include/internal_libreport.h b/src/include/internal_libreport.h -index d99d84c..892a70f 100644 ---- a/src/include/internal_libreport.h -+++ b/src/include/internal_libreport.h -@@ -572,6 +572,7 @@ enum { - MAKEDESC_SHOW_FILES = (1 << 0), - MAKEDESC_SHOW_MULTILINE = (1 << 1), - MAKEDESC_SHOW_ONLY_LIST = (1 << 2), -+ MAKEDESC_WHITELIST = (1 << 3), - }; - #define make_description libreport_make_description - char *make_description(problem_data_t *problem_data, char **names_to_skip, unsigned max_text_size, unsigned desc_flags); -@@ -579,6 +580,8 @@ char *make_description(problem_data_t *problem_data, char **names_to_skip, unsig - char* make_description_bz(problem_data_t *problem_data, unsigned max_text_size); - #define make_description_logger libreport_make_description_logger - char* make_description_logger(problem_data_t *problem_data, unsigned max_text_size); -+#define make_description_koops libreport_make_description_koops -+char* make_description_koops(problem_data_t *problem_data, unsigned max_text_size); - //UNUSED - //#define make_description_mailx libreport_make_description_mailx - //char* make_description_mailx(problem_data_t *problem_data); -diff --git a/src/lib/make_descr.c b/src/lib/make_descr.c -index a1a9234..68133a2 100644 ---- a/src/lib/make_descr.c -+++ b/src/lib/make_descr.c -@@ -18,7 +18,16 @@ - */ - #include "internal_libreport.h" - --char *make_description(problem_data_t *problem_data, char **names_to_skip, unsigned max_text_size, unsigned desc_flags) -+static bool rejected_name(const char *name, char **v, int flags) -+{ -+ bool r = is_in_string_list(name, v); -+ if (flags & MAKEDESC_WHITELIST) -+ r = !r; -+ return r; -+} -+ -+char *make_description(problem_data_t *problem_data, char **names_to_skip, -+ unsigned max_text_size, unsigned desc_flags) - { - struct strbuf *buf_dsc = strbuf_new(); - -@@ -42,7 +51,8 @@ char *make_description(problem_data_t *problem_data, char **names_to_skip, unsig - - /* Skip items we are not interested in */ - //TODO: optimize by doing this once, not 3 times: -- if (names_to_skip && is_in_string_list(key, names_to_skip)) -+ if (names_to_skip -+ && rejected_name(key, names_to_skip, desc_flags)) - continue; - - struct problem_item *item = g_hash_table_lookup(problem_data, key); -@@ -87,7 +97,8 @@ char *make_description(problem_data_t *problem_data, char **names_to_skip, unsig - l = l->next; - - /* Skip items we are not interested in */ -- if (names_to_skip && is_in_string_list(key, names_to_skip)) -+ if (names_to_skip -+ && rejected_name(key, names_to_skip, desc_flags)) - continue; - - struct problem_item *item = g_hash_table_lookup(problem_data, key); -@@ -144,7 +155,8 @@ char *make_description(problem_data_t *problem_data, char **names_to_skip, unsig - l = l->next; - - /* Skip items we are not interested in */ -- if (names_to_skip && is_in_string_list(key, names_to_skip)) -+ if (names_to_skip -+ && rejected_name(key, names_to_skip, desc_flags)) - continue; - - struct problem_item *item = g_hash_table_lookup(problem_data, key); -@@ -251,11 +263,6 @@ static const char *const blacklisted_items[] = { - NULL - }; - --/* -- * npajkovs: implement second part of problem (not so important) -- * https://bugzilla.redhat.com/show_bug.cgi?id=711591 -- */ -- - char* make_description_bz(problem_data_t *problem_data, unsigned max_text_size) - { - return make_description( -@@ -275,3 +282,22 @@ char* make_description_logger(problem_data_t *problem_data, unsigned max_text_si - MAKEDESC_SHOW_FILES | MAKEDESC_SHOW_MULTILINE - ); - } -+ -+/* Items we want to include to bz */ -+static const char *const whitelisted_items[] = { -+ FILENAME_CMDLINE, -+ FILENAME_BACKTRACE, -+ NULL -+}; -+ -+char* make_description_koops(problem_data_t *problem_data, unsigned max_text_size) -+{ -+ return make_description( -+ problem_data, -+ (char**)whitelisted_items, -+ max_text_size, -+ MAKEDESC_SHOW_FILES -+ | MAKEDESC_SHOW_MULTILINE -+ | MAKEDESC_WHITELIST -+ ); -+} -diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c -index 9ed3154..a3aa2ef 100644 ---- a/src/plugins/rhbz.c -+++ b/src/plugins/rhbz.c -@@ -438,7 +438,12 @@ int rhbz_new_bug(struct abrt_xmlrpc *ax, problem_data_t *problem_data, - } - char *status_whiteboard = xasprintf("abrt_hash:%s", duphash); - -- char *bz_dsc = make_description_bz(problem_data, CD_TEXT_ATT_SIZE_BZ); -+ char *bz_dsc; -+ if (analyzer && !strcmp(analyzer, "Kerneloops")) -+ bz_dsc = make_description_koops(problem_data, CD_TEXT_ATT_SIZE_BZ); -+ else -+ 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); - diff --git a/0002-bugzilla-query-bz-version-and-for-4.2-use-id-element.patch b/0002-bugzilla-query-bz-version-and-for-4.2-use-id-element.patch deleted file mode 100644 index 984cb2c..0000000 --- a/0002-bugzilla-query-bz-version-and-for-4.2-use-id-element.patch +++ /dev/null @@ -1,113 +0,0 @@ -From add5f6eed5cae2f0618707ed9c642f692426d8d7 Mon Sep 17 00:00:00 2001 -From: Nikola Pajkovsky -Date: Mon, 14 May 2012 13:53:51 +0200 -Subject: [PATCH 2/3] bugzilla: query bz version and for 4.2 use 'id' element - for getting bug number, for others use 'bug_id' - -Signed-off-by: Nikola Pajkovsky ---- - src/plugins/reporter-bugzilla.c | 8 ++++++-- - src/plugins/rhbz.c | 28 ++++++++++++++++++++++++++-- - src/plugins/rhbz.h | 3 ++- - 3 files changed, 34 insertions(+), 5 deletions(-) - -diff --git a/src/plugins/reporter-bugzilla.c b/src/plugins/reporter-bugzilla.c -index 6584f0f..3b6d168 100644 ---- a/src/plugins/reporter-bugzilla.c -+++ b/src/plugins/reporter-bugzilla.c -@@ -168,8 +168,10 @@ int main(int argc, char **argv) - int all_bugs_size = rhbz_array_size(all_bugs); - if (all_bugs_size > 0) - { -- int bug_id = rhbz_bug_id(all_bugs); -+ char *rhbz_ver = rhbz_version(client); -+ int bug_id = rhbz_bug_id(all_bugs, rhbz_ver); - printf("%i", bug_id); -+ free(rhbz_ver); - } - - exit(EXIT_SUCCESS); -@@ -357,9 +359,11 @@ int main(int argc, char **argv) - } - else - { -- int bug_id = rhbz_bug_id(all_bugs); -+ char *rhbz_ver = rhbz_version(client); -+ int bug_id = rhbz_bug_id(all_bugs, rhbz_ver); - xmlrpc_DECREF(all_bugs); - bz = rhbz_bug_info(client, bug_id); -+ free(rhbz_ver); - } - } - else -diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c -index 24bec16..df2838f 100644 ---- a/src/plugins/rhbz.c -+++ b/src/plugins/rhbz.c -@@ -243,8 +243,26 @@ int rhbz_array_size(xmlrpc_value *xml) - return size; - } - -+ -+char *rhbz_version(struct abrt_xmlrpc *ax) -+{ -+ func_entry(); -+ -+ xmlrpc_value *result; -+ result = abrt_xmlrpc_call(ax, "Bugzilla.version", "()"); -+ -+ char *version = NULL; -+ if (result) -+ { -+ version = rhbz_bug_read_item("version", result, RHBZ_READ_STR); -+ xmlrpc_DECREF(result); -+ } -+ -+ return version; -+} -+ - /* die or return bug id; each bug must have bug id otherwise xml is corrupted */ --int rhbz_bug_id(xmlrpc_value* xml) -+int rhbz_bug_id(xmlrpc_value* xml, const char *ver) - { - func_entry(); - -@@ -259,7 +277,13 @@ int rhbz_bug_id(xmlrpc_value* xml) - if (env.fault_occurred) - abrt_xmlrpc_die(&env); - -- bug = rhbz_get_member("id", item); -+ char *id; -+ if (!prefixcmp(ver, "4.2")) -+ id = "id"; -+ else -+ id = "bug_id"; -+ -+ bug = rhbz_get_member(id, item); - xmlrpc_DECREF(item); - if (!bug) - abrt_xmlrpc_die(&env); -diff --git a/src/plugins/rhbz.h b/src/plugins/rhbz.h -index c9023e9..85bcca1 100644 ---- a/src/plugins/rhbz.h -+++ b/src/plugins/rhbz.h -@@ -97,7 +97,7 @@ xmlrpc_value *rhbz_get_member(const char *member, xmlrpc_value *xml); - - int rhbz_array_size(xmlrpc_value *xml); - --int rhbz_bug_id(xmlrpc_value *xml); -+int rhbz_bug_id(xmlrpc_value *xml, const char *ver); - - int rhbz_new_bug(struct abrt_xmlrpc *ax, problem_data_t *problem_data, - const char *release); -@@ -120,6 +120,7 @@ struct bug_info *rhbz_bug_info(struct abrt_xmlrpc *ax, int bug_id); - - struct bug_info *rhbz_find_origin_bug_closed_duplicate(struct abrt_xmlrpc *ax, - struct bug_info *bi); -+char *rhbz_version(struct abrt_xmlrpc *ax); - - #ifdef __cplusplus - } --- -1.7.10.1 -