From ab7a55e53fc209fd3cf355db3dc0d9b5a6685298 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 12 Apr 2012 00:01:12 +0000 Subject: Thu Apr 12 00:01:12 UTC 2012 --- community-testing/gnome-packagekit/PKGBUILD | 43 +++ .../gnome-packagekit/gnome-packagekit.install | 19 ++ .../gnome-settings-daemon-updates/PKGBUILD | 47 +++ .../gnome-settings-daemon-updates/arch.patch | 321 +++++++++++++++++++++ .../gnome-settings-daemon.install | 11 + .../systemd-fallback.patch | 154 ++++++++++ 6 files changed, 595 insertions(+) create mode 100644 community-testing/gnome-packagekit/PKGBUILD create mode 100644 community-testing/gnome-packagekit/gnome-packagekit.install create mode 100644 community-testing/gnome-settings-daemon-updates/PKGBUILD create mode 100644 community-testing/gnome-settings-daemon-updates/arch.patch create mode 100644 community-testing/gnome-settings-daemon-updates/gnome-settings-daemon.install create mode 100644 community-testing/gnome-settings-daemon-updates/systemd-fallback.patch (limited to 'community-testing') diff --git a/community-testing/gnome-packagekit/PKGBUILD b/community-testing/gnome-packagekit/PKGBUILD new file mode 100644 index 000000000..535845f6e --- /dev/null +++ b/community-testing/gnome-packagekit/PKGBUILD @@ -0,0 +1,43 @@ +# $Id: PKGBUILD 69218 2012-04-10 06:33:58Z jconder $ +# Maintainer: Jonathan Conder + +pkgname=gnome-packagekit +pkgver=3.4.0 +pkgrel=1 +pkgdesc='Collection of graphical tools for PackageKit to be used in the GNOME desktop' +arch=('i686' 'x86_64') +url='http://www.packagekit.org/' +license=('GPL') +depends=('dconf' 'desktop-file-utils' 'gtk3' 'hicolor-icon-theme' 'libnotify' + 'packagekit') +makedepends=('gconf' 'gtk-doc' 'intltool' 'libcanberra' 'upower') +optdepends=('polkit-gnome: required for privileged actions' + 'gnome-settings-daemon-updates: update and message notifications') +options=('!emptydirs' '!libtool') +install="$pkgname.install" +source=("http://ftp.gnome.org/pub/gnome/sources/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.xz") +sha256sums=('4f23be695b70bdda8b5c15237472a735bb1745af11dbc324eead9b988f2343c6') + +build() { + cd "$srcdir/$pkgname-$pkgver" + + _mime='application/x-xz-compressed-tar;application/x-servicepack;' + sed -i "s@MimeType=.*@MimeType=$_mime@" data/gpk-install-local-file.desktop.in + + sed -i 's@python@python2@' python/enum-convertor.py + sed -i 's@python enum-convertor.py@python2 enum-convertor.py@' python/packagekit/Makefile.{am,in} + + export PYTHON=/usr/bin/python2 + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --disable-gtk-doc \ + --disable-schemas-compile \ + --disable-scrollkeeper + make -s +} + +package() { + cd "$srcdir/$pkgname-$pkgver" + + make -s DESTDIR="$pkgdir" install +} diff --git a/community-testing/gnome-packagekit/gnome-packagekit.install b/community-testing/gnome-packagekit/gnome-packagekit.install new file mode 100644 index 000000000..620670d57 --- /dev/null +++ b/community-testing/gnome-packagekit/gnome-packagekit.install @@ -0,0 +1,19 @@ +post_install() { + usr/bin/glib-compile-schemas usr/share/glib-2.0/schemas + gtk-update-icon-cache -q -t -f usr/share/icons/hicolor + update-desktop-database -q +} + +pre_upgrade() { + if (( $(vercmp $2 2.91.90) < 0 )); then + usr/sbin/gconfpkg --uninstall gnome-packagekit + fi +} + +post_upgrade() { + post_install +} + +post_remove() { + post_install +} diff --git a/community-testing/gnome-settings-daemon-updates/PKGBUILD b/community-testing/gnome-settings-daemon-updates/PKGBUILD new file mode 100644 index 000000000..0358ab285 --- /dev/null +++ b/community-testing/gnome-settings-daemon-updates/PKGBUILD @@ -0,0 +1,47 @@ +# $Id: PKGBUILD 69220 2012-04-10 06:39:32Z jconder $ +# Maintainer: Jonathan Conder + +_pkgname=gnome-settings-daemon +pkgname=$_pkgname-updates +pkgver=3.4.0 +pkgrel=1 +pkgdesc="Updates plugin for the GNOME Settings daemon" +arch=('i686' 'x86_64') +license=('GPL') +depends=('gnome-packagekit' "$_pkgname") +makedepends=('intltool' 'gtk-doc' 'gnome-desktop' 'gnome-common' 'xf86-input-wacom') +options=('!emptydirs' '!libtool') +install=$_pkgname.install +url="http://www.gnome.org" +source=("http://ftp.gnome.org/pub/gnome/sources/$_pkgname/${pkgver%.*}/$_pkgname-$pkgver.tar.xz" + 'systemd-fallback.patch' + 'arch.patch') +sha256sums=('5639cbba28caa7b3e33990f49aeed11ed9325e78e76af2175d9ccd5ff298401d' + '82b721d0e274af15ed2770052d550d3162d2d37e5e9ee5e6fcebac1ed6cb8199' + '727ab3e8181464af32ba604b2931b77cd6d4fbf34e10bbba99bb213eb992466e') + +build() { + cd "$srcdir/$_pkgname-$pkgver" + + patch -Np1 -i "$srcdir/arch.patch" + patch -Np1 -i "$srcdir/systemd-fallback.patch" + + gnome-autogen.sh --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --libexecdir=/usr/lib/gnome-settings-daemon \ + --disable-static \ + --enable-systemd + + #https://bugzilla.gnome.org/show_bug.cgi?id=656231 + sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool + make -s +} + +package() { + cd "$srcdir/$_pkgname-$pkgver" + make -C 'plugins/updates' DESTDIR="${pkgdir}" install + + _schema='org.gnome.settings-daemon.plugins.updates.gschema.xml' + install -D -m644 "data/$_schema" "$pkgdir/usr/share/glib-2.0/schemas/$_schema" +} diff --git a/community-testing/gnome-settings-daemon-updates/arch.patch b/community-testing/gnome-settings-daemon-updates/arch.patch new file mode 100644 index 000000000..6718e4db9 --- /dev/null +++ b/community-testing/gnome-settings-daemon-updates/arch.patch @@ -0,0 +1,321 @@ +diff --git a/data/org.gnome.settings-daemon.plugins.updates.gschema.xml.in.in b/data/org.gnome.settings-daemon.plugins.updates.gschema.xml.in.in +index c09096a..3fa4159 100644 +--- a/data/org.gnome.settings-daemon.plugins.updates.gschema.xml.in.in ++++ b/data/org.gnome.settings-daemon.plugins.updates.gschema.xml.in.in +@@ -31,7 +31,7 @@ + <_description>Automatically download updates in the background without confirmation. Updates will be auto-downloaded when using wired network connnections, and also WiFi if 'connection-use-wifi' is enabled and mobile broadband if 'connection-use-mobile' is enabled. + + +- 'security' ++ 'none' + <_summary>Automatically install these types of updates + <_description>Automatically install these types of updates. + +@@ -56,7 +56,7 @@ + <_description>The last time we notified the user about non-critical updates. Value is in seconds since the epoch, or zero for never. + + +- 604800 ++ 0 + <_summary>How often to check for distribution upgrades + <_description>How often to check for distribution upgrades. Value is in seconds. + +diff --git a/plugins/updates/Makefile.am b/plugins/updates/Makefile.am +index 9510c65..191092d 100644 +--- a/plugins/updates/Makefile.am ++++ b/plugins/updates/Makefile.am +@@ -15,7 +15,9 @@ libupdates_la_SOURCES = \ + gsd-updates-firmware.h \ + gsd-updates-firmware.c \ + gsd-updates-manager.h \ +- gsd-updates-manager.c ++ gsd-updates-manager.c \ ++ gsd-updates-watch.h \ ++ gsd-updates-watch.c + + libupdates_la_CPPFLAGS = \ + -I$(top_srcdir)/gnome-settings-daemon \ +diff --git a/plugins/updates/gsd-updates-manager.c b/plugins/updates/gsd-updates-manager.c +index 4ed046c..9842b32 100644 +--- a/plugins/updates/gsd-updates-manager.c ++++ b/plugins/updates/gsd-updates-manager.c +@@ -32,6 +32,7 @@ + #include "gsd-updates-manager.h" + #include "gsd-updates-firmware.h" + #include "gsd-updates-refresh.h" ++#include "gsd-updates-watch.h" + #include "gsd-updates-common.h" + #include "gnome-settings-profile.h" + +@@ -46,6 +47,7 @@ struct GsdUpdatesManagerPrivate + GCancellable *cancellable; + GsdUpdatesRefresh *refresh; + GsdUpdatesFirmware *firmware; ++ GsdUpdatesWatch *watch; + GSettings *settings_ftp; + GSettings *settings_gsd; + GSettings *settings_http; +@@ -1358,6 +1360,9 @@ gsd_updates_manager_start (GsdUpdatesManager *manager, + g_signal_connect (manager->priv->refresh, "get-updates", + G_CALLBACK (due_get_updates_cb), manager); + ++ /* watch transaction progress */ ++ manager->priv->watch = gsd_updates_watch_new (); ++ + /* get http settings */ + manager->priv->settings_http = g_settings_new ("org.gnome.system.proxy.http"); + g_signal_connect (manager->priv->settings_http, "changed", +@@ -1463,6 +1468,10 @@ gsd_updates_manager_stop (GsdUpdatesManager *manager) + g_object_unref (manager->priv->firmware); + manager->priv->firmware = NULL; + } ++ if (manager->priv->watch != NULL) { ++ g_object_unref (manager->priv->watch); ++ manager->priv->watch = NULL; ++ } + if (manager->priv->proxy_session != NULL) { + g_object_unref (manager->priv->proxy_session); + manager->priv->proxy_session = NULL; +diff --git a/plugins/updates/gsd-updates-watch.c b/plugins/updates/gsd-updates-watch.c +new file mode 100644 +index 0000000..37d8778 +--- /dev/null ++++ b/plugins/updates/gsd-updates-watch.c +@@ -0,0 +1,179 @@ ++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- ++ * ++ * Copyright (C) 2007-2011 Richard Hughes ++ * ++ * Licensed under the GNU General Public License Version 2 ++ * ++ * 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 2 of the License, 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, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++ */ ++ ++#include "config.h" ++ ++#include ++#include ++#include ++#include ++ ++#include "gsd-updates-watch.h" ++ ++#define GSD_UPDATES_WATCH_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_UPDATES_WATCH, GsdUpdatesWatchPrivate)) ++ ++struct GsdUpdatesWatchPrivate ++{ ++ PkTransactionList *tlist; ++ PkClient *client; ++}; ++ ++G_DEFINE_TYPE (GsdUpdatesWatch, gsd_updates_watch, G_TYPE_OBJECT) ++ ++static void ++gsd_updates_watch_message_cb (PkMessage *item, GsdUpdatesWatch *watch) ++{ ++ NotifyNotification *notification; ++ gchar *details = NULL; ++ const gchar *title, *message; ++ GError *error = NULL; ++ ++ g_return_if_fail (PK_IS_MESSAGE (item)); ++ g_return_if_fail (GSD_IS_UPDATES_WATCH (watch)); ++ ++ g_object_get (item, "details", &details, NULL); ++ title = _("More information"); ++ message = details; ++ ++ /* use a better title if available */ ++ if (g_str_has_prefix (details, "")) { ++ gchar *end = g_strstr_len (details, -1, "\n"); ++ if (end != NULL && g_strstr_len (details, end - details, "\n") == NULL) { ++ title = details + 3; ++ *end = '\0'; ++ message = end + 5; ++ } ++ } ++ ++ /* display a notification */ ++ notification = notify_notification_new (title, message, NULL); ++ notify_notification_set_app_name (notification, _("Software Updates")); ++ notify_notification_set_timeout (notification, NOTIFY_EXPIRES_NEVER); ++ notify_notification_set_urgency (notification, NOTIFY_URGENCY_NORMAL); ++ ++ if (!notify_notification_show (notification, &error)) { ++ g_warning ("error: %s", error->message); ++ g_error_free (error); ++ } ++ ++ g_free (details); ++} ++ ++static void ++gsd_updates_watch_adopt_cb (PkClient *client, GAsyncResult *res, GsdUpdatesWatch *watch) ++{ ++ PkResults *results; ++ PkProgress *progress = NULL; ++ guint uid; ++ GPtrArray *array; ++ GError *error = NULL; ++ ++ g_return_if_fail (PK_IS_CLIENT (client)); ++ g_return_if_fail (G_IS_ASYNC_RESULT (res)); ++ g_return_if_fail (GSD_IS_UPDATES_WATCH (watch)); ++ ++ results = pk_client_generic_finish (client, res, &error); ++ if (results == NULL) { ++ g_warning ("failed to adopt: %s", error->message); ++ g_error_free (error); ++ goto out; ++ } ++ ++ g_object_get (results, "progress", &progress, NULL); ++ g_object_get (progress, "uid", &uid, NULL); ++ ++ /* only display messages from the same user */ ++ if (uid != getuid ()) { ++ g_printerr ("ignoring messages\n"); ++ goto out; ++ } ++ ++ array = pk_results_get_message_array (results); ++ g_ptr_array_foreach (array, (GFunc) gsd_updates_watch_message_cb, watch); ++ g_ptr_array_unref (array); ++ ++out: ++ if (progress != NULL) { ++ g_object_unref (progress); ++ } ++ if (results != NULL) { ++ g_object_unref (results); ++ } ++} ++ ++static void ++gsd_updates_watch_tlist_added_cb (PkTransactionList *tlist, const gchar *tid, GsdUpdatesWatch *watch) ++{ ++ g_return_if_fail (PK_IS_TRANSACTION_LIST (tlist)); ++ g_return_if_fail (tid != NULL); ++ g_return_if_fail (GSD_IS_UPDATES_WATCH (watch)); ++ ++ /* listen for messages */ ++ pk_client_adopt_async (watch->priv->client, tid, NULL, NULL, NULL, ++ (GAsyncReadyCallback) gsd_updates_watch_adopt_cb, watch); ++} ++ ++static void ++gsd_updates_watch_init (GsdUpdatesWatch *watch) ++{ ++ g_return_if_fail (GSD_IS_UPDATES_WATCH (watch)); ++ ++ watch->priv = GSD_UPDATES_WATCH_GET_PRIVATE (watch); ++ watch->priv->tlist = pk_transaction_list_new (); ++ watch->priv->client = pk_client_new (); ++ ++ g_signal_connect (watch->priv->tlist, "added", ++ G_CALLBACK (gsd_updates_watch_tlist_added_cb), watch); ++} ++ ++static void ++gsd_updates_watch_finalize (GObject *object) ++{ ++ GsdUpdatesWatch *watch; ++ ++ g_return_if_fail (GSD_IS_UPDATES_WATCH (object)); ++ ++ watch = GSD_UPDATES_WATCH (object); ++ g_return_if_fail (watch->priv != NULL); ++ ++ if (watch->priv->tlist != NULL) { ++ g_object_unref (watch->priv->tlist); ++ } ++ if (watch->priv->client != NULL) { ++ g_object_unref (watch->priv->client); ++ } ++ ++ G_OBJECT_CLASS (gsd_updates_watch_parent_class)->finalize (object); ++} ++ ++GsdUpdatesWatch * ++gsd_updates_watch_new (void) ++{ ++ return GSD_UPDATES_WATCH (g_object_new (GSD_TYPE_UPDATES_WATCH, NULL)); ++} ++ ++static void ++gsd_updates_watch_class_init (GsdUpdatesWatchClass *klass) ++{ ++ GObjectClass *object_class = G_OBJECT_CLASS (klass); ++ object_class->finalize = gsd_updates_watch_finalize; ++ g_type_class_add_private (klass, sizeof (GsdUpdatesWatchPrivate)); ++} +diff --git a/plugins/updates/gsd-updates-watch.h b/plugins/updates/gsd-updates-watch.h +new file mode 100644 +index 0000000..d90976e +--- /dev/null ++++ b/plugins/updates/gsd-updates-watch.h +@@ -0,0 +1,52 @@ ++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- ++ * ++ * Copyright (C) 2007-2011 Richard Hughes ++ * ++ * Licensed under the GNU General Public License Version 2 ++ * ++ * 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 2 of the License, 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, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++ */ ++ ++#ifndef __GSD_UPDATES_WATCH_H ++#define __GSD_UPDATES_WATCH_H ++ ++#include ++ ++G_BEGIN_DECLS ++ ++#define GSD_TYPE_UPDATES_WATCH (gsd_updates_watch_get_type ()) ++#define GSD_UPDATES_WATCH(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_UPDATES_WATCH, GsdUpdatesWatch)) ++#define GSD_UPDATES_WATCH_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GSD_TYPE_UPDATES_WATCH, GsdUpdatesWatchClass)) ++#define GSD_IS_UPDATES_WATCH(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_UPDATES_WATCH)) ++ ++typedef struct GsdUpdatesWatchPrivate GsdUpdatesWatchPrivate; ++ ++typedef struct ++{ ++ GObject parent; ++ GsdUpdatesWatchPrivate *priv; ++} GsdUpdatesWatch; ++ ++typedef struct ++{ ++ GObjectClass parent_class; ++} GsdUpdatesWatchClass; ++ ++GType gsd_updates_watch_get_type (void); ++GsdUpdatesWatch *gsd_updates_watch_new (void); ++ ++G_END_DECLS ++ ++#endif /* __GSD_UPDATES_WATCH_H */ diff --git a/community-testing/gnome-settings-daemon-updates/gnome-settings-daemon.install b/community-testing/gnome-settings-daemon-updates/gnome-settings-daemon.install new file mode 100644 index 000000000..326aa98a2 --- /dev/null +++ b/community-testing/gnome-settings-daemon-updates/gnome-settings-daemon.install @@ -0,0 +1,11 @@ +post_install() { + glib-compile-schemas usr/share/glib-2.0/schemas +} + +post_upgrade() { + post_install +} + +post_remove() { + post_install +} diff --git a/community-testing/gnome-settings-daemon-updates/systemd-fallback.patch b/community-testing/gnome-settings-daemon-updates/systemd-fallback.patch new file mode 100644 index 000000000..ffe953c63 --- /dev/null +++ b/community-testing/gnome-settings-daemon-updates/systemd-fallback.patch @@ -0,0 +1,154 @@ +commit b9ded09387f0b99ece97baee18595eb9e86a5b9b +Author: Jan Alexander Steffens (heftig) +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 + #include + + 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, -- cgit v1.2.3-54-g00ecf