import evolution-data-server-3.28.5-13.el8

This commit is contained in:
CentOS Sources 2020-07-28 08:04:27 -04:00 committed by Stepan Oksanichenko
parent 1942ae965f
commit bf4b6c4f20
3 changed files with 257 additions and 1 deletions

View File

@ -0,0 +1,125 @@
diff -up evolution-data-server-3.28.5/src/libebackend/e-dbus-server.c.delay-new-module-load evolution-data-server-3.28.5/src/libebackend/e-dbus-server.c
--- evolution-data-server-3.28.5/src/libebackend/e-dbus-server.c.delay-new-module-load 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/src/libebackend/e-dbus-server.c 2020-01-15 13:29:46.090644022 +0100
@@ -75,6 +75,78 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (
EDBusServer, e_dbus_server, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (E_TYPE_EXTENSIBLE, NULL))
+typedef struct _ModuleLoadData {
+ GWeakRef server_wr;
+ gchar *filename;
+} ModuleLoadData;
+
+static ModuleLoadData *
+module_load_data_new (EDBusServer *server,
+ const gchar *filename)
+{
+ ModuleLoadData *mld;
+
+ mld = g_slice_new0 (ModuleLoadData);
+ g_weak_ref_init (&mld->server_wr, server);
+ mld->filename = g_strdup (filename);
+
+ return mld;
+}
+
+static void
+module_load_data_free (gpointer ptr)
+{
+ ModuleLoadData *mld = ptr;
+
+ if (mld) {
+ g_weak_ref_clear (&mld->server_wr);
+ g_free (mld->filename);
+ g_slice_free (ModuleLoadData, mld);
+ }
+}
+
+static gboolean
+e_dbus_server_load_module_timeout_cb (gpointer user_data)
+{
+ ModuleLoadData *mld = user_data;
+ EDBusServer *server;
+
+ g_return_val_if_fail (mld != NULL, FALSE);
+
+ server = g_weak_ref_get (&mld->server_wr);
+ if (server) {
+ EModule *module;
+
+ e_source_registry_debug_print ("Loading module '%s'\n", mld->filename);
+
+ module = e_module_load_file (mld->filename);
+ if (module) {
+ g_type_module_unuse ((GTypeModule *) module);
+
+ e_dbus_server_quit (server, E_DBUS_SERVER_EXIT_RELOAD);
+ }
+
+ g_object_unref (server);
+ }
+
+ return FALSE;
+}
+
+static void
+e_dbus_server_schedule_module_load (EDBusServer *server,
+ const gchar *filename)
+{
+ g_return_if_fail (E_IS_DBUS_SERVER (server));
+ g_return_if_fail (filename != NULL);
+
+ e_source_registry_debug_print ("Schedule load of module '%s'\n", filename);
+
+ /* Delay the load by 10 seconds, in case the module doesn't have placed
+ all its libraries in the expected directories. */
+ g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, 10, e_dbus_server_load_module_timeout_cb,
+ module_load_data_new (server, filename), module_load_data_free);
+}
+
static void
dbus_server_bus_acquired_cb (GDBusConnection *connection,
const gchar *bus_name,
@@ -552,38 +624,27 @@ dbus_server_module_directory_changed_cb
if (event_type == G_FILE_MONITOR_EVENT_RENAMED && other_file) {
G_LOCK (loaded_modules);
if (!g_hash_table_contains (loaded_modules, filename)) {
+ gchar *other_filename = g_file_get_path (other_file);
+ e_source_registry_debug_print ("Module file '%s' renamed to '%s'\n", filename, other_filename);
g_free (filename);
- filename = g_file_get_path (other_file);
+ filename = other_filename;
event_type = G_FILE_MONITOR_EVENT_CREATED;
}
G_UNLOCK (loaded_modules);
}
if (filename && g_str_has_suffix (filename, "." G_MODULE_SUFFIX)) {
- gboolean any_loaded = FALSE;
-
if (event_type == G_FILE_MONITOR_EVENT_CREATED ||
event_type == G_FILE_MONITOR_EVENT_MOVED_IN) {
G_LOCK (loaded_modules);
if (!g_hash_table_contains (loaded_modules, filename)) {
- EModule *module;
-
g_hash_table_add (loaded_modules, g_strdup (filename));
-
- module = e_module_load_file (filename);
- if (module) {
- any_loaded = TRUE;
-
- g_type_module_unuse ((GTypeModule *) module);
- }
+ e_dbus_server_schedule_module_load (server, filename);
}
G_UNLOCK (loaded_modules);
}
-
- if (any_loaded)
- e_dbus_server_quit (server, E_DBUS_SERVER_EXIT_RELOAD);
}
g_free (filename);

View File

@ -0,0 +1,117 @@
diff -up evolution-data-server-3.28.5/tests/libedata-cal/components/event-7.ics.test-cal-meta-backend-without-evolution evolution-data-server-3.28.5/tests/libedata-cal/components/event-7.ics
--- evolution-data-server-3.28.5/tests/libedata-cal/components/event-7.ics.test-cal-meta-backend-without-evolution 2020-01-16 08:28:52.842204524 +0100
+++ evolution-data-server-3.28.5/tests/libedata-cal/components/event-7.ics 2020-01-16 08:30:30.726203170 +0100
@@ -6,7 +6,7 @@ DTEND;TZID=/freeassociation.sourceforge.
SEQUENCE:1
SUMMARY:With attachment
TRANSP:OPAQUE
-ATTACH:file:///usr/share/icons/hicolor/48x48/apps/evolution.png
+ATTACH:$EVENT1URI$
CLASS:PUBLIC
CREATED:20170221T125054Z
LAST-MODIFIED:20170221T125054Z
diff -up evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.c.test-cal-meta-backend-without-evolution evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.c
--- evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.c.test-cal-meta-backend-without-evolution 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.c 2020-01-16 08:28:52.842204524 +0100
@@ -114,13 +114,10 @@ tcu_fixture_teardown (TCUFixture *fixtur
}
gchar *
-tcu_new_icalstring_from_test_case (const gchar *case_name)
+tcu_get_test_case_filename (const gchar *case_name)
{
gchar *filename;
gchar *case_filename;
- GFile * file;
- GError *error = NULL;
- gchar *icalstring = NULL;
case_filename = g_strdup_printf ("%s.ics", case_name);
@@ -132,16 +129,48 @@ tcu_new_icalstring_from_test_case (const
else
filename = g_build_filename (SRCDIR, "..", "libedata-cal", "components", case_filename, NULL);
+ g_free (case_filename);
+
+ return filename;
+}
+
+gchar *
+tcu_new_icalstring_from_test_case (const gchar *case_name)
+{
+ gchar *filename;
+ GFile * file;
+ GError *error = NULL;
+ gchar *icalstring = NULL, *uripart;
+
+ filename = tcu_get_test_case_filename (case_name);
+
file = g_file_new_for_path (filename);
if (!g_file_load_contents (file, NULL, &icalstring, NULL, NULL, &error))
g_error (
"Failed to read test iCal string file '%s': %s",
filename, error->message);
- g_free (case_filename);
g_free (filename);
g_object_unref (file);
+ uripart = strstr (icalstring, "$EVENT1URI$");
+ if (uripart) {
+ gchar *uri;
+ GString *str;
+
+ filename = tcu_get_test_case_filename ("event-1");
+ uri = g_filename_to_uri (filename, NULL, NULL);
+ g_free (filename);
+
+ str = g_string_new_len (icalstring, uripart - icalstring);
+ g_string_append (str, uri);
+ g_string_append (str, uripart + 11);
+ g_free (icalstring);
+ g_free (uri);
+
+ icalstring = g_string_free (str, FALSE);
+ }
+
return icalstring;
}
diff -up evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.h.test-cal-meta-backend-without-evolution evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.h
--- evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.h.test-cal-meta-backend-without-evolution 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/tests/libedata-cal/test-cal-cache-utils.h 2020-01-16 08:28:52.842204524 +0100
@@ -46,6 +46,7 @@ ECalComponent * tcu_new_component_from_t
void tcu_add_component_from_test_case (TCUFixture *fixture,
const gchar *case_name,
ECalComponent **out_component);
+gchar * tcu_get_test_case_filename (const gchar *case_name);
G_END_DECLS
diff -up evolution-data-server-3.28.5/tests/libedata-cal/test-cal-meta-backend.c.test-cal-meta-backend-without-evolution evolution-data-server-3.28.5/tests/libedata-cal/test-cal-meta-backend.c
--- evolution-data-server-3.28.5/tests/libedata-cal/test-cal-meta-backend.c.test-cal-meta-backend-without-evolution 2018-07-30 15:17:06.000000000 +0200
+++ evolution-data-server-3.28.5/tests/libedata-cal/test-cal-meta-backend.c 2020-01-16 08:28:52.842204524 +0100
@@ -1274,6 +1274,7 @@ static void
test_get_attachment_uris (ECalMetaBackend *meta_backend)
{
ECalBackendSyncClass *backend_class;
+ gchar *expected_uri, *filename;
GSList *uris = NULL;
GError *error = NULL;
@@ -1306,7 +1307,13 @@ test_get_attachment_uris (ECalMetaBacken
g_assert_no_error (error);
g_assert_nonnull (uris);
g_assert_cmpint (g_slist_length (uris), ==, 1);
- g_assert_cmpstr (uris->data, ==, "file:///usr/share/icons/hicolor/48x48/apps/evolution.png");
+
+ filename = tcu_get_test_case_filename ("event-1");
+ expected_uri = g_filename_to_uri (filename, NULL, NULL);
+ g_free (filename);
+
+ g_assert_cmpstr (uris->data, ==, expected_uri);
+ g_free (expected_uri);
g_slist_free_full (uris, g_free);
}

View File

@ -32,7 +32,7 @@
Name: evolution-data-server
Version: 3.28.5
Release: 11%{?dist}
Release: 13%{?dist}
Group: System Environment/Libraries
Summary: Backend data server for Evolution
License: LGPLv2+
@ -76,6 +76,12 @@ Patch07: evolution-data-server-3.28.5-vcard-attr-param-struct-reff.patch
# RH bug #1696763
Patch08: evolution-data-server-3.28.5-cve-2019-3890.patch
# RH bug #1788478
Patch09: evolution-data-server-3.28.5-delay-new-module-load.patch
# RH bug #1791547
Patch10: evolution-data-server-3.28.5-test-cal-meta-backend-without-evolution.patch
### Dependencies ###
Requires: dconf
@ -203,6 +209,8 @@ the functionality of the installed %{name} package.
%patch06 -p1 -b .tests-cal-client-get-revision
%patch07 -p1 -b .vcard-attr-param-struct-reff
%patch08 -p1 -b .cve-2019-3890
%patch09 -p1 -b .delay-new-module-load
%patch10 -p1 -b .test-cal-meta-backend-without-evolution
%build
@ -464,6 +472,12 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &>/dev/null || :
%{_datadir}/installed-tests
%changelog
* Thu Jan 16 2020 Milan Crha <mcrha@redhat.com> - 3.28.5-13
- Resolves: #1791547 (test-cal-meta-backend cannot run without installed Evolution)
* Wed Jan 15 2020 Milan Crha <mcrha@redhat.com> - 3.28.5-12
- Add patch for RH bug #1788478 (EDBusServer: Delay new module load)
* Mon May 27 2019 Milan Crha <mcrha@redhat.com> - 3.28.5-11
- Update patch for RH bug #1713619 (test-cal-client-get-revision could fail due to delayed D-Bus property change notification)