Date: Monday, August 5, 2013 @ 18:46:31 Author: heftig Revision: 192081
archrelease: copy trunk to testing-i686, testing-x86_64 Added: gnome-settings-daemon/repos/testing-i686/ gnome-settings-daemon/repos/testing-i686/0001-power-Use-logind-to-discover-critical-action-availab.patch (from rev 192080, gnome-settings-daemon/trunk/0001-power-Use-logind-to-discover-critical-action-availab.patch) gnome-settings-daemon/repos/testing-i686/PKGBUILD (from rev 192080, gnome-settings-daemon/trunk/PKGBUILD) gnome-settings-daemon/repos/testing-i686/gnome-settings-daemon.install (from rev 192080, gnome-settings-daemon/trunk/gnome-settings-daemon.install) gnome-settings-daemon/repos/testing-x86_64/ gnome-settings-daemon/repos/testing-x86_64/0001-power-Use-logind-to-discover-critical-action-availab.patch (from rev 192080, gnome-settings-daemon/trunk/0001-power-Use-logind-to-discover-critical-action-availab.patch) gnome-settings-daemon/repos/testing-x86_64/PKGBUILD (from rev 192080, gnome-settings-daemon/trunk/PKGBUILD) gnome-settings-daemon/repos/testing-x86_64/gnome-settings-daemon.install (from rev 192080, gnome-settings-daemon/trunk/gnome-settings-daemon.install) --------------------------------------------------------------------------------+ testing-i686/0001-power-Use-logind-to-discover-critical-action-availab.patch | 77 ++++++++++ testing-i686/PKGBUILD | 42 +++++ testing-i686/gnome-settings-daemon.install | 12 + testing-x86_64/0001-power-Use-logind-to-discover-critical-action-availab.patch | 77 ++++++++++ testing-x86_64/PKGBUILD | 42 +++++ testing-x86_64/gnome-settings-daemon.install | 12 + 6 files changed, 262 insertions(+) Copied: gnome-settings-daemon/repos/testing-i686/0001-power-Use-logind-to-discover-critical-action-availab.patch (from rev 192080, gnome-settings-daemon/trunk/0001-power-Use-logind-to-discover-critical-action-availab.patch) =================================================================== --- testing-i686/0001-power-Use-logind-to-discover-critical-action-availab.patch (rev 0) +++ testing-i686/0001-power-Use-logind-to-discover-critical-action-availab.patch 2013-08-05 16:46:31 UTC (rev 192081) @@ -0,0 +1,77 @@ +From 1271864ddfc053a1567d046b5fcdf8351da3f438 Mon Sep 17 00:00:00 2001 +From: "Jan Alexander Steffens (heftig)" <jan.steff...@gmail.com> +Date: Mon, 5 Aug 2013 18:15:00 +0200 +Subject: [PATCH] power: Use logind to discover critical action availability + +The upower functionality is deprecated and will return an +error unless upower is built with --enable-deprecated. + +Follows a similar patch to gnome-control-center. +--- + plugins/power/gsd-power-manager.c | 42 ++++++++++++++++++++++++++++----------- + 1 file changed, 30 insertions(+), 12 deletions(-) + +diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c +index fde90ef..8bd124f 100644 +--- a/plugins/power/gsd-power-manager.c ++++ b/plugins/power/gsd-power-manager.c +@@ -27,7 +27,6 @@ + #include <string.h> + #include <glib/gi18n.h> + #include <gtk/gtk.h> +-#define UPOWER_ENABLE_DEPRECATED 1 + #include <libupower-glib/upower.h> + #include <libnotify/notify.h> + #include <canberra-gtk.h> +@@ -1164,18 +1163,37 @@ static GsdPowerActionType + manager_critical_action_get (GsdPowerManager *manager, + gboolean is_ups) + { +- GsdPowerActionType policy; ++ GsdPowerActionType policy = GSD_POWER_ACTION_SHUTDOWN; ++ GsdPowerActionType setpolicy; ++ GVariant *result = NULL; ++ gchar *s; + +- policy = g_settings_get_enum (manager->priv->settings, "critical-battery-action"); +- if (policy == GSD_POWER_ACTION_SUSPEND) { +- if (is_ups == FALSE && +- up_client_get_can_suspend (manager->priv->up_client)) +- return policy; +- return GSD_POWER_ACTION_SHUTDOWN; +- } else if (policy == GSD_POWER_ACTION_HIBERNATE) { +- if (up_client_get_can_hibernate (manager->priv->up_client)) +- return policy; +- return GSD_POWER_ACTION_SHUTDOWN; ++ setpolicy = g_settings_get_enum (manager->priv->settings, "critical-battery-action"); ++ ++ if (setpolicy == GSD_POWER_ACTION_SUSPEND) { ++ if (is_ups == FALSE) { ++ result = g_dbus_proxy_call_sync (manager->priv->logind_proxy, ++ "CanSuspend", ++ NULL, ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, NULL, NULL); ++ } ++ } else if (setpolicy == GSD_POWER_ACTION_HIBERNATE) { ++ result = g_dbus_proxy_call_sync (manager->priv->logind_proxy, ++ "CanHibernate", ++ NULL, ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, NULL, NULL); ++ } else { ++ /* Other actions need no check */ ++ return setpolicy; ++ } ++ ++ if (result) { ++ g_variant_get (result, "(s)", &s); ++ if (g_strcmp0 (s, "yes") == 0) ++ policy = setpolicy; ++ g_variant_unref (result); + } + + return policy; +-- +1.8.3.4 + Copied: gnome-settings-daemon/repos/testing-i686/PKGBUILD (from rev 192080, gnome-settings-daemon/trunk/PKGBUILD) =================================================================== --- testing-i686/PKGBUILD (rev 0) +++ testing-i686/PKGBUILD 2013-08-05 16:46:31 UTC (rev 192081) @@ -0,0 +1,42 @@ +# $Id$ +# Maintainer: Jan Alexander Steffens (heftig) <jan.steff...@gmail.com> + +pkgname=gnome-settings-daemon +pkgver=3.8.4 +pkgrel=2 +pkgdesc="The GNOME Settings daemon" +arch=('i686' 'x86_64') +license=('GPL') +depends=('dconf' 'gnome-desktop' 'gsettings-desktop-schemas' 'hicolor-icon-theme' 'libcanberra-pulse' 'libnotify' + 'libsystemd' 'libwacom' 'pulseaudio' 'pulseaudio-alsa' 'upower' 'ibus' 'librsvg') +makedepends=('intltool' 'xf86-input-wacom' 'libxslt' 'docbook-xsl') +options=('!emptydirs' '!libtool') +install=gnome-settings-daemon.install +url="http://www.gnome.org" +groups=('gnome') +source=(http://ftp.gnome.org/pub/gnome/sources/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.xz + 0001-power-Use-logind-to-discover-critical-action-availab.patch) +sha256sums=('03ad56a8d517faf0754efcf2e7e26257e9ddbe32ef2931f3579138659cc178bc' + '9825d3486665d87d4fc54355a6d318d68f5d3caeb286bdd659147920a85c56d9') + +prepare() { + cd $pkgname-$pkgver + patch -Np1 -i ../0001-power-Use-logind-to-discover-critical-action-availab.patch +} + +build() { + cd $pkgname-$pkgver + + ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ + --libexecdir=/usr/lib/$pkgname --disable-static + + #https://bugzilla.gnome.org/show_bug.cgi?id=656231 + sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool + + make +} + +package() { + cd $pkgname-$pkgver + make DESTDIR="$pkgdir" install +} Copied: gnome-settings-daemon/repos/testing-i686/gnome-settings-daemon.install (from rev 192080, gnome-settings-daemon/trunk/gnome-settings-daemon.install) =================================================================== --- testing-i686/gnome-settings-daemon.install (rev 0) +++ testing-i686/gnome-settings-daemon.install 2013-08-05 16:46:31 UTC (rev 192081) @@ -0,0 +1,12 @@ +post_install() { + glib-compile-schemas /usr/share/glib-2.0/schemas + gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor +} + +post_upgrade() { + post_install +} + +post_remove() { + post_install +} Copied: gnome-settings-daemon/repos/testing-x86_64/0001-power-Use-logind-to-discover-critical-action-availab.patch (from rev 192080, gnome-settings-daemon/trunk/0001-power-Use-logind-to-discover-critical-action-availab.patch) =================================================================== --- testing-x86_64/0001-power-Use-logind-to-discover-critical-action-availab.patch (rev 0) +++ testing-x86_64/0001-power-Use-logind-to-discover-critical-action-availab.patch 2013-08-05 16:46:31 UTC (rev 192081) @@ -0,0 +1,77 @@ +From 1271864ddfc053a1567d046b5fcdf8351da3f438 Mon Sep 17 00:00:00 2001 +From: "Jan Alexander Steffens (heftig)" <jan.steff...@gmail.com> +Date: Mon, 5 Aug 2013 18:15:00 +0200 +Subject: [PATCH] power: Use logind to discover critical action availability + +The upower functionality is deprecated and will return an +error unless upower is built with --enable-deprecated. + +Follows a similar patch to gnome-control-center. +--- + plugins/power/gsd-power-manager.c | 42 ++++++++++++++++++++++++++++----------- + 1 file changed, 30 insertions(+), 12 deletions(-) + +diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c +index fde90ef..8bd124f 100644 +--- a/plugins/power/gsd-power-manager.c ++++ b/plugins/power/gsd-power-manager.c +@@ -27,7 +27,6 @@ + #include <string.h> + #include <glib/gi18n.h> + #include <gtk/gtk.h> +-#define UPOWER_ENABLE_DEPRECATED 1 + #include <libupower-glib/upower.h> + #include <libnotify/notify.h> + #include <canberra-gtk.h> +@@ -1164,18 +1163,37 @@ static GsdPowerActionType + manager_critical_action_get (GsdPowerManager *manager, + gboolean is_ups) + { +- GsdPowerActionType policy; ++ GsdPowerActionType policy = GSD_POWER_ACTION_SHUTDOWN; ++ GsdPowerActionType setpolicy; ++ GVariant *result = NULL; ++ gchar *s; + +- policy = g_settings_get_enum (manager->priv->settings, "critical-battery-action"); +- if (policy == GSD_POWER_ACTION_SUSPEND) { +- if (is_ups == FALSE && +- up_client_get_can_suspend (manager->priv->up_client)) +- return policy; +- return GSD_POWER_ACTION_SHUTDOWN; +- } else if (policy == GSD_POWER_ACTION_HIBERNATE) { +- if (up_client_get_can_hibernate (manager->priv->up_client)) +- return policy; +- return GSD_POWER_ACTION_SHUTDOWN; ++ setpolicy = g_settings_get_enum (manager->priv->settings, "critical-battery-action"); ++ ++ if (setpolicy == GSD_POWER_ACTION_SUSPEND) { ++ if (is_ups == FALSE) { ++ result = g_dbus_proxy_call_sync (manager->priv->logind_proxy, ++ "CanSuspend", ++ NULL, ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, NULL, NULL); ++ } ++ } else if (setpolicy == GSD_POWER_ACTION_HIBERNATE) { ++ result = g_dbus_proxy_call_sync (manager->priv->logind_proxy, ++ "CanHibernate", ++ NULL, ++ G_DBUS_CALL_FLAGS_NONE, ++ -1, NULL, NULL); ++ } else { ++ /* Other actions need no check */ ++ return setpolicy; ++ } ++ ++ if (result) { ++ g_variant_get (result, "(s)", &s); ++ if (g_strcmp0 (s, "yes") == 0) ++ policy = setpolicy; ++ g_variant_unref (result); + } + + return policy; +-- +1.8.3.4 + Copied: gnome-settings-daemon/repos/testing-x86_64/PKGBUILD (from rev 192080, gnome-settings-daemon/trunk/PKGBUILD) =================================================================== --- testing-x86_64/PKGBUILD (rev 0) +++ testing-x86_64/PKGBUILD 2013-08-05 16:46:31 UTC (rev 192081) @@ -0,0 +1,42 @@ +# $Id$ +# Maintainer: Jan Alexander Steffens (heftig) <jan.steff...@gmail.com> + +pkgname=gnome-settings-daemon +pkgver=3.8.4 +pkgrel=2 +pkgdesc="The GNOME Settings daemon" +arch=('i686' 'x86_64') +license=('GPL') +depends=('dconf' 'gnome-desktop' 'gsettings-desktop-schemas' 'hicolor-icon-theme' 'libcanberra-pulse' 'libnotify' + 'libsystemd' 'libwacom' 'pulseaudio' 'pulseaudio-alsa' 'upower' 'ibus' 'librsvg') +makedepends=('intltool' 'xf86-input-wacom' 'libxslt' 'docbook-xsl') +options=('!emptydirs' '!libtool') +install=gnome-settings-daemon.install +url="http://www.gnome.org" +groups=('gnome') +source=(http://ftp.gnome.org/pub/gnome/sources/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.xz + 0001-power-Use-logind-to-discover-critical-action-availab.patch) +sha256sums=('03ad56a8d517faf0754efcf2e7e26257e9ddbe32ef2931f3579138659cc178bc' + '9825d3486665d87d4fc54355a6d318d68f5d3caeb286bdd659147920a85c56d9') + +prepare() { + cd $pkgname-$pkgver + patch -Np1 -i ../0001-power-Use-logind-to-discover-critical-action-availab.patch +} + +build() { + cd $pkgname-$pkgver + + ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ + --libexecdir=/usr/lib/$pkgname --disable-static + + #https://bugzilla.gnome.org/show_bug.cgi?id=656231 + sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool + + make +} + +package() { + cd $pkgname-$pkgver + make DESTDIR="$pkgdir" install +} Copied: gnome-settings-daemon/repos/testing-x86_64/gnome-settings-daemon.install (from rev 192080, gnome-settings-daemon/trunk/gnome-settings-daemon.install) =================================================================== --- testing-x86_64/gnome-settings-daemon.install (rev 0) +++ testing-x86_64/gnome-settings-daemon.install 2013-08-05 16:46:31 UTC (rev 192081) @@ -0,0 +1,12 @@ +post_install() { + glib-compile-schemas /usr/share/glib-2.0/schemas + gtk-update-icon-cache -q -t -f /usr/share/icons/hicolor +} + +post_upgrade() { + post_install +} + +post_remove() { + post_install +}