Update to upower-0.9.22.

ok landry@ (maintainer)
This commit is contained in:
ajacoutot 2013-10-12 08:10:13 +00:00
parent 06a9102560
commit 9af689ecc8
6 changed files with 109 additions and 27 deletions

View File

@ -1,11 +1,10 @@
# $OpenBSD: Makefile,v 1.32 2013/10/03 13:42:16 landry Exp $
# $OpenBSD: Makefile,v 1.33 2013/10/12 08:10:13 ajacoutot Exp $
ONLY_FOR_ARCHS =${APM_ARCHS}
COMMENT = userland power management interface
DISTNAME = upower-0.9.21
REVISION = 1
DISTNAME = upower-0.9.22
EXTRACT_SUFX = .tar.xz
CATEGORIES = sysutils
SHARED_LIBS += upower-glib 0.0 # 1.2

View File

@ -1,2 +1,2 @@
SHA256 (upower-0.9.21.tar.xz) = E8KOCnACkaMi4GdIlP7f1pWImEWrgt8qr9aZqpvbsuI=
SIZE (upower-0.9.21.tar.xz) = 421204
SHA256 (upower-0.9.22.tar.xz) = 0x6BtRI8WX3xvSRqNx3V7siLP9719RQIbxU1d+MhXxE=
SIZE (upower-0.9.22.tar.xz) = 395800

View File

@ -0,0 +1,83 @@
$OpenBSD: patch-libupower-glib_up-client_c,v 1.1 2013/10/12 08:10:13 ajacoutot Exp $
From e4858d94343bba2afbebcd1a4925c981a38a9579 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Thu, 10 Oct 2013 16:32:41 +0000
Subject: up-client: Really don't overwrite retval with prop values
--- libupower-glib/up-client.c.orig Tue Oct 8 17:02:57 2013
+++ libupower-glib/up-client.c Fri Oct 11 15:49:09 2013
@@ -360,7 +360,7 @@ up_client_get_properties_sync (UpClient *client, GCanc
prop_val = g_value_get_boolean (value) && allowed;
if (prop_val != client->priv->can_suspend) {
- client->priv->can_suspend = ret;
+ client->priv->can_suspend = prop_val;
g_object_notify (G_OBJECT(client), "can-suspend");
}
@@ -376,7 +376,7 @@ up_client_get_properties_sync (UpClient *client, GCanc
prop_val = g_value_get_boolean (value) && allowed;
if (prop_val != client->priv->can_hibernate) {
- client->priv->can_hibernate = ret;
+ client->priv->can_hibernate = prop_val;
g_object_notify (G_OBJECT(client), "can-hibernate");
}
#endif /* ENABLE_DEPRECATED */
@@ -388,7 +388,7 @@ up_client_get_properties_sync (UpClient *client, GCanc
}
prop_val = g_value_get_boolean (value);
if (prop_val != client->priv->lid_is_closed) {
- client->priv->lid_is_closed = ret;
+ client->priv->lid_is_closed = prop_val;
g_object_notify (G_OBJECT(client), "lid-is-closed");
}
@@ -399,7 +399,7 @@ up_client_get_properties_sync (UpClient *client, GCanc
}
prop_val = g_value_get_boolean (value);
if (prop_val != client->priv->on_battery) {
- client->priv->on_battery = ret;
+ client->priv->on_battery = prop_val;
g_object_notify (G_OBJECT(client), "on-battery");
}
@@ -410,7 +410,7 @@ up_client_get_properties_sync (UpClient *client, GCanc
}
prop_val = g_value_get_boolean (value);
if (prop_val != client->priv->on_low_battery) {
- client->priv->on_low_battery = ret;
+ client->priv->on_low_battery = prop_val;
g_object_notify (G_OBJECT(client), "on-low-battery");
}
@@ -421,7 +421,7 @@ up_client_get_properties_sync (UpClient *client, GCanc
}
prop_val = g_value_get_boolean (value);
if (prop_val != client->priv->lid_is_present) {
- client->priv->lid_is_present = ret;
+ client->priv->lid_is_present = prop_val;
g_object_notify (G_OBJECT(client), "lid-is-present");
}
@@ -431,8 +431,8 @@ up_client_get_properties_sync (UpClient *client, GCanc
goto out;
}
prop_val = g_value_get_boolean (value);
- if (ret != client->priv->is_docked) {
- client->priv->is_docked = ret;
+ if (prop_val != client->priv->is_docked) {
+ client->priv->is_docked = prop_val;
g_object_notify (G_OBJECT(client), "is-docked");
}
@@ -443,7 +443,7 @@ up_client_get_properties_sync (UpClient *client, GCanc
}
prop_val = g_value_get_boolean (value);
if (prop_val != client->priv->lid_force_sleep) {
- client->priv->lid_force_sleep = ret;
+ client->priv->lid_force_sleep = prop_val;
g_object_notify (G_OBJECT(client), "lid-force-sleep");
}

View File

@ -0,0 +1,18 @@
$OpenBSD: patch-libupower-glib_up-wakeups_c,v 1.1 2013/10/12 08:10:13 ajacoutot Exp $
From d43ab28a29420a61d031908abbf1d13b2cb35796 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Thu, 10 Oct 2013 16:59:08 +0000
Subject: lib: Fix a small memory leak
--- libupower-glib/up-wakeups.c.orig Thu Jun 14 12:49:37 2012
+++ libupower-glib/up-wakeups.c Fri Oct 11 15:49:11 2013
@@ -377,6 +377,8 @@ up_wakeups_finalize (GObject *object)
g_object_unref (wakeups->priv->proxy);
if (wakeups->priv->prop_proxy != NULL)
g_object_unref (wakeups->priv->prop_proxy);
+ if (wakeups->priv->bus)
+ dbus_g_connection_unref (wakeups->priv->bus);
G_OBJECT_CLASS (up_wakeups_parent_class)->finalize (object);
}

View File

@ -1,14 +1,12 @@
$OpenBSD: patch-src_openbsd_up-backend_c,v 1.11 2013/10/03 13:42:17 landry Exp $
$OpenBSD: patch-src_openbsd_up-backend_c,v 1.12 2013/10/12 08:10:13 ajacoutot Exp $
- Two OpenBSD fixes: recognize fully charged or absent battery
https://bugs.freedesktop.org/show_bug.cgi?id=70064
- Remove unneeded g_thread_init():
https://bugs.freedesktop.org/show_bug.cgi?id=62795
- Use g_thread_try_new() instead of deprecated g_thread_create()
https://bugs.freedesktop.org/show_bug.cgi?id=70071
--- src/openbsd/up-backend.c.orig Thu Jan 3 21:47:08 2013
+++ src/openbsd/up-backend.c Thu Oct 3 13:30:46 2013
--- src/openbsd/up-backend.c.orig Fri Sep 20 18:47:11 2013
+++ src/openbsd/up-backend.c Fri Oct 11 15:48:03 2013
@@ -305,7 +305,7 @@ static gboolean
up_backend_update_battery_state(UpDevice* device)
{
@ -77,11 +75,9 @@ $OpenBSD: patch-src_openbsd_up-backend_c,v 1.11 2013/10/03 13:42:17 landry Exp $
(void*) NULL);
if(up_native_get_sensordev("acpibat0", &sdev))
up_backend_update_acpibat_state(device, sdev);
@@ -556,9 +590,8 @@ up_backend_init (UpBackend *backend)
device_class->get_low_battery = up_apm_device_get_low_battery;
@@ -557,7 +591,7 @@ up_backend_init (UpBackend *backend)
device_class->get_online = up_apm_device_get_online;
device_class->refresh = up_apm_device_refresh;
- g_thread_init (NULL);
/* creates thread */
- if((backend->priv->apm_thread = (GThread*) g_thread_create((GThreadFunc)up_backend_apm_event_thread, (void*) backend, FALSE, &err) == NULL))
+ if((backend->priv->apm_thread = (GThread*) g_thread_try_new("apm-poller",(GThreadFunc)up_backend_apm_event_thread, (void*) backend, &err) == NULL))

View File

@ -1,14 +0,0 @@
$OpenBSD: patch-src_up-main_c,v 1.3 2013/10/03 13:42:18 landry Exp $
Backport upstream 7933b0e55234fca86809dad1dee53f0d8e2b96ec
--- src/up-main.c.orig Thu Oct 3 13:26:34 2013
+++ src/up-main.c Thu Oct 3 13:27:24 2013
@@ -204,7 +204,9 @@ main (gint argc, gchar **argv)
{ NULL}
};
+#if !defined(GLIB_VERSION_2_36)
g_type_init ();
+#endif
context = g_option_context_new ("upower daemon");
g_option_context_add_main_entries (context, options, NULL);