[libopensync-plugin-evolution2/f18] Add patch to build against latest evolution-data-server

Milan Crha mcrha at fedoraproject.org
Wed Aug 29 13:27:13 UTC 2012


commit 56f87bd389338942b04023a55b120ae405c3476a
Author: Milan Crha <mcrha at redhat.com>
Date:   Wed Aug 29 15:27:03 2012 +0200

    Add patch to build against latest evolution-data-server

 libopensync-plugin-evolution2-0.22-eds.patch |  572 ++++++++++++++++++++++++++
 libopensync-plugin-evolution2.spec           |   10 +-
 2 files changed, 579 insertions(+), 3 deletions(-)
---
diff --git a/libopensync-plugin-evolution2-0.22-eds.patch b/libopensync-plugin-evolution2-0.22-eds.patch
new file mode 100644
index 0000000..4379f0c
--- /dev/null
+++ b/libopensync-plugin-evolution2-0.22-eds.patch
@@ -0,0 +1,572 @@
+diff -up libopensync-plugin-evolution2-0.22/src/evo2_sync.h.eds libopensync-plugin-evolution2-0.22/src/evo2_sync.h
+--- libopensync-plugin-evolution2-0.22/src/evo2_sync.h.eds	2007-03-27 13:49:55.000000000 +0200
++++ libopensync-plugin-evolution2-0.22/src/evo2_sync.h	2012-08-29 15:05:54.078490034 +0200
+@@ -1,4 +1,4 @@
+ typedef struct evo2_location {
+ 	char *name;
+-	char *uri;
++	char *uid;
+ } evo2_location;
+diff -up libopensync-plugin-evolution2-0.22/src/evolution2_ebook.c.eds libopensync-plugin-evolution2-0.22/src/evolution2_ebook.c
+--- libopensync-plugin-evolution2-0.22/src/evolution2_ebook.c.eds	2007-03-27 13:49:55.000000000 +0200
++++ libopensync-plugin-evolution2-0.22/src/evolution2_ebook.c	2012-08-29 15:05:54.078490034 +0200
+@@ -23,45 +23,52 @@
+ osync_bool evo2_addrbook_open(evo_environment *env, OSyncError **error)
+ {
+ 	osync_trace(TRACE_ENTRY, "%s(%p, %p)", __func__, env, error);
+-	GError *gerror = NULL;
+-	ESourceList *sources = NULL;
++	ESourceRegistry *registry = NULL;
+ 	ESource *source = NULL;
++	GError *gerror = NULL;
+ 
+-	if (!env->addressbook_path) {
+-		osync_error_set(error, OSYNC_ERROR_GENERIC, "no addressbook path set");
++	if (!env->addressbook_uid) {
++		osync_error_set(error, OSYNC_ERROR_GENERIC, "no addressbook uid set");
+ 		osync_trace(TRACE_EXIT_ERROR, "EVO2-SYNC: %s: %s", __func__, osync_error_print(error));
+ 		return FALSE;
+ 	}
+ 
+-	if (strcmp(env->addressbook_path, "default")) {
+-		if (!e_book_get_addressbooks(&sources, NULL)) {
+-	  		osync_error_set(error, OSYNC_ERROR_GENERIC, "Error getting addressbooks: %s", gerror ? gerror->message : "None");
+-			osync_trace(TRACE_EXIT_ERROR, "EVO2-SYNC: %s: %s", __func__, osync_error_print(error));
+-			g_clear_error(&gerror);
+-			return FALSE;
+-		}
+-		
+-		if (!(source = evo2_find_source(sources, env->addressbook_path))) {
+-			osync_error_set(error, OSYNC_ERROR_GENERIC, "Error finding source \"%s\"", env->addressbook_path);
+-			osync_trace(TRACE_EXIT_ERROR, "EVO2-SYNC: %s: %s", __func__, osync_error_print(error));
+-			return FALSE;
+-		}
+-		
+-		if (!(env->addressbook = e_book_new(source, &gerror))) {
+-			osync_error_set(error, OSYNC_ERROR_GENERIC, "Failed to alloc new addressbook: %s", gerror ? gerror->message : "None");
++	registry = e_source_registry_new_sync (NULL, &gerror);
++	if (!registry) {
++		osync_error_set(error, OSYNC_ERROR_GENERIC, "Error getting source registry: %s", gerror ? gerror->message : "None");
++		osync_trace(TRACE_EXIT_ERROR, "EVO2-SYNC: %s: %s", __func__, osync_error_print(error));
++		g_clear_error(&gerror);
++		return FALSE;
++	}
++
++	if (strcmp(env->addressbook_uid, "default")) {
++		source = e_source_registry_ref_source (registry, env->addressbook_uid);
++		if (!source) {
++			osync_error_set(error, OSYNC_ERROR_GENERIC, "Error finding source \"%s\"", env->addressbook_uid);
+ 			osync_trace(TRACE_EXIT_ERROR, "EVO2-SYNC: %s: %s", __func__, osync_error_print(error));
+-			g_clear_error(&gerror);
++			g_object_unref (registry);
+ 			return FALSE;
+ 		}
+ 	} else {
+ 		osync_trace(TRACE_INTERNAL, "Opening default addressbook\n");
+-		if (!(env->addressbook = e_book_new_default_addressbook(&gerror))) {
+-			osync_error_set(error, OSYNC_ERROR_GENERIC, "Failed to alloc new default addressbook: %s", gerror ? gerror->message : "None");
++		source = e_source_registry_ref_default_address_book (registry);
++		if (!source) {
++			osync_error_set(error, OSYNC_ERROR_GENERIC, "Failed to find default addressbook: %s", gerror ? gerror->message : "None");
+ 			osync_trace(TRACE_EXIT_ERROR, "EVO2-SYNC: %s: %s", __func__, osync_error_print(error));
+ 			g_clear_error(&gerror);
++			g_object_unref (registry);
+ 			return FALSE;
+ 		}
+ 	}
++
++	if (!(env->addressbook = e_book_new(source, &gerror))) {
++		osync_error_set(error, OSYNC_ERROR_GENERIC, "Failed to alloc new addressbook: %s", gerror ? gerror->message : "None");
++		osync_trace(TRACE_EXIT_ERROR, "EVO2-SYNC: %s: %s", __func__, osync_error_print(error));
++		g_clear_error(&gerror);
++		g_object_unref (source);
++		g_object_unref (registry);
++		return FALSE;
++	}
+ 	
+ 	if (!e_book_open(env->addressbook, TRUE, &gerror)) {
+ 		osync_error_set(error, OSYNC_ERROR_GENERIC, "Failed to alloc new addressbook: %s", gerror ? gerror->message : "None");
+@@ -69,13 +76,17 @@ osync_bool evo2_addrbook_open(evo_enviro
+ 		g_object_unref(env->addressbook);
+ 		env->addressbook = NULL;
+ 		osync_trace(TRACE_EXIT_ERROR, "EVO2-SYNC: %s: %s", __func__, osync_error_print(error));
++		g_object_unref (source);
++		g_object_unref (registry);
+ 		return FALSE;
+ 	}
+ 	
+-	if (!osync_anchor_compare(env->member, "contact", env->addressbook_path))
++	if (!osync_anchor_compare(env->member, "contact", env->addressbook_uid))
+ 		osync_member_set_slow_sync(env->member, "contact", TRUE);
+ 	
+ 	osync_trace(TRACE_EXIT, "%s", __func__);
++	g_object_unref (source);
++	g_object_unref (registry);
+ 	return TRUE;
+ }
+ 
+diff -up libopensync-plugin-evolution2-0.22/src/evolution2_ecal.c.eds libopensync-plugin-evolution2-0.22/src/evolution2_ecal.c
+--- libopensync-plugin-evolution2-0.22/src/evolution2_ecal.c.eds	2007-03-27 13:49:55.000000000 +0200
++++ libopensync-plugin-evolution2-0.22/src/evolution2_ecal.c	2012-08-29 15:05:54.113490420 +0200
+@@ -23,55 +23,64 @@
+ osync_bool evo2_calendar_open(evo_environment *env, OSyncError **error)
+ {
+ 	osync_trace(TRACE_ENTRY, "%s(%p)", __func__, env);
+-	ESourceList *sources = NULL;
++	ESourceRegistry *registry = NULL;
+ 	ESource *source = NULL;
+ 	GError *gerror = NULL;
+ 	
+-	
+-	if (strcmp(env->calendar_path, "default")) {
+-	  	if (!e_cal_get_sources(&sources, E_CAL_SOURCE_TYPE_EVENT, &gerror)) {
+-	  		osync_error_set(error, OSYNC_ERROR_GENERIC, "Unable to get sources for calendar: %s", gerror ? gerror->message : "None");
+-			osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error));
+-			g_clear_error(&gerror);
+-			return FALSE;
+-		}
+-		
+-		source = evo2_find_source(sources, env->calendar_path);
++	registry = e_source_registry_new_sync (NULL, &gerror);
++	if (!registry) {
++		osync_error_set(error, OSYNC_ERROR_GENERIC, "Error getting source registry: %s", gerror ? gerror->message : "None");
++		osync_trace(TRACE_EXIT_ERROR, "EVO2-SYNC: %s: %s", __func__, osync_error_print(error));
++		g_clear_error(&gerror);
++		return FALSE;
++	}
++
++	if (strcmp(env->calendar_uid, "default")) {
++		source = e_source_registry_ref_source (registry, env->calendar_uid);
+ 		if (!source) {
+ 	  		osync_error_set(error, OSYNC_ERROR_GENERIC, "Unable to find source for calendar");
+ 			osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error));
+-			return FALSE;
+-		}
+-		
+-		env->calendar = e_cal_new(source, E_CAL_SOURCE_TYPE_EVENT);
+-		if(!env->calendar) {
+-	  		osync_error_set(error, OSYNC_ERROR_GENERIC, "Failed to create new calendar");
+-			osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error));
+-			return FALSE;
+-		}
+-		
+-		if(!e_cal_open(env->calendar, FALSE, &gerror)) {
+-	  		osync_error_set(error, OSYNC_ERROR_GENERIC, "Failed to open calendar: %s", gerror ? gerror->message : "None");
+-			g_object_unref(env->calendar);
+-			env->calendar = NULL;
+-			osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error));
+-			g_clear_error(&gerror);
++			g_object_unref (registry);
+ 			return FALSE;
+ 		}
+ 	} else {
+-		if (!e_cal_open_default (&env->calendar, E_CAL_SOURCE_TYPE_EVENT, NULL, NULL, &gerror)) {
+-	  		osync_error_set(error, OSYNC_ERROR_GENERIC, "Failed to open default calendar: %s", gerror ? gerror->message : "None");
++		source = e_source_registry_ref_default_calendar (registry);
++		if (!source) {
++	  		osync_error_set(error, OSYNC_ERROR_GENERIC, "Failed to find default calendar: %s", gerror ? gerror->message : "None");
+ 			env->calendar = NULL;
+ 			osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error));
+ 			g_clear_error(&gerror);
++			g_object_unref (registry);
+ 			return FALSE;
+ 		}
+ 	}
++
++	env->calendar = e_cal_new(source, E_CAL_SOURCE_TYPE_EVENT);
++	if(!env->calendar) {
++		osync_error_set(error, OSYNC_ERROR_GENERIC, "Failed to create new calendar");
++		osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error));
++		g_object_unref (source);
++		g_object_unref (registry);
++		return FALSE;
++	}
++	
++	if(!e_cal_open(env->calendar, FALSE, &gerror)) {
++		osync_error_set(error, OSYNC_ERROR_GENERIC, "Failed to open calendar: %s", gerror ? gerror->message : "None");
++		g_object_unref(env->calendar);
++		env->calendar = NULL;
++		osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error));
++		g_clear_error(&gerror);
++		g_object_unref (source);
++		g_object_unref (registry);
++		return FALSE;
++	}
+ 	
+-	if (!osync_anchor_compare(env->member, "event", env->calendar_path))
++	if (!osync_anchor_compare(env->member, "event", env->calendar_uid))
+ 		osync_member_set_slow_sync(env->member, "event", TRUE);
+ 	
+ 	osync_trace(TRACE_EXIT, "%s", __func__);
++	g_object_unref (source);
++	g_object_unref (registry);
+ 	return TRUE;
+ }
+ 
+diff -up libopensync-plugin-evolution2-0.22/src/evolution2_etodo.c.eds libopensync-plugin-evolution2-0.22/src/evolution2_etodo.c
+--- libopensync-plugin-evolution2-0.22/src/evolution2_etodo.c.eds	2007-03-27 13:49:55.000000000 +0200
++++ libopensync-plugin-evolution2-0.22/src/evolution2_etodo.c	2012-08-29 15:05:54.135490660 +0200
+@@ -23,54 +23,64 @@
+ osync_bool evo2_todo_open(evo_environment *env, OSyncError **error)
+ {
+ 	osync_trace(TRACE_ENTRY, "%s(%p)", __func__, env);
+-	ESourceList *sources = NULL;
++	ESourceRegistry *registry = NULL;
+ 	ESource *source = NULL;
+ 	GError *gerror = NULL;
+ 	
+-	if (strcmp(env->tasks_path, "default")) {
+-	  	if (!e_cal_get_sources(&sources, E_CAL_SOURCE_TYPE_TODO, &gerror)) {
+-	  		osync_error_set(error, OSYNC_ERROR_GENERIC, "Unable to get sources for tasks: %s", gerror ? gerror->message : "None");
+-			osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error));
+-			g_clear_error(&gerror);
+-			return FALSE;
+-		}
+-		
+-		source = evo2_find_source(sources, env->tasks_path);
++	registry = e_source_registry_new_sync (NULL, &gerror);
++	if (!registry) {
++		osync_error_set(error, OSYNC_ERROR_GENERIC, "Error getting source registry: %s", gerror ? gerror->message : "None");
++		osync_trace(TRACE_EXIT_ERROR, "EVO2-SYNC: %s: %s", __func__, osync_error_print(error));
++		g_clear_error(&gerror);
++		return FALSE;
++	}
++
++	if (strcmp(env->tasks_uid, "default")) {
++		source = e_source_registry_ref_source (registry, env->tasks_uid);
+ 		if (!source) {
+ 	  		osync_error_set(error, OSYNC_ERROR_GENERIC, "Unable to find source for tasks");
+ 			osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error));
+-			return FALSE;
+-		}
+-		
+-		env->tasks = e_cal_new(source, E_CAL_SOURCE_TYPE_TODO);
+-		if(!env->tasks) {
+-	  		osync_error_set(error, OSYNC_ERROR_GENERIC, "Failed to create new tasks");
+-			osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error));
+-			return FALSE;
+-		}
+-		
+-		if(!e_cal_open(env->tasks, FALSE, &gerror)) {
+-	  		osync_error_set(error, OSYNC_ERROR_GENERIC, "Failed to open tasks: %s", gerror ? gerror->message : "None");
+-			g_object_unref(env->tasks);
+-			env->tasks = NULL;
+-			osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error));
+-			g_clear_error(&gerror);
++			g_object_unref (registry);
+ 			return FALSE;
+ 		}
+ 	} else {
+-		if (!e_cal_open_default (&env->tasks, E_CAL_SOURCE_TYPE_TODO, NULL, NULL, &gerror)) {
+-	  		osync_error_set(error, OSYNC_ERROR_GENERIC, "Failed to open default tasks: %s", gerror ? gerror->message : "None");
++		source = e_source_registry_ref_default_task_list (registry);
++		if (!source) {
++	  		osync_error_set(error, OSYNC_ERROR_GENERIC, "Failed to find default task list: %s", gerror ? gerror->message : "None");
+ 			env->calendar = NULL;
+ 			osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error));
+ 			g_clear_error(&gerror);
++			g_object_unref (registry);
+ 			return FALSE;
+ 		}
+ 	}
+ 	
+-	if (!osync_anchor_compare(env->member, "todo", env->tasks_path))
++	env->tasks = e_cal_new(source, E_CAL_SOURCE_TYPE_TODO);
++	if(!env->tasks) {
++		osync_error_set(error, OSYNC_ERROR_GENERIC, "Failed to create new tasks");
++		osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error));
++		g_object_unref (source);
++		g_object_unref (registry);
++		return FALSE;
++	}
++	
++	if(!e_cal_open(env->tasks, FALSE, &gerror)) {
++		osync_error_set(error, OSYNC_ERROR_GENERIC, "Failed to open tasks: %s", gerror ? gerror->message : "None");
++		g_object_unref(env->tasks);
++		env->tasks = NULL;
++		osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error));
++		g_clear_error(&gerror);
++		g_object_unref (source);
++		g_object_unref (registry);
++		return FALSE;
++	}
++
++	if (!osync_anchor_compare(env->member, "todo", env->tasks_uid))
+ 		osync_member_set_slow_sync(env->member, "todo", TRUE);
+ 	
+ 	osync_trace(TRACE_EXIT, "%s", __func__);
++	g_object_unref (source);
++	g_object_unref (registry);
+ 	return TRUE;
+ }
+ 
+diff -up libopensync-plugin-evolution2-0.22/src/evolution2_sync.c.eds libopensync-plugin-evolution2-0.22/src/evolution2_sync.c
+--- libopensync-plugin-evolution2-0.22/src/evolution2_sync.c.eds	2007-03-27 13:49:55.000000000 +0200
++++ libopensync-plugin-evolution2-0.22/src/evolution2_sync.c	2012-08-29 15:05:54.136490672 +0200
+@@ -20,99 +20,45 @@
+  
+ #include "evolution2_sync.h"
+ 
+-GList *evo2_list_calendars(evo_environment *env, void *data, OSyncError **error)
++static GList *evo2_list_sources (evo_environment *env, void *data, OSyncError **error, const gchar *extension_name)
+ {
+-	GList *paths = NULL;
+-	ESourceList *sources = NULL;
+-	ESource *source = NULL;
+-	osync_bool first = FALSE;
+-	
+-	if (!e_cal_get_sources(&sources, E_CAL_SOURCE_TYPE_EVENT, NULL)) {
+-		osync_error_set(error, OSYNC_ERROR_GENERIC, "Unable to list calendars. Unable to get sources");
++	GList *paths = NULL, *sources, *s;
++	ESourceRegistry *registry;
++
++	registry = e_source_registry_new_sync (NULL, NULL);
++	if (!registry) {
++		osync_error_set(error, OSYNC_ERROR_GENERIC, "Unable to open source registry");
+ 		return NULL;
+ 	}
+ 
+-	GSList *g = NULL;
+-	for (g = e_source_list_peek_groups (sources); g; g = g->next) {
+-		ESourceGroup *group = E_SOURCE_GROUP (g->data);
+-		GSList *s = NULL;
+-		for (s = e_source_group_peek_sources (group); s; s = s->next) {
+-			source = E_SOURCE (s->data);
+-			evo2_location *path = g_malloc0(sizeof(evo2_location));
+-			if (!first) {
+-				first = TRUE;
+-				path->uri = g_strdup("default");
+-			} else {
+-				path->uri = g_strdup(e_source_get_uri(source));
+-			}
+-			path->name = g_strdup(e_source_peek_name(source));
+-			paths = g_list_append(paths, path);
+-		}
++	sources = e_source_registry_list_sources (registry, extension_name);
++	for (s = sources; s; s = s->next) {
++		ESource *source = E_SOURCE (s->data);
++		evo2_location *path = g_malloc0(sizeof(evo2_location));
++		path->uid = e_source_dup_uid(source);
++		path->name = e_source_dup_display_name(source);
++		paths = g_list_append(paths, path);
+ 	}
++
++	g_list_free_full (sources, g_object_unref);
++	g_object_unref (registry);
++
+ 	return paths;
+ }
+ 
+-GList *evo2_list_tasks(evo_environment *env, void *data, OSyncError **error)
++GList *evo2_list_calendars(evo_environment *env, void *data, OSyncError **error)
+ {
+-	GList *paths = NULL;
+-	ESourceList *sources = NULL;
+-	ESource *source = NULL;
+-	osync_bool first = FALSE;
+-	
+-	if (!e_cal_get_sources(&sources, E_CAL_SOURCE_TYPE_TODO, NULL)) {
+-		osync_error_set(error, OSYNC_ERROR_GENERIC, "Unable to list tasks. Unable to get sources");
+-		return NULL;
+-	}
++	return evo2_list_sources (env, data, error, E_SOURCE_EXTENSION_CALENDAR);
++}
+ 
+-	GSList *g = NULL;
+-	for (g = e_source_list_peek_groups (sources); g; g = g->next) {
+-		ESourceGroup *group = E_SOURCE_GROUP (g->data);
+-		GSList *s = NULL;
+-		for (s = e_source_group_peek_sources (group); s; s = s->next) {
+-			source = E_SOURCE (s->data);
+-			evo2_location *path = g_malloc0(sizeof(evo2_location));
+-			if (!first) {
+-				first = TRUE;
+-				path->uri = g_strdup("default");
+-			} else {
+-				path->uri = g_strdup(e_source_get_uri(source));
+-			}
+-			path->name = g_strdup(e_source_peek_name(source));
+-			paths = g_list_append(paths, path);
+-		}
+-	}
+-	return paths;
++GList *evo2_list_tasks(evo_environment *env, void *data, OSyncError **error)
++{
++	return evo2_list_sources (env, data, error, E_SOURCE_EXTENSION_TASK_LIST);
+ }
+ 
+ GList *evo2_list_addressbooks(evo_environment *env, void *data, OSyncError **error)
+ {
+-	GList *paths = NULL;
+-	ESourceList *sources = NULL;
+-	ESource *source = NULL;
+-	osync_bool first = FALSE;
+-	if (!e_book_get_addressbooks(&sources, NULL)) {
+-		osync_error_set(error, OSYNC_ERROR_GENERIC, "Unable to list addressbooks. Unable to get sources");
+-		return NULL;
+-    }
+-
+-	GSList *g = NULL;
+-	for (g = e_source_list_peek_groups (sources); g; g = g->next) {
+-		ESourceGroup *group = E_SOURCE_GROUP (g->data);
+-		GSList *s = NULL;
+-		for (s = e_source_group_peek_sources (group); s; s = s->next) {
+-			source = E_SOURCE (s->data);
+-			evo2_location *path = g_malloc0(sizeof(evo2_location));
+-			if (!first) {
+-				first = TRUE;
+-				path->uri = g_strdup("default");
+-			} else {
+-				path->uri = g_strdup(e_source_get_uri(source));
+-			}
+-			path->name = g_strdup(e_source_peek_name(source));
+-			paths = g_list_append(paths, path);
+-		}
+-	}
+-	return paths;
++	return evo2_list_sources (env, data, error, E_SOURCE_EXTENSION_ADDRESS_BOOK);
+ }
+ 
+ static void *evo2_initialize(OSyncMember *member, OSyncError **error)
+@@ -146,21 +92,6 @@ static void *evo2_initialize(OSyncMember
+ 		return NULL;
+ }
+ 
+-ESource *evo2_find_source(ESourceList *list, char *uri)
+-{
+-	GSList *g;
+-	for (g = e_source_list_peek_groups (list); g; g = g->next) {
+-		ESourceGroup *group = E_SOURCE_GROUP (g->data);
+-		GSList *s;
+-		for (s = e_source_group_peek_sources (group); s; s = s->next) {
+-			ESource *source = E_SOURCE (s->data);
+-			if (!strcmp(e_source_get_uri(source), uri))
+-				return source;
+-		}
+-	}
+-	return NULL;
+-}
+-
+ static void evo2_connect(OSyncContext *ctx)
+ {
+ 	osync_trace(TRACE_ENTRY, "EVO2-SYNC: %s(%p)", __func__, ctx);
+@@ -168,7 +99,7 @@ static void evo2_connect(OSyncContext *c
+ 	evo_environment *env = (evo_environment *)osync_context_get_plugin_data(ctx);
+ 	osync_bool open_any = FALSE;
+ 	
+-	if (osync_member_objtype_enabled(env->member, "contact") &&  env->addressbook_path && strlen(env->addressbook_path)) {
++	if (osync_member_objtype_enabled(env->member, "contact") &&  env->addressbook_uid && strlen(env->addressbook_uid)) {
+ 		if (evo2_addrbook_open(env, &error))
+ 			open_any = TRUE;
+ 		else {
+@@ -178,7 +109,7 @@ static void evo2_connect(OSyncContext *c
+ 		}
+ 	}
+ 	
+-	if (osync_member_objtype_enabled(env->member, "event") &&  env->calendar_path && strlen(env->calendar_path)) {
++	if (osync_member_objtype_enabled(env->member, "event") &&  env->calendar_uid && strlen(env->calendar_uid)) {
+ 		if (evo2_calendar_open(env, &error))
+ 			open_any = TRUE;
+ 		else {
+@@ -188,7 +119,7 @@ static void evo2_connect(OSyncContext *c
+ 		}
+ 	}
+ 
+-	if (osync_member_objtype_enabled(env->member, "todo") &&  env->tasks_path && strlen(env->tasks_path)) {
++	if (osync_member_objtype_enabled(env->member, "todo") &&  env->tasks_uid && strlen(env->tasks_uid)) {
+ 		if (evo2_todo_open(env, &error))
+ 			open_any = TRUE;
+ 		else {
+@@ -247,17 +178,17 @@ static void evo2_sync_done(OSyncContext
+ 	GList *changes;
+ 	
+ 	if (env->addressbook) {
+-		osync_anchor_update(env->member, "contact", env->addressbook_path);
++		osync_anchor_update(env->member, "contact", env->addressbook_uid);
+ 		e_book_get_changes(env->addressbook, env->change_id, &changes, NULL);
+ 	}
+ 	
+ 	if (env->calendar) {
+-		osync_anchor_update(env->member, "event", env->calendar_path);
++		osync_anchor_update(env->member, "event", env->calendar_uid);
+ 		e_cal_get_changes(env->calendar, env->change_id, &changes, NULL);
+ 	}
+ 	
+ 	if (env->tasks) {
+-		osync_anchor_update(env->member, "todo", env->tasks_path);
++		osync_anchor_update(env->member, "todo", env->tasks_uid);
+ 		e_cal_get_changes(env->tasks, env->change_id, &changes, NULL);
+ 	}
+ 	
+diff -up libopensync-plugin-evolution2-0.22/src/evolution2_sync.h.eds libopensync-plugin-evolution2-0.22/src/evolution2_sync.h
+--- libopensync-plugin-evolution2-0.22/src/evolution2_sync.h.eds	2007-03-27 13:49:55.000000000 +0200
++++ libopensync-plugin-evolution2-0.22/src/evolution2_sync.h	2012-08-29 15:05:54.137490683 +0200
+@@ -4,9 +4,8 @@
+ #include "evo2_sync.h"
+ 
+ #include <opensync/opensync.h>
+-#include <libecal/e-cal.h>
+-#include <libebook/e-book.h>
+-#include <libebook/e-vcard.h>
++#include <libecal/libecal.h>
++#include <libebook/libebook.h>
+ 
+ #include <libxml/xmlmemory.h>
+ #include <libxml/parser.h>
+@@ -21,16 +20,15 @@ typedef struct {
+ 	OSyncMember *member;
+ 	char *change_id;
+ 	char *configfile;
+-	char *addressbook_path;
++	char *addressbook_uid;
+ 	EBook *addressbook;
+-	char *calendar_path;
++	char *calendar_uid;
+ 	ECal *calendar;
+-	char *tasks_path;
++	char *tasks_uid;
+ 	ECal *tasks;
+ 	int debuglevel;
+ } evo_environment;
+ 
+-ESource *evo2_find_source(ESourceList *list, char *uri);
+ void evo2_report_change(OSyncContext *ctx, char *objtypestr, char *objformatstr, char *data, int datasize, const char *uid, OSyncChangeType type);
+ 
+ #include "evolution2_ebook.h"
+diff -up libopensync-plugin-evolution2-0.22/src/evolution2_xml.c.eds libopensync-plugin-evolution2-0.22/src/evolution2_xml.c
+--- libopensync-plugin-evolution2-0.22/src/evolution2_xml.c.eds	2007-03-27 13:49:55.000000000 +0200
++++ libopensync-plugin-evolution2-0.22/src/evolution2_xml.c	2012-08-29 15:05:54.138490694 +0200
+@@ -28,9 +28,9 @@ osync_bool evo2_parse_settings(evo_envir
+ 	osync_debug("EVO2-SYNC", 4, "start: %s", __func__);
+ 
+ 	//set defaults
+-	env->addressbook_path = NULL;
+-	env->calendar_path = NULL;
+-	env->tasks_path = NULL;
++	env->addressbook_uid = NULL;
++	env->calendar_uid = NULL;
++	env->tasks_uid = NULL;
+ 
+ 	doc = xmlParseMemory(data, size);
+ 
+@@ -58,14 +58,14 @@ osync_bool evo2_parse_settings(evo_envir
+ 	while (cur != NULL) {
+ 		char *str = (char*)xmlNodeGetContent(cur);
+ 		if (str) {
+-			if (!xmlStrcmp(cur->name, (const xmlChar *)"address_path")) {
+-				env->addressbook_path = g_strdup(str);
++			if (!xmlStrcmp(cur->name, (const xmlChar *)"address_uid")) {
++				env->addressbook_uid = g_strdup(str);
+ 			}
+-			if (!xmlStrcmp(cur->name, (const xmlChar *)"calendar_path")) {
+-				env->calendar_path = g_strdup(str);
++			if (!xmlStrcmp(cur->name, (const xmlChar *)"calendar_uid")) {
++				env->calendar_uid = g_strdup(str);
+ 			}
+-			if (!xmlStrcmp(cur->name, (const xmlChar *)"tasks_path")) {
+-				env->tasks_path = g_strdup(str);	
++			if (!xmlStrcmp(cur->name, (const xmlChar *)"tasks_uid")) {
++				env->tasks_uid = g_strdup(str);	
+ 			}
+ 			xmlFree(str);
+ 		}
diff --git a/libopensync-plugin-evolution2.spec b/libopensync-plugin-evolution2.spec
index 003b0e5..c3d4fb5 100644
--- a/libopensync-plugin-evolution2.spec
+++ b/libopensync-plugin-evolution2.spec
@@ -1,14 +1,14 @@
 Name:           libopensync-plugin-evolution2
 Epoch:          1
 Version:        0.22
-Release:        25%{?dist}
+Release:        26%{?dist}
 Summary:        Evolution 2 plugin for libopensync
 
 Group:          System Environment/Libraries
 License:        LGPLv2+
 URL:            http://www.opensync.org
 Source0:        http://www.opensync.org/download/releases/%{version}/%{name}-%{version}.tar.bz2
-Patch1:         %{name}-include.patch
+Patch1:         %{name}-0.22-eds.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  libopensync-devel = 1:0.22
@@ -23,7 +23,7 @@ Provides:  libopensync-plugin-evolution2-devel = 0:0.35
 %prep
 %setup -q
 
-%patch1 -p1 -b include
+%patch1 -p1 -b .eds
 
 %build
 %configure
@@ -47,6 +47,10 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/opensync/defaults/evo2-sync
 
 %changelog
+* Wed Aug 29 2012 Milan Crha <mcrha at redhat.com>
+- 1:0.22-26
+- Add patch to build against latest evolution-data-server
+
 * Thu Jul 26 2012 Andreas Bierfert <andreas.bierfert[AT]lowlatency.de>
 - 1:0.22-25
 - fix include


More information about the scm-commits mailing list