diff --git a/.dconf.metadata b/.dconf.metadata index 9ce0c2f..1b9b98a 100644 --- a/.dconf.metadata +++ b/.dconf.metadata @@ -1 +1 @@ -d1a03938451b19a53f0d2fd09b6c737542fdd4c4 SOURCES/dconf-0.22.0.tar.xz +d4ab94969864c3e00515d0c0ee5b8090a7e0f896 SOURCES/dconf-0.26.0.tar.xz diff --git a/.gitignore b/.gitignore index bf28c19..46ea2cd 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/dconf-0.22.0.tar.xz +SOURCES/dconf-0.26.0.tar.xz diff --git a/SOURCES/dconf-0.26.0-Remove-libdbus-1-support.patch b/SOURCES/dconf-0.26.0-Remove-libdbus-1-support.patch new file mode 100644 index 0000000..651197c --- /dev/null +++ b/SOURCES/dconf-0.26.0-Remove-libdbus-1-support.patch @@ -0,0 +1,815 @@ +From 1fb178fddf7adb041806078b20b00c89cb8a4cd1 Mon Sep 17 00:00:00 2001 +From: Allison Ryan Lortie +Date: Wed, 16 Dec 2015 14:54:31 +0000 +Subject: [PATCH 35/47] Remove libdbus-1 support + +Stop building the dconf-dbus-1 client library. Nobody is using it +anymore and we will soon be taking a non-conditional dependency on +libgio in any case. + +It is now only possible to use dconf with GDBus. +--- + Makefile.am | 2 +- + configure.ac | 3 - + dbus-1/.gitignore | 6 - + dbus-1/Makefile.am | 47 ------ + dbus-1/dconf-dbus-1.c | 188 ------------------------ + dbus-1/dconf-dbus-1.h | 56 ------- + dbus-1/dconf-dbus-1.pc.in | 11 -- + dbus-1/dconf-libdbus-1.c | 365 ---------------------------------------------- + dbus-1/dconf-libdbus-1.h | 11 -- + tests/Makefile.am | 8 - + 10 files changed, 1 insertion(+), 696 deletions(-) + delete mode 100644 dbus-1/.gitignore + delete mode 100644 dbus-1/Makefile.am + delete mode 100644 dbus-1/dconf-dbus-1.c + delete mode 100644 dbus-1/dconf-dbus-1.h + delete mode 100644 dbus-1/dconf-dbus-1.pc.in + delete mode 100644 dbus-1/dconf-libdbus-1.c + delete mode 100644 dbus-1/dconf-libdbus-1.h + +diff --git a/Makefile.am b/Makefile.am +index 83cd492..dd3571a 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -2,7 +2,7 @@ include Makefile.gtester + + ACLOCAL_AMFLAGS = -I m4 + +-SUBDIRS = shm gvdb common engine service gdbus gsettings dbus-1 client bin docs tests ++SUBDIRS = shm gvdb common engine service gdbus gsettings client bin docs tests + + DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc + EXTRA_DIST = trim-lcov.py m4 +diff --git a/configure.ac b/configure.ac +index 21b57cb..95ca9d9 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -47,7 +47,6 @@ GTK_DOC_CHECK([1.15]) + # Dependencies + PKG_CHECK_MODULES(glib, glib-2.0 >= 2.44.0) + PKG_CHECK_MODULES(gio, gio-unix-2.0) +-PKG_CHECK_MODULES(dbus, dbus-1) + + AC_ARG_WITH(gio_modules_dir, [ --with-gio-modules-dir=PATH choose directory for the GIO module, [default=LIBDIR/gio/modules]], giomodulesdir="$withval", giomodulesdir=${libdir}/gio/modules) + AC_SUBST(giomodulesdir) +@@ -83,11 +82,9 @@ AC_CONFIG_FILES([ + engine/Makefile + gdbus/Makefile + gsettings/Makefile +- dbus-1/dconf-dbus-1.pc + client/dconf.pc + client/Makefile + service/Makefile +- dbus-1/Makefile + bin/Makefile + tests/Makefile + docs/Makefile +diff --git a/dbus-1/.gitignore b/dbus-1/.gitignore +deleted file mode 100644 +index 36fad9e..0000000 +--- a/dbus-1/.gitignore ++++ /dev/null +@@ -1,6 +0,0 @@ +-libdconf-libdbus-1.a +-libdconf-libdbus-1-shared.a +-libdconf-dbus-1.so +-libdconf-dbus-1.so.0 +-libdconf-dbus-1.so.0.0.0 +-dconf-dbus-1.pc +diff --git a/dbus-1/Makefile.am b/dbus-1/Makefile.am +deleted file mode 100644 +index 4e60d01..0000000 +--- a/dbus-1/Makefile.am ++++ /dev/null +@@ -1,47 +0,0 @@ +-include $(top_srcdir)/Makefile.gtester +- +-noinst_LIBRARIES = libdconf-libdbus-1.a libdconf-libdbus-1-shared.a +- +-libdconf_libdbus_1_a_CFLAGS = $(dbus_CFLAGS) $(glib_CFLAGS) -DG_LOG_DOMAIN=\"dconf\" +-libdconf_libdbus_1_a_SOURCES = \ +- dconf-libdbus-1.h \ +- dconf-libdbus-1.c +- +-libdconf_libdbus_1_shared_a_CFLAGS = $(libdconf_libdbus_1_a_CFLAGS) -fPIC -DPIC +-libdconf_libdbus_1_shared_a_SOURCES = $(libdconf_libdbus_1_a_SOURCES) +- +-dconf_dbus_1includedir = $(includedir)/dconf-dbus-1 +-dconf_dbus_1include_HEADERS = dconf-dbus-1.h +- +-pkgconfigdir = $(libdir)/pkgconfig +-pkgconfig_DATA = dconf-dbus-1.pc +- +-shlibdir = $(libdir) +-shlib_PROGRAMS = libdconf-dbus-1.so.0.0.0 +- +-libdconf_dbus_1_so_0_0_0_CFLAGS = $(dbus_CFLAGS) $(gio_CFLAGS) -fPIC -DPIC +-libdconf_dbus_1_so_0_0_0_LDADD = \ +- ../engine/libdconf-engine-shared.a \ +- ../common/libdconf-common-hidden.a \ +- ./libdconf-libdbus-1-shared.a \ +- ../gvdb/libgvdb-shared.a \ +- ../shm/libdconf-shm-shared.a \ +- $(dbus_LIBS) \ +- $(glib_LIBS) +-libdconf_dbus_1_so_0_0_0_LDFLAGS = -shared -Wl,-soname=libdconf-dbus-1.so.0 +-libdconf_dbus_1_so_0_0_0_SOURCES = dconf-dbus-1.c +- +-nodist_noinst_DATA = libdconf-dbus-1.so libdconf-dbus-1.so.0 +- +-libdconf-dbus-1.so.0 libdconf-dbus-1.so: libdconf-dbus-1.so.0.0.0 +- $(AM_V_GEN) ln -fs libdconf-dbus-1.so.0.0.0 $@ +- +-install-data-hook: +- ln -fs libdconf-dbus-1.so.0.0.0 $(DESTDIR)$(shlibdir)/libdconf-dbus-1.so.0 +- ln -fs libdconf-dbus-1.so.0.0.0 $(DESTDIR)$(shlibdir)/libdconf-dbus-1.so +- +-uninstall-hook: +- rm -f $(DESTDIR)$(shlibdir)/libdconf-dbus-1.so.0 +- rm -f $(DESTDIR)$(shlibdir)/libdconf-dbus-1.so +- +-CLEANFILES = libdconf-dbus-1.so.0 libdconf-dbus-1.so +diff --git a/dbus-1/dconf-dbus-1.c b/dbus-1/dconf-dbus-1.c +deleted file mode 100644 +index 67de4a0..0000000 +--- a/dbus-1/dconf-dbus-1.c ++++ /dev/null +@@ -1,188 +0,0 @@ +-/** +- * Copyright © 2010 Canonical Limited +- * +- * This program is free software: you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation, either version 3 of the licence, or (at +- * your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, but +- * WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with this program. If not, see . +- * +- * Author: Ryan Lortie +- **/ +- +-#include "config.h" +- +-#include "dconf-dbus-1.h" +- +-#include "../engine/dconf-engine.h" +-#include "dconf-libdbus-1.h" +- +-#include +- +-struct _DConfDBusClient +-{ +- DConfEngine *engine; +- GSList *watches; +- gint ref_count; +-}; +- +-typedef struct +-{ +- gchar *path; +- DConfDBusNotify notify; +- gpointer user_data; +-} Watch; +- +-void +-dconf_engine_change_notify (DConfEngine *engine, +- const gchar *prefix, +- const gchar * const *changes, +- const gchar *tag, +- gboolean is_writability, +- gpointer origin_tag, +- gpointer user_data) +-{ +- DConfDBusClient *dcdbc = user_data; +- gchar **my_changes; +- gint n_changes; +- GSList *iter; +- gint i; +- +- n_changes = g_strv_length ((gchar **) changes); +- my_changes = g_new (gchar *, n_changes + 1); +- +- for (i = 0; i < n_changes; i++) +- my_changes[i] = g_strconcat (prefix, changes[i], NULL); +- my_changes[i] = NULL; +- +- for (iter = dcdbc->watches; iter; iter = iter->next) +- { +- Watch *watch = iter->data; +- +- for (i = 0; i < n_changes; i++) +- if (g_str_has_prefix (my_changes[i], watch->path)) +- watch->notify (dcdbc, my_changes[i], watch->user_data); +- } +- +- g_strfreev (my_changes); +-} +- +-GVariant * +-dconf_dbus_client_read (DConfDBusClient *dcdbc, +- const gchar *key) +-{ +- return dconf_engine_read (dcdbc->engine, NULL, key); +-} +- +-gboolean +-dconf_dbus_client_write (DConfDBusClient *dcdbc, +- const gchar *key, +- GVariant *value) +-{ +- DConfChangeset *changeset; +- gboolean success; +- +- changeset = dconf_changeset_new_write (key, value); +- success = dconf_engine_change_fast (dcdbc->engine, changeset, NULL, NULL); +- dconf_changeset_unref (changeset); +- +- return success; +-} +- +-void +-dconf_dbus_client_subscribe (DConfDBusClient *dcdbc, +- const gchar *path, +- DConfDBusNotify notify, +- gpointer user_data) +-{ +- Watch *watch; +- +- watch = g_slice_new (Watch); +- watch->path = g_strdup (path); +- watch->notify = notify; +- watch->user_data = user_data; +- +- dcdbc->watches = g_slist_prepend (dcdbc->watches, watch); +- +- dconf_engine_watch_fast (dcdbc->engine, path); +-} +- +-void +-dconf_dbus_client_unsubscribe (DConfDBusClient *dcdbc, +- DConfDBusNotify notify, +- gpointer user_data) +-{ +- GSList **ptr; +- +- for (ptr = &dcdbc->watches; *ptr; ptr = &(*ptr)->next) +- { +- Watch *watch = (*ptr)->data; +- +- if (watch->notify == notify && watch->user_data == user_data) +- { +- *ptr = g_slist_remove_link (*ptr, *ptr); +- dconf_engine_unwatch_fast (dcdbc->engine, watch->path); +- g_free (watch->path); +- g_slice_free (Watch, watch); +- return; +- } +- } +- +- g_warning ("No matching watch found to unsubscribe"); +-} +- +-gboolean +-dconf_dbus_client_has_pending (DConfDBusClient *dcdbc) +-{ +- return dconf_engine_has_outstanding (dcdbc->engine); +-} +- +-DConfDBusClient * +-dconf_dbus_client_new (const gchar *profile, +- DBusConnection *session, +- DBusConnection *system) +-{ +- DConfDBusClient *dcdbc; +- +- if (session == NULL) +- session = dbus_bus_get (DBUS_BUS_SESSION, NULL); +- +- if (system == NULL) +- system = dbus_bus_get (DBUS_BUS_SYSTEM, NULL); +- +- dconf_libdbus_1_provide_bus (G_BUS_TYPE_SESSION, session); +- dconf_libdbus_1_provide_bus (G_BUS_TYPE_SYSTEM, system); +- +- dcdbc = g_slice_new (DConfDBusClient); +- dcdbc->engine = dconf_engine_new (NULL, dcdbc, NULL); +- dcdbc->watches = NULL; +- dcdbc->ref_count = 1; +- +- return dcdbc; +-} +- +-void +-dconf_dbus_client_unref (DConfDBusClient *dcdbc) +-{ +- if (--dcdbc->ref_count == 0) +- { +- g_return_if_fail (dcdbc->watches == NULL); +- +- g_slice_free (DConfDBusClient, dcdbc); +- } +-} +- +-DConfDBusClient * +-dconf_dbus_client_ref (DConfDBusClient *dcdbc) +-{ +- dcdbc->ref_count++; +- +- return dcdbc; +-} +diff --git a/dbus-1/dconf-dbus-1.h b/dbus-1/dconf-dbus-1.h +deleted file mode 100644 +index bd204be..0000000 +--- a/dbus-1/dconf-dbus-1.h ++++ /dev/null +@@ -1,56 +0,0 @@ +-/** +- * Copyright © 2010 Canonical Limited +- * +- * This program is free software: you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation, either version 3 of the licence, or (at +- * your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, but +- * WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with this program. If not, see . +- * +- * Author: Ryan Lortie +- **/ +- +-#ifndef _dconf_dbus_1_h_ +-#define _dconf_dbus_1_h_ +- +-#include +-#include +- +-G_BEGIN_DECLS +- +-typedef struct _DConfDBusClient DConfDBusClient; +- +-typedef void (* DConfDBusNotify) (DConfDBusClient *dcdbc, +- const gchar *key, +- gpointer user_data); +- +-DConfDBusClient * dconf_dbus_client_new (const gchar *profile, +- DBusConnection *session, +- DBusConnection *system); +-void dconf_dbus_client_unref (DConfDBusClient *dcdbc); +-DConfDBusClient * dconf_dbus_client_ref (DConfDBusClient *dcdbc); +- +-GVariant * dconf_dbus_client_read (DConfDBusClient *dcdbc, +- const gchar *key); +-gboolean dconf_dbus_client_write (DConfDBusClient *dcdbc, +- const gchar *key, +- GVariant *value); +-void dconf_dbus_client_subscribe (DConfDBusClient *dcdbc, +- const gchar *name, +- DConfDBusNotify notify, +- gpointer user_data); +-void dconf_dbus_client_unsubscribe (DConfDBusClient *dcdbc, +- DConfDBusNotify notify, +- gpointer user_data); +-gboolean dconf_dbus_client_has_pending (DConfDBusClient *dcdbc); +- +-G_END_DECLS +- +-#endif /* _dconf_dbus_1_h_ */ +diff --git a/dbus-1/dconf-dbus-1.pc.in b/dbus-1/dconf-dbus-1.pc.in +deleted file mode 100644 +index c4c3380..0000000 +--- a/dbus-1/dconf-dbus-1.pc.in ++++ /dev/null +@@ -1,11 +0,0 @@ +-prefix=@prefix@ +-exec_prefix=@exec_prefix@ +-libdir=@libdir@ +-includedir=@includedir@ +- +-Name: dconf-dbus-1 +-Description: dconf client library for libdbus-1 +-Version: @VERSION@ +-Requires: dbus-1, glib-2.0 +-Libs: -L${libdir} -ldconf-dbus-1 +-Cflags: -I${includedir}/dconf-dbus-1 +diff --git a/dbus-1/dconf-libdbus-1.c b/dbus-1/dconf-libdbus-1.c +deleted file mode 100644 +index 8ea187b..0000000 +--- a/dbus-1/dconf-libdbus-1.c ++++ /dev/null +@@ -1,365 +0,0 @@ +-/** +- * Copyright © 2010 Canonical Limited +- * +- * This program is free software: you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation, either version 3 of the licence, or (at +- * your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, but +- * WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with this program. If not, see . +- * +- * Author: Ryan Lortie +- **/ +- +-#include "config.h" +- +-#include "dconf-libdbus-1.h" +- +-#include "../engine/dconf-engine.h" +- +-#include +- +-static DBusConnection *dconf_libdbus_1_buses[5]; +- +-struct _DConfDBusClient +-{ +- DConfEngine *engine; +- GSList *watches; +- gint ref_count; +-}; +- +-#define DCONF_LIBDBUS_1_ERROR (g_quark_from_static_string("DCONF_LIBDBUS_1_ERROR")) +-#define DCONF_LIBDBUS_1_ERROR_FAILED 0 +- +-static DBusMessage * +-dconf_libdbus_1_new_method_call (const gchar *bus_name, +- const gchar *object_path, +- const gchar *interface_name, +- const gchar *method_name, +- GVariant *parameters) +-{ +- DBusMessageIter dbus_iter; +- DBusMessage *message; +- GVariantIter iter; +- GVariant *child; +- +- g_variant_ref_sink (parameters); +- +- message = dbus_message_new_method_call (bus_name, object_path, interface_name, method_name); +- dbus_message_iter_init_append (message, &dbus_iter); +- g_variant_iter_init (&iter, parameters); +- +- while ((child = g_variant_iter_next_value (&iter))) +- { +- if (g_variant_is_of_type (child, G_VARIANT_TYPE_STRING)) +- { +- const gchar *str; +- +- str = g_variant_get_string (child, NULL); +- dbus_message_iter_append_basic (&dbus_iter, DBUS_TYPE_STRING, &str); +- } +- +- else if (g_variant_is_of_type (child, G_VARIANT_TYPE_UINT32)) +- { +- guint32 uint; +- +- uint = g_variant_get_uint32 (child); +- dbus_message_iter_append_basic (&dbus_iter, DBUS_TYPE_UINT32, &uint); +- } +- +- else +- { +- DBusMessageIter subiter; +- const guint8 *bytes; +- gsize n_elements; +- +- g_assert (g_variant_is_of_type (child, G_VARIANT_TYPE_BYTESTRING)); +- +- bytes = g_variant_get_fixed_array (child, &n_elements, sizeof (guint8)); +- dbus_message_iter_open_container (&dbus_iter, DBUS_TYPE_ARRAY, "y", &subiter); +- dbus_message_iter_append_fixed_array (&subiter, DBUS_TYPE_BYTE, &bytes, n_elements); +- dbus_message_iter_close_container (&dbus_iter, &subiter); +- } +- +- g_variant_unref (child); +- } +- +- g_variant_unref (parameters); +- +- return message; +-} +- +-static GVariant * +-dconf_libdbus_1_get_message_body (DBusMessage *message, +- GError **error) +-{ +- GVariantBuilder builder; +- const gchar *signature; +- DBusMessageIter iter; +- +- /* We support two types: strings and arrays of strings. +- * +- * It's very simple to detect if the message contains only these +- * types: check that the signature contains only the letters "a" and +- * "s" and that it does not contain "aa". +- */ +- signature = dbus_message_get_signature (message); +- if (signature[strspn(signature, "as")] != '\0' || strstr (signature, "aa")) +- { +- g_set_error (error, DCONF_LIBDBUS_1_ERROR, DCONF_LIBDBUS_1_ERROR_FAILED, +- "unable to handle message type '(%s)'", signature); +- return NULL; +- } +- +- g_variant_builder_init (&builder, G_VARIANT_TYPE_TUPLE); +- dbus_message_iter_init (message, &iter); +- while (dbus_message_iter_get_arg_type (&iter)) +- { +- const gchar *string; +- +- if (dbus_message_iter_get_arg_type (&iter) == DBUS_TYPE_STRING) +- { +- dbus_message_iter_get_basic (&iter, &string); +- g_variant_builder_add (&builder, "s", string); +- } +- else +- { +- DBusMessageIter sub; +- +- g_assert (dbus_message_iter_get_arg_type (&iter) == DBUS_TYPE_ARRAY && +- dbus_message_iter_get_element_type (&iter) == DBUS_TYPE_STRING); +- +- g_variant_builder_open (&builder, G_VARIANT_TYPE_STRING_ARRAY); +- dbus_message_iter_recurse (&iter, &sub); +- +- while (dbus_message_iter_get_arg_type (&sub)) +- { +- const gchar *string; +- dbus_message_iter_get_basic (&sub, &string); +- g_variant_builder_add (&builder, "s", string); +- dbus_message_iter_next (&sub); +- } +- +- g_variant_builder_close (&builder); +- } +- dbus_message_iter_next (&iter); +- } +- +- return g_variant_ref_sink (g_variant_builder_end (&builder)); +-} +- +-static GVariant * +-dconf_libdbus_1_interpret_result (DBusMessage *result, +- const GVariantType *expected_type, +- GError **error) +-{ +- GVariant *reply; +- +- if (dbus_message_get_type (result) == DBUS_MESSAGE_TYPE_ERROR) +- { +- const gchar *errstr = "(no message)"; +- +- dbus_message_get_args (result, NULL, DBUS_TYPE_STRING, &errstr, DBUS_TYPE_INVALID); +- g_set_error (error, DCONF_LIBDBUS_1_ERROR, DCONF_LIBDBUS_1_ERROR_FAILED, +- "%s: %s", dbus_message_get_error_name (result), errstr); +- return NULL; +- } +- +- reply = dconf_libdbus_1_get_message_body (result, error); +- +- if (reply && expected_type && !g_variant_is_of_type (reply, expected_type)) +- { +- gchar *expected_string; +- +- expected_string = g_variant_type_dup_string (expected_type); +- g_set_error (error, DCONF_LIBDBUS_1_ERROR, DCONF_LIBDBUS_1_ERROR_FAILED, +- "received reply '%s' is not of the expected type %s", +- g_variant_get_type_string (reply), expected_string); +- g_free (expected_string); +- +- g_variant_unref (reply); +- reply = NULL; +- } +- +- return reply; +-} +- +-static void +-dconf_libdbus_1_method_call_done (DBusPendingCall *pending, +- gpointer user_data) +-{ +- DConfEngineCallHandle *handle = user_data; +- const GVariantType *expected_type; +- DBusMessage *message; +- GError *error = NULL; +- GVariant *reply; +- +- if (pending == NULL) +- return; +- +- message = dbus_pending_call_steal_reply (pending); +- dbus_pending_call_unref (pending); +- +- expected_type = dconf_engine_call_handle_get_expected_type (handle); +- reply = dconf_libdbus_1_interpret_result (message, expected_type, &error); +- dbus_message_unref (message); +- +- dconf_engine_call_handle_reply (handle, reply, error); +- +- if (reply) +- g_variant_unref (reply); +- if (error) +- g_error_free (error); +-} +- +-gboolean +-dconf_engine_dbus_call_async_func (GBusType bus_type, +- const gchar *bus_name, +- const gchar *object_path, +- const gchar *interface_name, +- const gchar *method_name, +- GVariant *parameters, +- DConfEngineCallHandle *handle, +- GError **error) +-{ +- DBusConnection *connection; +- DBusPendingCall *pending; +- DBusMessage *message; +- +- g_assert_cmpint (bus_type, <, G_N_ELEMENTS (dconf_libdbus_1_buses)); +- connection = dconf_libdbus_1_buses[bus_type]; +- g_assert (connection != NULL); +- +- message = dconf_libdbus_1_new_method_call (bus_name, object_path, interface_name, method_name, parameters); +- dbus_connection_send_with_reply (connection, message, &pending, -1); +- dbus_pending_call_set_notify (pending, dconf_libdbus_1_method_call_done, handle, NULL); +- dbus_message_unref (message); +- +- return TRUE; +-} +- +-static void +-dconf_libdbus_1_convert_error (DBusError *dbus_error, +- GError **error) +-{ +- g_set_error (error, DCONF_LIBDBUS_1_ERROR, DCONF_LIBDBUS_1_ERROR_FAILED, +- "%s: %s", dbus_error->name, dbus_error->message); +-} +- +-GVariant * +-dconf_engine_dbus_call_sync_func (GBusType bus_type, +- const gchar *bus_name, +- const gchar *object_path, +- const gchar *interface_name, +- const gchar *method_name, +- GVariant *parameters, +- const GVariantType *expected_type, +- GError **error) +-{ +- DBusConnection *connection; +- DBusMessage *message; +- DBusError dbus_error; +- DBusMessage *result; +- GVariant *reply; +- +- g_assert_cmpint (bus_type, <, G_N_ELEMENTS (dconf_libdbus_1_buses)); +- connection = dconf_libdbus_1_buses[bus_type]; +- g_assert (connection != NULL); +- +- dbus_error_init (&dbus_error); +- message = dconf_libdbus_1_new_method_call (bus_name, object_path, interface_name, method_name, parameters); +- result = dbus_connection_send_with_reply_and_block (connection, message, -1, &dbus_error); +- dbus_message_unref (message); +- +- if (result == NULL) +- { +- dconf_libdbus_1_convert_error (&dbus_error, error); +- dbus_error_free (&dbus_error); +- return NULL; +- } +- +- reply = dconf_libdbus_1_interpret_result (result, expected_type, error); +- dbus_message_unref (result); +- +- return reply; +-} +- +-static DBusHandlerResult +-dconf_libdbus_1_filter (DBusConnection *connection, +- DBusMessage *message, +- gpointer user_data) +-{ +- GBusType bus_type = GPOINTER_TO_INT (user_data); +- +- if (dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_SIGNAL) +- { +- const gchar *interface; +- +- interface = dbus_message_get_interface (message); +- +- if (interface && g_str_equal (interface, "ca.desrt.dconf.Writer")) +- { +- GVariant *parameters; +- +- parameters = dconf_libdbus_1_get_message_body (message, NULL); +- +- if (parameters != NULL) +- { +- dconf_engine_handle_dbus_signal (bus_type, +- dbus_message_get_sender (message), +- dbus_message_get_path (message), +- dbus_message_get_member (message), +- parameters); +- g_variant_unref (parameters); +- } +- } +- } +- +- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; +-} +- +-void +-dconf_libdbus_1_provide_bus (GBusType bus_type, +- DBusConnection *connection) +-{ +- g_assert_cmpint (bus_type, <, G_N_ELEMENTS (dconf_libdbus_1_buses)); +- +- if (!dconf_libdbus_1_buses[bus_type]) +- { +- dconf_libdbus_1_buses[bus_type] = dbus_connection_ref (connection); +- dbus_connection_add_filter (connection, dconf_libdbus_1_filter, GINT_TO_POINTER (bus_type), NULL); +- } +-} +- +-#ifndef PIC +-static gboolean +-dconf_libdbus_1_check_connection (gpointer user_data) +-{ +- DBusConnection *connection = user_data; +- +- dbus_connection_read_write (connection, 0); +- dbus_connection_dispatch (connection); +- +- return G_SOURCE_CONTINUE; +-} +- +-void +-dconf_engine_dbus_init_for_testing (void) +-{ +- DBusConnection *session; +- DBusConnection *system; +- +- dconf_libdbus_1_provide_bus (G_BUS_TYPE_SESSION, session = dbus_bus_get (DBUS_BUS_SESSION, NULL)); +- dconf_libdbus_1_provide_bus (G_BUS_TYPE_SYSTEM, system = dbus_bus_get (DBUS_BUS_SYSTEM, NULL)); +- +- /* "mainloop integration" */ +- g_timeout_add (1, dconf_libdbus_1_check_connection, session); +- g_timeout_add (1, dconf_libdbus_1_check_connection, system); +-} +-#endif +diff --git a/dbus-1/dconf-libdbus-1.h b/dbus-1/dconf-libdbus-1.h +deleted file mode 100644 +index 201096a..0000000 +--- a/dbus-1/dconf-libdbus-1.h ++++ /dev/null +@@ -1,11 +0,0 @@ +-#ifndef __dconf_libdbus_1_h__ +-#define __dconf_libdbus_1_h__ +- +-#include +-#include +- +-G_GNUC_INTERNAL +-void dconf_libdbus_1_provide_bus (GBusType bus_type, +- DBusConnection *connection); +- +-#endif /* __dconf_libdbus_1_h__ */ +diff --git a/tests/Makefile.am b/tests/Makefile.am +index adc8519..0a53ee6 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -64,14 +64,6 @@ gdbus_filter_LDADD = \ + $(gio_LIBS) + gdbus_filter_SOURCES = dbus.c + +-TEST_PROGS += libdbus-1 +-libdbus_1_CFLAGS = $(gio_CFLAGS) -DDBUS_BACKEND=\"/libdbus-1\" +-libdbus_1_LDADD = \ +- ../dbus-1/libdconf-libdbus-1.a \ +- $(glib_LIBS) \ +- $(dbus_LIBS) +-libdbus_1_SOURCES = dbus.c +- + TEST_PROGS += engine + engine_CFLAGS = $(glib_CFLAGS) -DSRCDIR=\"$(abs_srcdir)\" + engine_LDADD = \ +-- +2.9.3 + diff --git a/SOURCES/dconf-0.26.0-permissions.patch b/SOURCES/dconf-0.26.0-permissions.patch new file mode 100644 index 0000000..151b790 --- /dev/null +++ b/SOURCES/dconf-0.26.0-permissions.patch @@ -0,0 +1,31 @@ +--- a/gvdb/gvdb-builder.c ++++ b/gvdb/gvdb-builder.c +@@ -21,6 +21,7 @@ + #include "gvdb-format.h" + + #include ++#include + #include + #if !defined(G_OS_WIN32) || !defined(_MSC_VER) + #include +@@ -509,13 +510,20 @@ gvdb_table_write_contents (GHashTable *table, + gboolean status; + FileBuilder *fb; + GString *str; ++ GStatBuf buf; ++ gint stat_ret; + + fb = file_builder_new (byteswap); + file_builder_add_hash (fb, table, &root); + str = file_builder_serialise (fb, root); + ++ stat_ret = g_stat (filename, &buf); ++ + status = g_file_set_contents (filename, str->str, str->len, error); + g_string_free (str, TRUE); + ++ if (stat_ret == 0) ++ g_chmod (filename, buf.st_mode); ++ + return status; + } diff --git a/SOURCES/dconf-0.26.0-read-flag.patch b/SOURCES/dconf-0.26.0-read-flag.patch new file mode 100644 index 0000000..541cb24 --- /dev/null +++ b/SOURCES/dconf-0.26.0-read-flag.patch @@ -0,0 +1,11 @@ +--- dconf-0.26.0/dbus-1/dconf-dbus-1.c.orig 2017-02-10 16:56:10.000000000 +0100 ++++ dconf-0.26.0/dbus-1/dconf-dbus-1.c 2017-02-10 16:56:15.686442282 +0100 +@@ -78,7 +78,7 @@ GVariant * + dconf_dbus_client_read (DConfDBusClient *dcdbc, + const gchar *key) + { +- return dconf_engine_read (dcdbc->engine, NULL, key); ++ return dconf_engine_read (dcdbc->engine, DCONF_READ_FLAGS_NONE, NULL, key); + } + + gboolean diff --git a/SPECS/dconf.spec b/SPECS/dconf.spec index 637bfdf..bc47250 100644 --- a/SPECS/dconf.spec +++ b/SPECS/dconf.spec @@ -1,8 +1,8 @@ -%define glib2_version 2.39.1 +%define glib2_version 2.44.0 %define vala_version 0.18.0 Name: dconf -Version: 0.22.0 +Version: 0.26.0 Release: 2%{?dist} Summary: A configuration system @@ -12,8 +12,14 @@ URL: http://live.gnome.org/dconf #VCS: git:git://git.gnome.org/dconf Source0: http://download.gnome.org/sources/dconf/0.22/dconf-%{version}.tar.xz +# https://bugzilla.redhat.com/show_bug.cgi?id=1386841 +Patch0: dconf-0.26.0-Remove-libdbus-1-support.patch +Patch1: dconf-0.26.0-read-flag.patch + +# https://bugzilla.redhat.com/show_bug.cgi?id=1281253 +Patch2: dconf-0.26.0-permissions.patch + BuildRequires: glib2-devel >= %{glib2_version} -BuildRequires: gtk3-devel BuildRequires: libxml2-devel BuildRequires: dbus-devel BuildRequires: vala-devel >= %{vala_version} @@ -36,17 +42,13 @@ Requires: %{name}%{?_isa} = %{version}-%{release} dconf development package. Contains files needed for doing software development using dconf. -%package editor -Summary: Configuration editor for dconf -Group: Applications/System -Requires: %{name}%{?_isa} = %{version}-%{release} - -%description editor -dconf-editor allows you to browse and modify dconf databases. - - %prep %setup -q +%patch0 -p1 -R -b .libdbus +%patch1 -p1 -b .read-flag +%patch2 -p1 -b .permissions + +autoreconf -ivf %build %configure --disable-static @@ -68,7 +70,11 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/dconf/db/local.d/locks mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/dconf/db/site.d/locks mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/dconf/db/distro.d/locks -%find_lang dconf +# dconf-dbus-1 was removed in dconf 0.24, +# we keep just the library for compatibility +rm -fv $RPM_BUILD_ROOT%{_libdir}/pkgconfig/dconf-dbus-1.pc +rm -fv $RPM_BUILD_ROOT%{_includedir}/dconf-dbus-1/* +rmdir -v $RPM_BUILD_ROOT%{_includedir}/dconf-dbus-1/ %post /sbin/ldconfig @@ -86,31 +92,8 @@ fi glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : -%post editor -for d in hicolor HighContrast ; do - touch --no-create %{_datadir}/icons/$d &>/dev/null || : -done - -%postun editor -if [ $1 -eq 0 ] ; then - glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : - - for d in hicolor HighContrast ; do - touch --no-create %{_datadir}/icons/$d &>/dev/null || : - gtk-update-icon-cache %{_datadir}/icons/$d &>/dev/null || : - done -fi - -%posttrans editor -glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : - -for d in hicolor HighContrast ; do - gtk-update-icon-cache %{_datadir}/icons/$d &>/dev/null || : -done - - -%files -f dconf.lang -%doc COPYING +%files +%license COPYING %dir %{_sysconfdir}/dconf %dir %{_sysconfdir}/dconf/db %dir %{_sysconfdir}/dconf/profile @@ -139,23 +122,21 @@ done %{_includedir}/dconf %{_libdir}/libdconf.so %{_libdir}/pkgconfig/dconf.pc -%{_includedir}/dconf-dbus-1 %{_libdir}/libdconf-dbus-1.so -%{_libdir}/pkgconfig/dconf-dbus-1.pc %{_datadir}/gtk-doc/html/dconf %{_datadir}/vala -%files editor -%{_bindir}/dconf-editor -%{_datadir}/appdata/ca.desrt.dconf-editor.appdata.xml -%{_datadir}/applications/ca.desrt.dconf-editor.desktop -%{_datadir}/dbus-1/services/ca.desrt.dconf-editor.service -%{_datadir}/glib-2.0/schemas/ca.desrt.dconf-editor.gschema.xml -%{_datadir}/icons/hicolor/*/apps/dconf-editor.png -%{_datadir}/icons/HighContrast/*/apps/dconf-editor.png -%{_mandir}/man1/dconf-editor.1.gz - %changelog +* Mon Mar 6 2017 Marek Kasik - 0.26.0-2 +- Restore permissions on updated database +- Resolves: #1281253 + +* Fri Feb 10 2017 Marek Kasik - 0.26.0-1 +- Update to 0.26.0 +- Remove editor subpackage +- Return libdbus-1 library (not header or pkgconfig files) +- Resolves: #1386841 + * Tue Mar 24 2015 Marek Kasik - 0.22.0-2 - Remove unused patches - Resolves: #1174448 @@ -333,7 +314,7 @@ done * Wed Jun 02 2010 Bastien Nocera 0.3.1-2 - Rebuild against latest glib2 -* Tue May 24 2010 Matthias Clasen 0.3.1-1 +* Mon May 24 2010 Matthias Clasen 0.3.1-1 - Update to 0.3.1 - Add a -devel subpackage