Merge lp:~ubuntu-branches/ubuntu/precise/accountsservice/precise-201202030606 into lp:ubuntu/precise/accountsservice

Proposed by Ubuntu Package Importer
Status: Rejected
Rejected by: James Westby
Proposed branch: lp:~ubuntu-branches/ubuntu/precise/accountsservice/precise-201202030606
Merge into: lp:ubuntu/precise/accountsservice
Diff against target: 457 lines (+440/-0) (has conflicts)
3 files modified
data/langtools/del-profile-env-settings (+13/-0)
data/langtools/save-to-pam-env.OTHER (+36/-0)
debian/patches/0001-formats-locale-property.patch (+391/-0)
Conflict adding file data/langtools/del-profile-env-settings.  Moved existing file to data/langtools/del-profile-env-settings.moved.
Contents conflict in data/langtools/save-to-pam-env
Conflict adding file debian/patches/0001-formats-locale-property.patch.  Moved existing file to debian/patches/0001-formats-locale-property.patch.moved.
To merge this branch: bzr merge lp:~ubuntu-branches/ubuntu/precise/accountsservice/precise-201202030606
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+91394@code.launchpad.net

Description of the change

The package importer has detected a possible inconsistency between the package history in the archive and the history in bzr. As the archive is authoritative the importer has made lp:ubuntu/precise/accountsservice reflect what is in the archive and the old bzr branch has been pushed to lp:~ubuntu-branches/ubuntu/precise/accountsservice/precise-201202030606. This merge proposal was created so that an Ubuntu developer can review the situations and perform a merge/upload if necessary. There are three typical cases where this can happen.
  1. Where someone pushes a change to bzr and someone else uploads the package without that change. This is the reason that this check is done by the importer. If this appears to be the case then a merge/upload should be done if the changes that were in bzr are still desirable.
  2. The importer incorrectly detected the above situation when someone made a change in bzr and then uploaded it.
  3. The importer incorrectly detected the above situation when someone just uploaded a package and didn't touch bzr.

If this case doesn't appear to be the first situation then set the status of the merge proposal to "Rejected" and help avoid the problem in future by filing a bug at https://bugs.launchpad.net/udd linking to this merge proposal.

(this is an automatically generated message)

To post a comment you must log in.

Unmerged revisions

30. By Martin Pitt

releasing version 0.6.15-2ubuntu3

29. By Martin Pitt

debian/accountsservice.postinst: In the LANG migration, do not add all the
variables to a file which doesn't define LANG, so that we don't repeat
them in /etc/environment when they are already in /etc/default/locale.

28. By Martin Pitt

debian/libaccountsservice0.symbols: Fix versions of symbols from
0001-formats-locale-property.patch.

27. By Martin Pitt

debian/libaccountsservice0.symbols: Add new symbols from 0.6.15-2ubuntu1.

26. By Martin Pitt

debian/accountsservice.postinst: Only run the LANG migration when
upgrading to this version. Also, slightly improve the call to grep.

25. By Gunnar Hjalmarsson

* debian/patches/0001-formats-locale-property.patch and
  debian/libaccountsservice0.symbols:
  - Addition of FormatsLocale property and SetFormatsLocale method.
* debian/patches/0009-language-tools.patch:
  - Make SetLanguage() and SetFormatsLocale() write to
    ~/.pam_environment instead of ~/.profile (LP: #866062).
  - Make the LANG variable, which up to now has represented regional
    formats, denote the display language instead (LP: #877610).
* debian/patches/0010-set-language.patch:
  - If the Language or FormatsLocale property is not yet set when
    queried, respond with a sensible, dynamically generated fallback
    value.
  - Code added for migrating ~/.profile environment settings to
    ~/.pam_environment.
  - Don't alter any settings if SetLanguage is called from a language
    chooser on the greeter and /home is encrypted or not yet mounted.
  - Misc. code refactoring.
* debian/accountsservice.postinst:
  - Modify /etc/default/locale and /etc/environment due to a changed
    meaning of the LANG environment variable.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'data/langtools/del-profile-env-settings'
2--- data/langtools/del-profile-env-settings 1970-01-01 00:00:00 +0000
3+++ data/langtools/del-profile-env-settings 2012-02-03 06:12:20 +0000
4@@ -0,0 +1,13 @@
5+#!/bin/sh -e
6+
7+homedir=$1
8+
9+test -n "$homedir" || exit 1
10+
11+test -f "$homedir/.profile" && {
12+ cd "$homedir"
13+ for var in 'LANGUAGE' 'LANG' 'LC_MESSAGES' 'LC_CTYPE' 'LC_COLLATE'; do
14+ sed -i "/^export $var=\"[^[:space:]]*\"$/d" .profile
15+ done
16+}
17+
18
19=== renamed file 'data/langtools/del-profile-env-settings' => 'data/langtools/del-profile-env-settings.moved'
20=== added file 'data/langtools/save-to-pam-env.OTHER'
21--- data/langtools/save-to-pam-env.OTHER 1970-01-01 00:00:00 +0000
22+++ data/langtools/save-to-pam-env.OTHER 2012-02-03 06:12:20 +0000
23@@ -0,0 +1,36 @@
24+#!/bin/sh -e
25+#
26+# updates the ~/.pam_environment config file
27+
28+homedir=$1
29+locale_name=$2
30+language_list=$3
31+
32+[ -n "$homedir" -a -n "$locale_name" ] || exit 1
33+
34+# create ~/.pam_environment if it doesn't exist
35+touch "$homedir/.pam_environment" || exit 1
36+
37+save_to_pam_env() {
38+ var=$1; value=$2
39+ if [ "$( grep "^$var=" .pam_environment )" ]; then
40+ sed -r -i "s/^($var=).*/\1$value/" .pam_environment
41+ else
42+ echo "$var=$value" >> .pam_environment
43+ fi
44+}
45+
46+cd "$homedir"
47+if [ -n "$language_list" ]; then
48+ save_to_pam_env 'LANGUAGE' $language_list
49+ save_to_pam_env 'LANG' $locale_name
50+else
51+ for var in 'LC_NUMERIC' 'LC_TIME' 'LC_MONETARY' 'LC_PAPER' 'LC_NAME' \
52+ 'LC_ADDRESS' 'LC_TELEPHONE' 'LC_MEASUREMENT'; do
53+ save_to_pam_env $var $locale_name
54+ done
55+ echo $locale_name
56+fi
57+
58+exit 0
59+
60
61=== added file 'debian/patches/0001-formats-locale-property.patch'
62--- debian/patches/0001-formats-locale-property.patch 1970-01-01 00:00:00 +0000
63+++ debian/patches/0001-formats-locale-property.patch 2012-02-03 06:12:20 +0000
64@@ -0,0 +1,391 @@
65+Description: Addition of FormatsLocale property and SetFormatsLocale method.
66+Forwarded: https://bugs.freedesktop.org/42857
67+Author: Gunnar Hjalmarsson <ubuntu@gunnar.cc>
68+Last-Update: 2011-11-12
69+
70+--- accountsservice.orig/data/org.freedesktop.Accounts.User.xml 2011-10-17 21:56:32 +0200
71++++ accountsservice/data/org.freedesktop.Accounts.User.xml 2011-11-11 19:59:17 +0100
72+@@ -150,6 +150,41 @@
73+ </doc:doc>
74+ </method>
75+
76++ <method name="SetFormatsLocale">
77++ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
78++ <arg name="formats_locale" direction="in" type="s">
79++ <doc:doc>
80++ <doc:summary>
81++ The new regional formats, as a locale specification like "de_DE.UTF-8".
82++ </doc:summary>
83++ </doc:doc>
84++ </arg>
85++ <doc:doc>
86++ <doc:description>
87++ <doc:para>
88++ Sets the users regional formats.
89++ </doc:para>
90++ </doc:description>
91++ <doc:permission>
92++ The caller needs one of the following PolicyKit authorizations:
93++ <doc:list>
94++ <doc:item>
95++ <doc:term>org.freedesktop.accounts.change-own-user-data</doc:term>
96++ <doc:definition>To change his own language</doc:definition>
97++ </doc:item>
98++ <doc:item>
99++ <doc:term>org.freedesktop.accounts.user-administration</doc:term>
100++ <doc:definition>To change the language of another user</doc:definition>
101++ </doc:item>
102++ </doc:list>
103++ </doc:permission>
104++ <doc:errors>
105++ <doc:error name="org.freedesktop.Accounts.Error.PermissionDenied">if the caller lacks the appropriate PolicyKit authorization</doc:error>
106++ <doc:error name="org.freedesktop.Accounts.Error.Failed">if the operation failed</doc:error>
107++ </doc:errors>
108++ </doc:doc>
109++ </method>
110++
111+ <method name="SetXSession">
112+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
113+ <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="user_set_x_session"/>
114+@@ -621,6 +656,16 @@
115+ </doc:para>
116+ </doc:description>
117+ </doc:doc>
118++ </property>
119++
120++ <property name="FormatsLocale" type="s" access="read">
121++ <doc:doc>
122++ <doc:description>
123++ <doc:para>
124++ The users regional formats, as a locale specification like "de_DE.UTF-8".
125++ </doc:para>
126++ </doc:description>
127++ </doc:doc>
128+ </property>
129+
130+ <property name="XSession" type="s" access="read">
131+
132+--- accountsservice.orig/src/libaccountsservice/act-user.c 2011-10-17 21:56:32 +0200
133++++ accountsservice/src/libaccountsservice/act-user.c 2011-11-11 19:59:45 +0100
134+@@ -59,6 +59,7 @@
135+ PROP_LOGIN_FREQUENCY,
136+ PROP_ICON_FILE,
137+ PROP_LANGUAGE,
138++ PROP_FORMATS_LOCALE,
139+ PROP_X_SESSION,
140+ PROP_IS_LOADED
141+ };
142+@@ -88,6 +89,7 @@
143+ char *location;
144+ char *icon_file;
145+ char *language;
146++ char *formats_locale;
147+ char *x_session;
148+ GList *sessions;
149+ int login_frequency;
150+@@ -237,6 +239,9 @@
151+ case PROP_LANGUAGE:
152+ g_value_set_string (value, user->language);
153+ break;
154++ case PROP_FORMATS_LOCALE:
155++ g_value_set_string (value, user->formats_locale);
156++ break;
157+ case PROP_X_SESSION:
158+ g_value_set_string (value, user->x_session);
159+ break;
160+@@ -371,6 +376,13 @@
161+ NULL,
162+ G_PARAM_READABLE));
163+ g_object_class_install_property (gobject_class,
164++ PROP_FORMATS_LOCALE,
165++ g_param_spec_string ("formats_locale",
166++ "Regional Formats",
167++ "User's regional formats.",
168++ NULL,
169++ G_PARAM_READABLE));
170++ g_object_class_install_property (gobject_class,
171+ PROP_X_SESSION,
172+ g_param_spec_string ("x-session",
173+ "X session",
174+@@ -461,6 +473,7 @@
175+ g_free (user->email);
176+ g_free (user->location);
177+ g_free (user->language);
178++ g_free (user->formats_locale);
179+
180+ if (user->accounts_proxy != NULL) {
181+ g_object_unref (user->accounts_proxy);
182+@@ -834,6 +847,22 @@
183+ }
184+
185+ /**
186++ * act_user_get_formats_locale:
187++ * @user: a #ActUser
188++ *
189++ * Returns the path to the configured formats locale of @user.
190++ *
191++ * Returns: (transfer none): a path to an icon
192++ */
193++const char *
194++act_user_get_formats_locale (ActUser *user)
195++{
196++ g_return_val_if_fail (ACT_IS_USER (user), NULL);
197++
198++ return user->formats_locale;
199++}
200++
201++/**
202+ * act_user_get_x_session:
203+ * @user: a #ActUser
204+ *
205+@@ -1033,6 +1062,17 @@
206+ user->language = g_value_dup_string (value);
207+ g_object_notify (G_OBJECT (user), "language");
208+ }
209++
210++ } else if (strcmp (key, "FormatsLocale") == 0) {
211++ const char *new_formats_locale;
212++
213++ new_formats_locale = g_value_get_string (value);
214++ if (g_strcmp0 (user->formats_locale, new_formats_locale) != 0) {
215++ g_free (user->formats_locale);
216++ user->formats_locale = g_value_dup_string (value);
217++ g_object_notify (G_OBJECT (user), "formats_locale");
218++ }
219++
220+ } else if (strcmp (key, "XSession") == 0) {
221+ const char *new_x_session;
222+
223+@@ -1255,6 +1295,37 @@
224+ g_error_free (error);
225+ return;
226+ }
227++}
228++
229++/**
230++ * act_user_set_formats_locale:
231++ * @user: the user object to alter.
232++ * @formats_locale: a locale (e.g. en_US.utf8)
233++ *
234++ * Assigns a new formats locale for @user.
235++ *
236++ * Note this function is synchronous and ignores errors.
237++ **/
238++void
239++act_user_set_formats_locale (ActUser *user,
240++ const char *formats_locale)
241++{
242++ GError *error = NULL;
243++
244++ g_return_if_fail (ACT_IS_USER (user));
245++ g_return_if_fail (formats_locale != NULL);
246++ g_return_if_fail (DBUS_IS_G_PROXY (user->accounts_proxy));
247++
248++ if (!dbus_g_proxy_call (user->accounts_proxy,
249++ "SetFormatsLocale",
250++ &error,
251++ G_TYPE_STRING, formats_locale,
252++ G_TYPE_INVALID,
253++ G_TYPE_INVALID)) {
254++ g_warning ("SetFormatsLocale call failed: %s", error->message);
255++ g_error_free (error);
256++ return;
257++ }
258+ }
259+
260+ /**
261+
262+--- accountsservice.orig/src/libaccountsservice/act-user.h 2011-10-17 21:56:32 +0200
263++++ accountsservice/src/libaccountsservice/act-user.h 2011-11-11 20:00:15 +0100
264+@@ -71,6 +71,7 @@
265+ gboolean act_user_is_system_account (ActUser *user);
266+ const char *act_user_get_icon_file (ActUser *user);
267+ const char *act_user_get_language (ActUser *user);
268++const char *act_user_get_formats_locale (ActUser *user);
269+ const char *act_user_get_x_session (ActUser *user);
270+ const char *act_user_get_primary_session_id (ActUser *user);
271+
272+@@ -82,6 +83,8 @@
273+ const char *email);
274+ void act_user_set_language (ActUser *user,
275+ const char *language);
276++void act_user_set_formats_locale (ActUser *user,
277++ const char *formats_locale);
278+ void act_user_set_x_session (ActUser *user,
279+ const char *x_session);
280+ void act_user_set_location (ActUser *user,
281+
282+--- accountsservice.orig/src/user.c 2011-11-11 19:56:47 +0100
283++++ accountsservice/src/user.c 2011-11-11 19:57:36 +0100
284+@@ -60,6 +60,7 @@
285+ PROP_ACCOUNT_TYPE,
286+ PROP_EMAIL,
287+ PROP_LANGUAGE,
288++ PROP_FORMATS_LOCALE,
289+ PROP_X_SESSION,
290+ PROP_LOCATION,
291+ PROP_PASSWORD_MODE,
292+@@ -97,6 +98,7 @@
293+ gchar *shell;
294+ gchar *email;
295+ gchar *language;
296++ gchar *formats_locale;
297+ gchar *x_session;
298+ gchar *location;
299+ guint64 login_frequency;
300+@@ -130,6 +132,9 @@
301+ case PROP_LANGUAGE:
302+ user->language = g_value_dup_string (value);
303+ break;
304++ case PROP_FORMATS_LOCALE:
305++ user->formats_locale = g_value_dup_string (value);
306++ break;
307+ case PROP_X_SESSION:
308+ user->x_session = g_value_dup_string (value);
309+ break;
310+@@ -190,6 +195,9 @@
311+ case PROP_LANGUAGE:
312+ g_value_set_string (value, user->language);
313+ break;
314++ case PROP_FORMATS_LOCALE:
315++ g_value_set_string (value, user->formats_locale);
316++ break;
317+ case PROP_X_SESSION:
318+ g_value_set_string (value, user->x_session);
319+ break;
320+@@ -326,6 +334,13 @@
321+ NULL,
322+ G_PARAM_READABLE));
323+ g_object_class_install_property (gobject_class,
324++ PROP_FORMATS_LOCALE,
325++ g_param_spec_string ("formats_locale",
326++ "Regional Formats",
327++ "The regional formats for this user.",
328++ NULL,
329++ G_PARAM_READABLE));
330++ g_object_class_install_property (gobject_class,
331+ PROP_X_SESSION,
332+ g_param_spec_string ("x-session",
333+ "X Session",
334+@@ -395,6 +410,7 @@
335+ user->icon_file = NULL;
336+ user->email = NULL;
337+ user->language = NULL;
338++ user->formats_locale = NULL;
339+ user->x_session = NULL;
340+ user->location = NULL;
341+ user->password_mode = PASSWORD_MODE_REGULAR;
342+@@ -419,6 +435,7 @@
343+ g_free (user->icon_file);
344+ g_free (user->email);
345+ g_free (user->language);
346++ g_free (user->formats_locale);
347+ g_free (user->x_session);
348+ g_free (user->location);
349+ g_free (user->password_hint);
350+@@ -624,6 +641,12 @@
351+ user->language = s;
352+ }
353+
354++ s = g_key_file_get_string (keyfile, "User", "FormatsLocale", NULL);
355++ if (s != NULL) {
356++ g_free (user->formats_locale);
357++ user->formats_locale = s;
358++ }
359++
360+ s = g_key_file_get_string (keyfile, "User", "XSession", NULL);
361+ if (s != NULL) {
362+ g_free (user->x_session);
363+@@ -667,6 +690,9 @@
364+ if (user->language)
365+ g_key_file_set_string (keyfile, "User", "Language", user->language);
366+
367++ if (user->formats_locale)
368++ g_key_file_set_string (keyfile, "User", "FormatsLocale", user->formats_locale);
369++
370+ if (user->x_session)
371+ g_key_file_set_string (keyfile, "User", "XSession", user->x_session);
372+
373+@@ -1112,6 +1138,68 @@
374+
375+ return TRUE;
376+ }
377++
378++static void
379++user_change_formats_locale_authorized_cb (Daemon *daemon,
380++ User *user,
381++ DBusGMethodInvocation *context,
382++ gpointer data)
383++
384++{
385++ gchar *formats_locale = data;
386++
387++ if (g_strcmp0 (user->formats_locale, formats_locale) != 0) {
388++ g_free (user->formats_locale);
389++ user->formats_locale = g_strdup (formats_locale);
390++
391++ save_extra_data (user);
392++
393++ g_signal_emit (user, signals[CHANGED], 0);
394++
395++ g_object_notify (G_OBJECT (user), "formats_locale");
396++ }
397++
398++ dbus_g_method_return (context);
399++}
400++
401++gboolean
402++user_set_formats_locale (User *user,
403++ const gchar *formats_locale,
404++ DBusGMethodInvocation *context)
405++{
406++ gchar *sender;
407++ DBusConnection *connection;
408++ DBusError dbus_error;
409++ uid_t uid;
410++ const gchar *action_id;
411++
412++ connection = dbus_g_connection_get_connection (user->system_bus_connection);
413++ sender = dbus_g_method_get_sender (context);
414++ dbus_error_init (&dbus_error);
415++ uid = dbus_bus_get_unix_user (connection, sender, &dbus_error);
416++ if (dbus_error_is_set (&dbus_error)) {
417++ throw_error (context, ERROR_FAILED, dbus_error.message);
418++ dbus_error_free (&dbus_error);
419++
420++ return TRUE;
421++ }
422++
423++ if (user->uid == uid)
424++ action_id = "org.freedesktop.accounts.change-own-user-data";
425++ else
426++ action_id = "org.freedesktop.accounts.user-administration";
427++
428++ daemon_local_check_auth (user->daemon,
429++ user,
430++ action_id,
431++ TRUE,
432++ user_change_formats_locale_authorized_cb,
433++ context,
434++ g_strdup (formats_locale),
435++ (GDestroyNotify) g_free);
436++
437++ return TRUE;
438++}
439+
440+ static void
441+ user_change_x_session_authorized_cb (Daemon *daemon,
442+
443+--- accountsservice.orig/src/user.h 2011-10-17 21:56:32 +0200
444++++ accountsservice/src/user.h 2011-11-11 20:12:03 +0100
445+@@ -80,6 +80,9 @@
446+ gboolean user_set_language (User *user,
447+ const gchar *language,
448+ DBusGMethodInvocation *context);
449++gboolean user_set_formats_locale (User *user,
450++ const gchar *formats_locale,
451++ DBusGMethodInvocation *context);
452+ gboolean user_set_x_session (User *user,
453+ const gchar *x_session,
454+ DBusGMethodInvocation *context);
455+
456
457=== renamed file 'debian/patches/0001-formats-locale-property.patch' => 'debian/patches/0001-formats-locale-property.patch.moved'

Subscribers

People subscribed via source and target branches

to all changes: