[bug-buddy/remove_breakpad] Remove minidump references



commit 45609204e14e267944153a1550b375284e5baf51
Author: Fernando Herrera <fherrera onirica com>
Date:   Mon May 31 15:24:13 2010 +0200

    Remove minidump references

 src/bug-buddy.c |   45 +++------------------------------------------
 src/bug-buddy.h |    3 ---
 src/bugzilla.c  |   50 ++------------------------------------------------
 src/bugzilla.h  |    1 -
 4 files changed, 5 insertions(+), 94 deletions(-)
---
diff --git a/src/bug-buddy.c b/src/bug-buddy.c
index 021e58f..ef76ca2 100644
--- a/src/bug-buddy.c
+++ b/src/bug-buddy.c
@@ -92,7 +92,6 @@ static const GOptionEntry options[] = {
 	{ "pid",        '\0', 0, G_OPTION_ARG_INT,      &gopt_data.pid,           N_("PID of crashed program"),                  N_("PID") },
 	{ "include",    '\0', 0, G_OPTION_ARG_FILENAME, &gopt_data.include_file,  N_("Text file to include in the report"),      N_("FILE") },
 	{ "unlink-tempfile", '\0', 0, G_OPTION_ARG_NONE, &gopt_data.own_file,     N_("Delete the included file after reporting"),NULL},
-	{ "minidump",   '\0', 0, G_OPTION_ARG_FILENAME, &gopt_data.minidump_file, N_("MiniDump file with info about the crash"), N_("FILE") },
 	{ "version", '\0', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, show_version_cb, NULL, NULL },
 	{ NULL }
 };
@@ -796,7 +795,7 @@ send_report (BugzillaApplication *app, GnomeVersionInfo *gnome_version, GtkBuild
 	email = gtk_entry_get_text (GTK_ENTRY (gtk_builder_get_object (ui, "email-entry")));
 	title = create_report_title (app, type, details_text);
 
-	message = bugzilla_create_report (app, type, gnome_version, email, title, final_text, ui, gopt_data.minidump_file, &err);
+	message = bugzilla_create_report (app, type, gnome_version, email, title, final_text, ui, &err);
 	if (message == NULL) {
 		char *text;
 
@@ -1150,39 +1149,6 @@ create_debuginfo_link (void)
 	return urlbutton;
 }
 
-
-static void
-add_minidump_text_output (const char *minidump_file, GtkBuilder *ui)
-{
-	GtkTextView *text_view;
-	GtkTextIter end;
-	GtkTextBuffer *buffer;
-	gchar *command_line;
-	gchar *standard_output, *standard_error;
-	gint exit_status;
-	GError *error;
-
-
-	text_view = GTK_TEXT_VIEW (gtk_builder_get_object (ui, "gdb-text"));
-	buffer = gtk_text_view_get_buffer (text_view);
-	gtk_text_buffer_get_end_iter (buffer, &end);
-
-	command_line = g_strdup_printf ("minidump_dump %s", minidump_file);
-	if (g_spawn_command_line_sync (command_line, &standard_output, &standard_error,
-				      &exit_status, &error)) {
-		gtk_text_buffer_insert (buffer, &end, standard_output, strlen (standard_output));
-		g_free (standard_output);
-		g_free (standard_error);
-	} else {
-		g_error_free (error);
-	}
-
-}
-
-
-
-
-
 static void
 useless_finished (GtkBuilder *ui)
 {
@@ -1393,10 +1359,6 @@ unknown_app_finished (GtkBuilder *ui)
 
 	fill_stderr_info (ui);
 
-	if (gopt_data.minidump_file) {
-		add_minidump_text_output (gopt_data.minidump_file, ui);
-	}
-	
 	/* don't need user input, so hide these widgets */
 	gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (ui, "final-box")));
 	gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (ui, "progressbar")));
@@ -2033,9 +1995,8 @@ main (int argc, char *argv[])
 	}	
 
 	if (gopt_data.app_file && gopt_data.pid == 0 && 
-            gopt_data.include_file == NULL && 
-            gopt_data.minidump_file == NULL) {
-		buddy_error (NULL, _("Either --pid , --include or --minidump arguments are required.\n"));	
+            gopt_data.include_file == NULL) {
+		buddy_error (NULL, _("Either --pid , --include arguments are required.\n"));	
 		return 0;
 	}
 
diff --git a/src/bug-buddy.h b/src/bug-buddy.h
index 70cb510..73fd661 100644
--- a/src/bug-buddy.h
+++ b/src/bug-buddy.h
@@ -49,9 +49,6 @@ typedef struct {
 	/* whether to own the included file */
 	gboolean own_file;
 
-	/* MiniDump file */
-	gchar *minidump_file;
-
 	/* pid to kill after the bug report */
 	int kill;
 } GOptionData;
diff --git a/src/bugzilla.c b/src/bugzilla.c
index d6d8fb6..d2dec25 100644
--- a/src/bugzilla.c
+++ b/src/bugzilla.c
@@ -438,7 +438,7 @@ bugzilla_parse_response (SoupMessage *msg, GError **err)
 SoupMessage*
 bugzilla_create_report (BugzillaApplication *app, int type, GnomeVersionInfo *gnome_version,
 		        const char *username, const char *title, const char *text,
-		        GtkBuilder *ui, const char *minidump_file, GError **err)
+		        GtkBuilder *ui, GError **err)
 {
 	SoupMessage *message;
 	const char *uri;
@@ -505,53 +505,7 @@ bugzilla_create_report (BugzillaApplication *app, int type, GnomeVersionInfo *gn
 	soup_value_hash_insert (report, "comment", G_TYPE_STRING, rv->str);
     	g_string_free (rv, TRUE);
 
-	if (minidump_file) {
-		gchar *minidumpbuf;
-		gsize length;
-		GError *error = NULL;
-		gchar *base64 = NULL;
-
-		if (g_file_get_contents (minidump_file, &minidumpbuf, &length, &error)) {
-			base64 = g_base64_encode ((guchar*)minidumpbuf, length);
-			g_free (minidumpbuf);
-		} else {
-			g_error_free (error);
-		}
-
-		if (base64) {	
-			gchar *basename;
-			gchar *id;
-			GByteArray *ba;
-
-			basename = g_path_get_basename (minidump_file);
-			id = g_strndup (basename, strlen (basename) - strlen (".dmp"));
-			
-			soup_value_hash_insert (report, "minidump-id",
-						G_TYPE_STRING, id);
-
-			/* FIXME: This is broken; for some reason
-			 * bug-buddy is base64-encoding the minidump
-			 * *twice*. (Once itself, and once by asking
-			 * libsoup to do it.) Fix this after verifying
-			 * that the server side can deal with the
-			 * fix...
-			 */
-			ba = g_byte_array_sized_new (strlen (base64));
-			g_byte_array_append (ba, (guchar *)base64, strlen (base64));
-			soup_value_hash_insert (report, "minidump",
-						SOUP_TYPE_BYTE_ARRAY, ba);
-			g_byte_array_free (ba, TRUE);
-			g_free (base64);
-			g_free (basename);
-			g_free (id);
-		}
-	}
-
-	if (minidump_file)
-		//uri = "http://localhost/breakpad/xmlrpc.py";;
-		uri = "http://socorro.gnome.org/collect.py";;
-	else 
-		uri = "http://bugzilla.gnome.org/bugbuddy.cgi";;
+	uri = "http://bugzilla.gnome.org/bugbuddy.cgi";;
 
 	message = soup_xmlrpc_request_new (uri, "BugBuddy.createBug",
 					   G_TYPE_HASH_TABLE, report,
diff --git a/src/bugzilla.h b/src/bugzilla.h
index 567206d..ae8d6fd 100644
--- a/src/bugzilla.h
+++ b/src/bugzilla.h
@@ -82,7 +82,6 @@ SoupMessage*       bugzilla_create_report  (BugzillaApplication *app,
                                             const char *title,
                                             const char *text,
                                             GtkBuilder *ui,
-					    const char *minidump_file,
                                             GError **err);
 
 #endif /* __BUGZILLA_H__ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]