Fix history in upower :
- don't try to fetch from dev/apm if the fd isn't available yet (to be discussed with upstream) - use var/db/upower to store history files Fixes graphs in gnome-power-statistics...
This commit is contained in:
parent
79ed7d1737
commit
20ab02eecb
@ -1,4 +1,4 @@
|
||||
# $OpenBSD: Makefile,v 1.6 2011/06/02 17:09:32 kili Exp $
|
||||
# $OpenBSD: Makefile,v 1.7 2011/06/17 15:08:36 landry Exp $
|
||||
|
||||
ONLY_FOR_ARCHS =${APM_ARCHS}
|
||||
|
||||
@ -8,7 +8,7 @@ DISTNAME = upower-0.9.11
|
||||
CATEGORIES = sysutils
|
||||
SHARED_LIBS += upower-glib 0.0 # 1.1
|
||||
|
||||
REVISION = 0
|
||||
REVISION = 1
|
||||
|
||||
HOMEPAGE = http://upower.freedesktop.org/
|
||||
MASTER_SITES = ${HOMEPAGE}/releases/
|
||||
|
25
sysutils/upower/patches/patch-src_openbsd_up-backend_c
Normal file
25
sysutils/upower/patches/patch-src_openbsd_up-backend_c
Normal file
@ -0,0 +1,25 @@
|
||||
$OpenBSD: patch-src_openbsd_up-backend_c,v 1.1 2011/06/17 15:08:36 landry Exp $
|
||||
Return true if apm_fd wasn't initialized yet - fixes history
|
||||
--- src/openbsd/up-backend.c.orig Thu Jun 16 09:19:40 2011
|
||||
+++ src/openbsd/up-backend.c Thu Jun 16 09:20:38 2011
|
||||
@@ -62,7 +62,7 @@ enum {
|
||||
|
||||
static guint signals [SIGNAL_LAST] = { 0 };
|
||||
|
||||
-int apm_fd; /* ugly global.. needs to move to a device native object */
|
||||
+int apm_fd = 0; /* ugly global.. needs to move to a device native object */
|
||||
|
||||
G_DEFINE_TYPE (UpBackend, up_backend, G_TYPE_OBJECT)
|
||||
|
||||
@@ -423,6 +423,11 @@ up_apm_device_refresh(UpDevice* device)
|
||||
UpDeviceKind type;
|
||||
GTimeVal timeval;
|
||||
gboolean ret;
|
||||
+
|
||||
+ if (apm_fd == 0) {
|
||||
+ g_debug("refresh callback called but apm_fd is not initialized yet");
|
||||
+ return TRUE;
|
||||
+ }
|
||||
|
||||
g_object_get (device, "type", &type, NULL);
|
||||
|
13
sysutils/upower/patches/patch-src_up-history_c
Normal file
13
sysutils/upower/patches/patch-src_up-history_c
Normal file
@ -0,0 +1,13 @@
|
||||
$OpenBSD: patch-src_up-history_c,v 1.1 2011/06/17 15:08:36 landry Exp $
|
||||
Set var/db/upower as dir for history files
|
||||
--- src/up-history.c.orig Mon Jun 13 16:28:21 2011
|
||||
+++ src/up-history.c Mon Jun 13 16:28:29 2011
|
||||
@@ -888,7 +888,7 @@ up_history_init (UpHistory *history)
|
||||
history->priv->data_time_empty = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
|
||||
history->priv->save_id = 0;
|
||||
history->priv->max_data_age = UP_HISTORY_DEFAULT_MAX_DATA_AGE;
|
||||
- history->priv->dir = g_build_filename (PACKAGE_LOCALSTATE_DIR, "lib", "upower", NULL);
|
||||
+ history->priv->dir = g_build_filename ("/var", "db", "upower", NULL);
|
||||
}
|
||||
|
||||
/**
|
@ -1,4 +1,4 @@
|
||||
@comment $OpenBSD: PLIST,v 1.2 2011/05/24 16:02:39 ajacoutot Exp $
|
||||
@comment $OpenBSD: PLIST,v 1.3 2011/06/17 15:08:36 landry Exp $
|
||||
%%SHARED%%
|
||||
@bin bin/upower
|
||||
include/libupower-glib/
|
||||
@ -33,6 +33,7 @@ share/dbus-1/system-services/
|
||||
share/dbus-1/system-services/org.freedesktop.UPower.service
|
||||
share/doc/pkg-readmes/${FULLPKGNAME}
|
||||
share/examples/upower/
|
||||
@sample /var/db/upower/
|
||||
share/examples/upower/UPower/
|
||||
@sample ${SYSCONFDIR}/UPower/
|
||||
share/examples/upower/UPower/UPower.conf
|
||||
|
Loading…
Reference in New Issue
Block a user