packages: gnome-settings-daemon/gnome-settings-daemon.spec, gnome-settings-...

kiesiu kiesiu at pld-linux.org
Sun Apr 1 13:23:09 CEST 2012


Author: kiesiu                       Date: Sun Apr  1 11:23:09 2012 GMT
Module: packages                      Tag: HEAD
---- Log message:
- patch for runtime fallback to ConsoleKit
- rel. 3

---- Files affected:
packages/gnome-settings-daemon:
   gnome-settings-daemon.spec (1.47 -> 1.48) , systemd-fallback.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/gnome-settings-daemon/gnome-settings-daemon.spec
diff -u packages/gnome-settings-daemon/gnome-settings-daemon.spec:1.47 packages/gnome-settings-daemon/gnome-settings-daemon.spec:1.48
--- packages/gnome-settings-daemon/gnome-settings-daemon.spec:1.47	Sun Apr  1 00:31:23 2012
+++ packages/gnome-settings-daemon/gnome-settings-daemon.spec	Sun Apr  1 13:23:03 2012
@@ -9,7 +9,7 @@
 Summary(pl.UTF-8):	Demon ustawień GNOME
 Name:		gnome-settings-daemon
 Version:	3.4.0
-Release:	2
+Release:	3
 Epoch:		1
 License:	GPL v2+
 Group:		X11/Applications
@@ -17,6 +17,7 @@
 # Source0-md5:	c58f2656315e96a3e56c8e73c709f20e
 Patch0:		%{name}-pa-reconnect.patch
 Patch1:		%{name}-link.patch
+%{?with_systemd:Patch2: systemd-fallback.patch}
 URL:		http://www.gnome.org/
 BuildRequires:	PackageKit-devel >= 0.6.13
 BuildRequires:	autoconf >= 2.60
@@ -89,6 +90,7 @@
 %setup -q
 %patch0 -p1
 %patch1 -p1
+%{?with_systemd:%patch2 -p1}
 
 %build
 %{__glib_gettextize}
@@ -202,6 +204,10 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.48  2012/04/01 11:23:03  kiesiu
+- patch for runtime fallback to ConsoleKit
+- rel. 3
+
 Revision 1.47  2012/03/31 22:31:23  kiesiu
 - update systemd bcond description
 - added systemd bcond BR

================================================================
Index: packages/gnome-settings-daemon/systemd-fallback.patch
diff -u /dev/null packages/gnome-settings-daemon/systemd-fallback.patch:1.1
--- /dev/null	Sun Apr  1 13:23:09 2012
+++ packages/gnome-settings-daemon/systemd-fallback.patch	Sun Apr  1 13:23:03 2012
@@ -0,0 +1,154 @@
+commit b9ded09387f0b99ece97baee18595eb9e86a5b9b
+Author: Jan Alexander Steffens (heftig) <jan.steffens at gmail.com>
+Date:   Mon Mar 12 01:52:54 2012 +0100
+
+    Fallback to CK if systemd is not available
+    
+    Be nice to distributions where systemd is optional. This will select
+    the code path at runtime depending on whether the system was booted
+    using systemd.
+
+diff --git a/configure.ac b/configure.ac
+index 3b4789f..d522852 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -299,7 +299,7 @@ AC_ARG_ENABLE([systemd],
+               [with_systemd=$enableval],
+               [with_systemd=no])
+ if test "$with_systemd" = "yes" ; then
+-  PKG_CHECK_MODULES(SYSTEMD, [libsystemd-login])
++  PKG_CHECK_MODULES(SYSTEMD, [libsystemd-daemon libsystemd-login])
+   AC_DEFINE(HAVE_SYSTEMD, 1, [Define if systemd is used for session tracking])
+   SESSION_TRACKING=systemd
+ else
+diff --git a/gnome-settings-daemon/gnome-settings-session.c b/gnome-settings-daemon/gnome-settings-session.c
+index 5786300..83fe21e 100644
+--- a/gnome-settings-daemon/gnome-settings-session.c
++++ b/gnome-settings-daemon/gnome-settings-session.c
+@@ -30,6 +30,7 @@
+ #include "gnome-settings-session.h"
+ 
+ #ifdef HAVE_SYSTEMD
++#include <systemd/sd-daemon.h>
+ #include <systemd/sd-login.h>
+ 
+ typedef struct
+@@ -130,10 +131,9 @@ struct GnomeSettingsSessionPrivate
+ {
+ #ifdef HAVE_SYSTEMD
+         GSource                   *sd_source;
+-#else
++#endif
+ 	GDBusProxy		*proxy_session;
+ 	GCancellable		*cancellable;
+-#endif
+ 	gchar			*session_id;
+ 	GnomeSettingsSessionState state;
+ };
+@@ -237,7 +237,7 @@ sessions_changed (gpointer user_data)
+         return TRUE;
+ }
+ 
+-#else /* HAVE_SYSTEMD */
++#endif /* HAVE_SYSTEMD */
+ 
+ static void
+ gnome_settings_session_proxy_signal_cb (GDBusProxy *proxy,
+@@ -371,22 +371,25 @@ got_manager_proxy_cb (GObject *source_object, GAsyncResult *res, gpointer user_d
+ 	g_object_unref (proxy_manager);
+ }
+ 
+-#endif /* HAVE_SYSTEMD */
+-
+ static void
+ gnome_settings_session_init (GnomeSettingsSession *session)
+ {
+ 	session->priv = GNOME_SETTINGS_SESSION_GET_PRIVATE (session);
+ 
+ #ifdef HAVE_SYSTEMD
+-        sd_pid_get_session (getpid(), &session->priv->session_id);
++        session->priv->sd_source = NULL;
++
++        if (sd_booted () > 0) {
++                sd_pid_get_session (getpid(), &session->priv->session_id);
+ 
+-        session->priv->sd_source = sd_source_new ();
+-        g_source_set_callback (session->priv->sd_source, sessions_changed, session, NULL);
+-        g_source_attach (session->priv->sd_source, NULL);
++                session->priv->sd_source = sd_source_new ();
++                g_source_set_callback (session->priv->sd_source, sessions_changed, session, NULL);
++                g_source_attach (session->priv->sd_source, NULL);
+ 
+-        sessions_changed (session);
+-#else
++                sessions_changed (session);
++                return;
++        }
++#endif
+ 	session->priv->cancellable = g_cancellable_new ();
+ 
+ 	/* connect to ConsoleKit */
+@@ -399,7 +402,6 @@ gnome_settings_session_init (GnomeSettingsSession *session)
+ 				  session->priv->cancellable,
+ 				  got_manager_proxy_cb,
+ 				  session);
+-#endif
+ }
+ 
+ static void
+@@ -415,15 +417,17 @@ gnome_settings_session_finalize (GObject *object)
+         if (session->priv->sd_source != NULL) {
+                 g_source_destroy (session->priv->sd_source);
+                 g_source_unref (session->priv->sd_source);
++                goto out;
+         }
+-#else
++#endif
++
+ 	g_cancellable_cancel (session->priv->cancellable);
+ 
+ 	if (session->priv->proxy_session != NULL)
+ 		g_object_unref (session->priv->proxy_session);
+ 	g_object_unref (session->priv->cancellable);
+-#endif
+ 
++out:
+ 	G_OBJECT_CLASS (gnome_settings_session_parent_class)->finalize (object);
+ }
+ 
+diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
+index 8db04e5..9883d76 100644
+--- a/plugins/power/gsd-power-manager.c
++++ b/plugins/power/gsd-power-manager.c
+@@ -2031,7 +2031,7 @@ systemd_stop (void)
+         g_object_unref (bus);
+ }
+ 
+-#else
++#endif
+ 
+ static void
+ consolekit_stop_cb (GObject *source_object,
+@@ -2081,7 +2081,6 @@ consolekit_stop (void)
+                            consolekit_stop_cb, NULL);
+         g_object_unref (proxy);
+ }
+-#endif
+ 
+ static void
+ upower_sleep_cb (GObject *source_object,
+@@ -2135,10 +2134,11 @@ do_power_action_type (GsdPowerManager *manager,
+                  * hibernate is not available and is marginally better
+                  * than just powering down the computer mid-write */
+ #ifdef HAVE_SYSTEMD
+-                systemd_stop ();
+-#else
+-                consolekit_stop ();
++                if (sd_booted () > 0)
++                        systemd_stop ();
++                else
+ #endif
++                        consolekit_stop ();
+                 break;
+         case GSD_POWER_ACTION_BLANK:
+                 ret = gnome_rr_screen_set_dpms_mode (manager->priv->x11_screen,
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/packages/gnome-settings-daemon/gnome-settings-daemon.spec?r1=1.47&r2=1.48



More information about the pld-cvs-commit mailing list