[evolution-data-server/f15] Add patch to not duplicate detached instances in local calendars
Milan Crha
mcrha at fedoraproject.org
Wed Sep 14 18:36:11 UTC 2011
commit 7946e7eaadcef8ab27d122ca10cdeb739e490228
Author: Milan Crha <mcrha at redhat.com>
Date: Wed Sep 14 20:35:41 2011 +0200
Add patch to not duplicate detached instances in local calendars
...erver-3.0.3-duplicated-detached-instances.patch | 62 ++++++++++++++++++++
evolution-data-server.spec | 9 +++-
2 files changed, 70 insertions(+), 1 deletions(-)
---
diff --git a/evolution-data-server-3.0.3-duplicated-detached-instances.patch b/evolution-data-server-3.0.3-duplicated-detached-instances.patch
new file mode 100644
index 0000000..4ca5a0e
--- /dev/null
+++ b/evolution-data-server-3.0.3-duplicated-detached-instances.patch
@@ -0,0 +1,62 @@
+diff --git a/calendar/backends/file/e-cal-backend-file.c b/calendar/backends/file/e-cal-backend-file.c
+index a33df12..85853f8 100644
+--- a/calendar/backends/file/e-cal-backend-file.c
++++ b/calendar/backends/file/e-cal-backend-file.c
+@@ -472,14 +472,19 @@ resolve_tzid (const gchar *tzid, gpointer user_data)
+ return zone;
+ }
+
+-/* Checks if the specified component has a duplicated UID and if so changes it */
++/* Checks if the specified component has a duplicated UID and if so changes it.
++ * UIDs may be shared between components if there is at most one component
++ * without RECURRENCE-ID (master) and all others have different RECURRENCE-ID
++ * values.
++ */
+ static void
+ check_dup_uid (ECalBackendFile *cbfile, ECalComponent *comp)
+ {
+ ECalBackendFilePrivate *priv;
+ ECalBackendFileObject *obj_data;
+ const gchar *uid = NULL;
+- gchar *new_uid;
++ gchar *new_uid = NULL;
++ gchar *rid = NULL;
+
+ priv = cbfile->priv;
+
+@@ -494,17 +499,33 @@ check_dup_uid (ECalBackendFile *cbfile, ECalComponent *comp)
+ if (!obj_data)
+ return; /* Everything is fine */
+
+- d(g_message (G_STRLOC ": Got object with duplicated UID `%s', changing it...", uid));
++ rid = e_cal_component_get_recurid_as_string (comp);
++ if (rid && *rid) {
++ /* new component has rid, must not be the same as in other detached recurrence */
++ if (!g_hash_table_lookup (obj_data->recurrences, rid))
++ goto done;
++ } else {
++ /* new component has no rid, must not clash with existing master */
++ if (!obj_data->full_object)
++ goto done;
++ }
++
++ d(g_message (G_STRLOC ": Got object with duplicated UID `%s' and rid `%s', changing it...",
++ uid,
++ rid ? rid : ""));
+
+ new_uid = e_cal_component_gen_uid ();
+ e_cal_component_set_uid (comp, new_uid);
+- g_free (new_uid);
+
+ /* FIXME: I think we need to reset the SEQUENCE property and reset the
+ * CREATED/DTSTAMP/LAST-MODIFIED.
+ */
+
+ save (cbfile);
++
++ done:
++ g_free (rid);
++ g_free (new_uid);
+ }
+
+ static struct icaltimetype
diff --git a/evolution-data-server.spec b/evolution-data-server.spec
index 5391294..7b05fe6 100644
--- a/evolution-data-server.spec
+++ b/evolution-data-server.spec
@@ -26,7 +26,7 @@
Name: evolution-data-server
Version: 3.0.3
-Release: 1%{?dist}
+Release: 2%{?dist}
Group: System Environment/Libraries
Summary: Backend data server for Evolution
License: LGPLv2+
@@ -42,6 +42,9 @@ Obsoletes: evolution-webcal < 2.24.0
# RH bug #243296
Patch11: evolution-data-server-1.11.5-fix-64bit-acinclude.patch
+# regression found during investigation of Gnome bug #655253
+Patch12: evolution-data-server-3.0.3-duplicated-detached-instances.patch
+
### Build Dependencies ###
BuildRequires: GConf2-devel
@@ -119,6 +122,7 @@ This package contains developer documentation for %{name}.
%setup -q -n %{name}-%{version}
%patch11 -p1 -b .fix-64bit-acinclude
+%patch12 -p1 -b .duplicated-detached-instances
mkdir -p krb5-fakeprefix/include
mkdir -p krb5-fakeprefix/lib
@@ -342,6 +346,9 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/gtk-doc/html/libedataserverui
%changelog
+* Wed Sep 14 2011 Milan Crha <mcrha at redhat.com> - 3.0.3-2
+- Add patch to not duplicate detached instances in local calendars
+
* Wed Aug 31 2011 Milan Crha <mcrha at redhat.com> - 3.0.3-1
- Update to 3.0.3
More information about the scm-commits
mailing list