Merge lp:~timo-jyrinki/gconf/ubuntu.support-s-to-as-migrations into lp:~ubuntu-desktop/gconf/ubuntu

Proposed by Timo Jyrinki
Status: Merged
Merged at revision: 101
Proposed branch: lp:~timo-jyrinki/gconf/ubuntu.support-s-to-as-migrations
Merge into: lp:~ubuntu-desktop/gconf/ubuntu
Diff against target: 121 lines (+84/-1)
5 files modified
debian/changelog (+15/-0)
debian/control (+0/-1)
debian/patches/0001-Support-s-to-as-migrations-v2.patch (+46/-0)
debian/patches/call-dbus_g_thread_init.patch (+21/-0)
debian/patches/series (+2/-0)
To merge this branch: bzr merge lp:~timo-jyrinki/gconf/ubuntu.support-s-to-as-migrations
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Approve
Review via email: mp+124428@code.launchpad.net

Description of the change

Proposed patch adds support for converting string gconf keys to array string gsettings keys. It will be tried if the string -> string conversion fails. The patch has been tested working, but is not optimal.

Continuation from https://code.launchpad.net/~timo-jyrinki/gconf/support-s-to-as-migrations/+merge/123744 which was against a wrong branch.

This also includes the ubuntu3 from that other branch that was already uploaded.

To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

approved, good work

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2012-03-23 21:43:22 +0000
3+++ debian/changelog 2012-09-14 13:58:04 +0000
4@@ -1,3 +1,18 @@
5+gconf (3.2.5-0ubuntu4) UNRELEASED; urgency=low
6+
7+ * debian/patches/0001-Support-s-to-as-migrations-v2.patch:
8+ - Support string to string array migrations (LP: #1048956)
9+
10+ -- Timo Jyrinki <timo-jyrinki@ubuntu.com> Wed, 12 Sep 2012 15:32:10 +0300
11+
12+gconf (3.2.5-0ubuntu3) quantal; urgency=low
13+
14+ * debian/patches/call-dbus_g_thread_init.patch:
15+ - Initialize dbus threads before doing anything. This fixes crashes in
16+ multithreaded applications that don't use libdbus directly. (LP: #1048341)
17+
18+ -- Chow Loong Jin <hyperair@debian.org> Tue, 11 Sep 2012 10:12:41 +0800
19+
20 gconf (3.2.5-0ubuntu2) precise; urgency=low
21
22 * Split gconf-service further into gconf-service and gconf-service-backend,
23
24=== modified file 'debian/control'
25--- debian/control 2012-03-23 21:43:17 +0000
26+++ debian/control 2012-09-14 13:58:04 +0000
27@@ -2,7 +2,6 @@
28 #
29 # Modifications should be made to debian/control.in instead.
30 # This file is regenerated automatically in the clean target.
31-
32 Source: gconf
33 Section: libs
34 Priority: optional
35
36=== added file 'debian/patches/0001-Support-s-to-as-migrations-v2.patch'
37--- debian/patches/0001-Support-s-to-as-migrations-v2.patch 1970-01-01 00:00:00 +0000
38+++ debian/patches/0001-Support-s-to-as-migrations-v2.patch 2012-09-14 13:58:04 +0000
39@@ -0,0 +1,46 @@
40+From 24a40aadce621d01ede0d4add76599145778b6f8 Mon Sep 17 00:00:00 2001
41+From: Timo Jyrinki <timo.jyrinki@iki.fi>
42+Date: Fri, 14 Sep 2012 09:46:57 +0300
43+Subject: [PATCH] Support 's' to 'as' migrations v2
44+
45+If a string's migration target is not a string, try to migrate it as a string array instead. It is a common change in schemas, so this is needed for example when migrating some metacity keys to org.gnome.desktop.wm.keybindings.
46+---
47+ gsettings/gsettings-data-convert.c | 22 ++++++++++++++++++++--
48+ 1 file changed, 20 insertions(+), 2 deletions(-)
49+
50+diff --git a/gsettings/gsettings-data-convert.c b/gsettings/gsettings-data-convert.c
51+index a8af942..48dfae9 100644
52+--- a/gsettings/gsettings-data-convert.c
53++++ b/gsettings/gsettings-data-convert.c
54+@@ -238,8 +238,26 @@ handle_file (const gchar *filename)
55+ g_print ("Set key '%s' to string '%s'\n", keys[j],
56+ gconf_value_get_string (value));
57+ else
58+- g_settings_set (settings, keys[j], "s",
59+- gconf_value_get_string (value));
60++ {
61++ GVariant *range, *type;
62++ range = g_settings_get_range (settings, keys[j]);
63++ g_variant_get (range, "(&sv)", NULL, &type);
64++
65++ if (g_variant_is_of_type (type, G_VARIANT_TYPE_STRING_ARRAY))
66++ {
67++ g_settings_set (settings, keys[j], "s",
68++ gconf_value_get_string (value));
69++ }
70++ else
71++ {
72++ if (verbose)
73++ g_debug ("Setting the target key '%s' as a string not possible, converting the string to a string array.\n", keys[j]);
74++ const gchar *array[2] = { gconf_value_get_string (value), NULL };
75++ g_settings_set_strv (settings, keys[j], array);
76++ }
77++ g_variant_unref (type);
78++ g_variant_unref (range);
79++ }
80+ break;
81+
82+ case GCONF_VALUE_INT:
83+--
84+1.7.10.4
85+
86
87=== added file 'debian/patches/call-dbus_g_thread_init.patch'
88--- debian/patches/call-dbus_g_thread_init.patch 1970-01-01 00:00:00 +0000
89+++ debian/patches/call-dbus_g_thread_init.patch 2012-09-14 13:58:04 +0000
90@@ -0,0 +1,21 @@
91+Author: Chow Loong Jin <hyperair@debian.org>
92+Description: Call dbus_g_thread_init before calling any dbus functions
93+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1048341
94+Index: gconf/gconf/gconf-dbus.c
95+===================================================================
96+--- gconf.orig/gconf/gconf-dbus.c 2012-09-11 09:54:10.056848441 +0800
97++++ gconf/gconf/gconf-dbus.c 2012-09-11 10:07:03.967826677 +0800
98+@@ -396,6 +396,13 @@
99+ return FALSE;
100+ }
101+
102++ /* Initialize DBus Glib for multithreading -- this fixes race conditions when
103++ multi-threaded applications use gconf. Additionally, although the API
104++ documentation says that dbus_g_thread_init() may only be called once, it is
105++ actually really a wrapper for dbus_threads_init_default() which casn be
106++ called as many times as necessary. */
107++ dbus_g_thread_init ();
108++
109+ dbus_error_init (&error);
110+
111+ global_conn = dbus_bus_get_private (DBUS_BUS_SESSION, &error);
112
113=== modified file 'debian/patches/series'
114--- debian/patches/series 2012-03-05 23:26:20 +0000
115+++ debian/patches/series 2012-09-14 13:58:04 +0000
116@@ -6,3 +6,5 @@
117 05_nodisplay_autostart.patch
118 06_onlyshowin_unity.patch
119 25_gconf-path-max-hurd.patch
120+call-dbus_g_thread_init.patch
121+0001-Support-s-to-as-migrations-v2.patch

Subscribers

People subscribed via source and target branches

to all changes: