[gnome-packagekit] Egg update to fix compile on FreeBSD



commit 2ef363a7866ae84f7b8a258123dd6e1ca1146b0c
Author: Richard Hughes <richard hughsie com>
Date:   Thu Aug 13 14:38:32 2009 +0100

    Egg update to fix compile on FreeBSD

 src/egg-debug.c |   11 ++++++++---
 src/egg-test.c  |   18 +++++++++++++++++-
 2 files changed, 25 insertions(+), 4 deletions(-)
---
diff --git a/src/egg-debug.c b/src/egg-debug.c
index f18a5d1..dff185e 100644
--- a/src/egg-debug.c
+++ b/src/egg-debug.c
@@ -26,6 +26,8 @@
  * This file contains functions that can be used for debugging.
  */
 
+#include "config.h"
+
 #include <glib.h>
 #include <glib/gi18n.h>
 #include <glib/gprintf.h>
@@ -39,7 +41,10 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <time.h>
+
+#ifdef HAVE_EXECINFO_H
 #include <execinfo.h>
+#endif
 
 #include "egg-debug.h"
 
@@ -78,6 +83,7 @@ pk_set_console_mode (guint console_code)
 void
 egg_debug_backtrace (void)
 {
+#ifdef HAVE_EXECINFO_H
 	void *call_stack[512];
 	int  call_stack_size;
 	char **symbols;
@@ -95,6 +101,7 @@ egg_debug_backtrace (void)
 		pk_set_console_mode (CONSOLE_RESET);
 		free (symbols);
 	}
+#endif
 }
 
 /**
@@ -131,15 +138,13 @@ pk_print_line (const gchar *func, const gchar *file, const int line, const gchar
 	gchar *str_time;
 	gchar *header;
 	time_t the_time;
-	GThread *thread;
 
 	time (&the_time);
 	str_time = g_new0 (gchar, 255);
 	strftime (str_time, 254, "%H:%M:%S", localtime (&the_time));
-	thread = g_thread_self ();
 
 	/* generate header text */
-	header = g_strdup_printf ("TI:%s\tTH:%p\tFI:%s\tFN:%s,%d", str_time, thread, file, func, line);
+	header = g_strdup_printf ("TI:%s\tFI:%s\tFN:%s,%d", str_time, file, func, line);
 	g_free (str_time);
 
 	/* always in light green */
diff --git a/src/egg-test.c b/src/egg-test.c
index ee3650e..ee79c67 100644
--- a/src/egg-test.c
+++ b/src/egg-test.c
@@ -188,7 +188,6 @@ egg_test_end (EggTest *test)
 		g_print ("Not started test! Cannot finish!\n");
 		exit (1);
 	}
-	g_print ("OK\n");
 
 	/* disable hang check */
 	if (test->hang_loop_id != 0) {
@@ -196,6 +195,18 @@ egg_test_end (EggTest *test)
 		test->hang_loop_id = 0;
 	}
 
+	/* remove all the test callbacks */
+	while (g_source_remove_by_user_data (test))
+		g_print ("WARNING: removed callback for test module");
+
+	/* check we don't have any pending iterations */
+	if (g_main_context_pending (NULL)) {
+		g_print ("WARNING: Pending event in context! Running to completion... ");
+		while (g_main_context_pending (NULL))
+			g_main_context_iteration (NULL, TRUE);
+		g_print ("Done!\n");
+	}
+
 	test->started = FALSE;
 	g_free (test->type);
 }
@@ -332,6 +343,11 @@ egg_test_get_data_file (const gchar *filename)
 	g_free (full);
 
 	/* check to see if we are being run in make check */
+	full = g_build_filename ("..", "..", "data", "tests", filename, NULL);
+	ret = g_file_test (full, G_FILE_TEST_EXISTS);
+	if (ret)
+		return full;
+	g_free (full);
 	full = g_build_filename ("..", "..", "..", "data", "tests", filename, NULL);
 	ret = g_file_test (full, G_FILE_TEST_EXISTS);
 	if (ret)



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