Hi ports,
here's an update to upower 0.9.17, some of our fixes were included
upstream. Not that now by default, upowerd will run apm -C when running
on battery and apm -A when on AC, this can be disabled by setting
RunPowersaveCommand to false in etc/UPower/UPower.conf.
Landry
? upower-0.9.15-libupower-glib.so.0.0
? upower-0.9.17-libupower-glib.so.0.0
? upower-0.9.17.diff
Index: Makefile
===================================================================
RCS file: /cvs/ports/sysutils/upower/Makefile,v
retrieving revision 1.17
diff -u -r1.17 Makefile
--- Makefile 3 Mar 2012 17:30:17 -0000 1.17
+++ Makefile 26 Jun 2012 19:28:09 -0000
@@ -4,7 +4,7 @@
COMMENT = userland power management interface
-DISTNAME = upower-0.9.15
+DISTNAME = upower-0.9.17
EXTRACT_SUFX = .tar.xz
CATEGORIES = sysutils
SHARED_LIBS += upower-glib 0.0 # 1.1
Index: distinfo
===================================================================
RCS file: /cvs/ports/sysutils/upower/distinfo,v
retrieving revision 1.6
diff -u -r1.6 distinfo
--- distinfo 3 Jan 2012 21:50:06 -0000 1.6
+++ distinfo 26 Jun 2012 19:28:09 -0000
@@ -1,5 +1,5 @@
-MD5 (upower-0.9.15.tar.xz) = lQOoU+iUYw4CPuJE0pX9Jw==
-RMD160 (upower-0.9.15.tar.xz) = BCI3kdsHML1UgMIse/S6K8N9ijA=
-SHA1 (upower-0.9.15.tar.xz) = Vl2ZRMHKAbTdTrkyW8qBg4eZll8=
-SHA256 (upower-0.9.15.tar.xz) = 1ZQUgPMtzuR0AbP2UEhccfcOfrDZJTe/S2JBAkimI4w=
-SIZE (upower-0.9.15.tar.xz) = 404444
+MD5 (upower-0.9.17.tar.xz) = nvf8jsQ4VC8BTzo0VSgiqg==
+RMD160 (upower-0.9.17.tar.xz) = LZnjpKBcqg5e9G61aMxgWz0z5ik=
+SHA1 (upower-0.9.17.tar.xz) = sAFJMKiAVN9EWajKw/GtTjldjUA=
+SHA256 (upower-0.9.17.tar.xz) = z59o0o/snKz7RAVMKZaod6nvSkSc/ieTlNRkQt4VMig=
+SIZE (upower-0.9.17.tar.xz) = 402336
Index: patches/patch-configure
===================================================================
RCS file: /cvs/ports/sysutils/upower/patches/patch-configure,v
retrieving revision 1.8
diff -u -r1.8 patch-configure
--- patches/patch-configure 3 Jan 2012 21:50:06 -0000 1.8
+++ patches/patch-configure 26 Jun 2012 19:28:09 -0000
@@ -4,9 +4,9 @@
Fix DATADIRNAME: see LOCALBASE/share/aclocal/glib-gettext.m4.
---- configure.orig Tue Oct 4 15:53:55 2011
-+++ configure Mon Jan 2 18:25:45 2012
-@@ -13435,10 +13435,6 @@ else
+--- configure.orig Wed May 16 23:31:39 2012
++++ configure Tue Jun 26 09:28:56 2012
+@@ -13494,10 +13494,6 @@ else
fi
@@ -17,7 +17,7 @@
# i18n support
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested"
>&5
-@@ -13984,6 +13980,9 @@ else
+@@ -14043,6 +14039,9 @@ else
DATADIRNAME=lib
fi
Index: patches/patch-src_openbsd_up-backend_c
===================================================================
RCS file: /cvs/ports/sysutils/upower/patches/patch-src_openbsd_up-backend_c,v
retrieving revision 1.4
diff -u -r1.4 patch-src_openbsd_up-backend_c
--- patches/patch-src_openbsd_up-backend_c 3 Jan 2012 21:50:06 -0000
1.4
+++ patches/patch-src_openbsd_up-backend_c 26 Jun 2012 19:28:09 -0000
@@ -1,76 +1,10 @@
$OpenBSD: patch-src_openbsd_up-backend_c,v 1.4 2012/01/03 21:50:06 landry Exp $
-Return true if apm_fd wasn't initialized yet - fixes history
-
-XXX Sometimes apm(4) is not fast enough in calculating the right
-time-to-empty value and 'minutes_left' is left as -1, causing
-gnome-power-manager to show something like "1193046 hours 27 minutes
-of battery power remaining". To avoid this, check that battery is
-discharging *and* minutes_left is positive, otherwise set
-new_time_to_emtpy to zero XXX
-
Properly initialize update-time when creating devices
---- src/openbsd/up-backend.c.orig Tue May 31 12:07:03 2011
-+++ src/openbsd/up-backend.c Mon Jan 2 20:40:45 2012
-@@ -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)
-
-@@ -324,8 +324,11 @@ up_backend_update_battery_state(UpDevice* device)
- if (a.ac_state == APM_AC_ON)
- new_state = UP_DEVICE_STATE_CHARGING;
-
-- // zero out new_time_to empty if we're not discharging
-- new_time_to_empty = (new_state == UP_DEVICE_STATE_DISCHARGING ?
a.minutes_left : 0);
-+ // zero out new_time_to_empty if we're not discharging, if minutes_left
has a negative value
-+ if (new_state == UP_DEVICE_STATE_DISCHARGING && (int)a.minutes_left > 0)
-+ new_time_to_empty = a.minutes_left;
-+ else
-+ new_time_to_empty = 0;
-
- if (cur_state != new_state ||
- percentage != (gdouble) a.battery_life ||
-@@ -377,8 +380,10 @@ up_backend_update_acpibat_state(UpDevice* device, stru
- typev = sens.type;
- bst_cap = sens.value / 1000000.0f;
- }
-- if (sens.type == SENSOR_INTEGER &&
!strcmp(sens.desc, "rate"))
-- bst_rate = sens.value / 1000.0f;
-+ if ((sens.type == SENSOR_AMPS || sens.type ==
SENSOR_WATTS) && !strcmp(sens.desc, "rate")) {
-+ typev = sens.type;
-+ bst_rate = sens.value / 1000000.0f;
-+ }
- /*
- bif_dvolt = "voltage" = unused ?
- capacity = lastfull/dcap * 100 ?
-@@ -388,7 +393,7 @@ up_backend_update_acpibat_state(UpDevice* device, stru
- }
- }
- }
-- if (typev == SENSOR_AMPHOUR) {
-+ if (typev == SENSOR_AMPHOUR || typev == SENSOR_AMPS) {
- bst_cap *= bst_volt;
- bif_lowcap *= bst_volt;
- bif_lastfullcap *= bst_volt;
-@@ -424,6 +429,11 @@ up_apm_device_refresh(UpDevice* device)
- 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);
-
- switch (type) {
-@@ -544,6 +554,7 @@ static void
+--- src/openbsd/up-backend.c.orig Fri Jan 6 14:41:03 2012
++++ src/openbsd/up-backend.c Tue Jun 26 09:28:56 2012
+@@ -529,6 +529,7 @@ static void
up_backend_init (UpBackend *backend)
{
GError *err = NULL;
@@ -78,7 +12,7 @@
UpDeviceClass *device_class;
backend->priv = UP_BACKEND_GET_PRIVATE (backend);
-@@ -573,6 +584,7 @@ up_backend_init (UpBackend *backend)
+@@ -558,6 +559,7 @@ up_backend_init (UpBackend *backend)
}
/* setup dummy */
@@ -86,7 +20,7 @@
g_object_set (backend->priv->battery,
"type", UP_DEVICE_KIND_BATTERY,
"power-supply", TRUE,
-@@ -582,11 +594,13 @@ up_backend_init (UpBackend *backend)
+@@ -567,11 +569,13 @@ up_backend_init (UpBackend *backend)
"state", UP_DEVICE_STATE_UNKNOWN,
"percentage", 0.0f,
"time-to-empty", (gint64) 0,
Index: patches/patch-tools_Makefile_in
===================================================================
RCS file: /cvs/ports/sysutils/upower/patches/patch-tools_Makefile_in,v
retrieving revision 1.4
diff -u -r1.4 patch-tools_Makefile_in
--- patches/patch-tools_Makefile_in 3 Jan 2012 21:50:06 -0000 1.4
+++ patches/patch-tools_Makefile_in 26 Jun 2012 19:28:09 -0000
@@ -1,7 +1,7 @@
$OpenBSD: patch-tools_Makefile_in,v 1.4 2012/01/03 21:50:06 landry Exp $
---- tools/Makefile.in.orig Tue Oct 4 15:53:54 2011
-+++ tools/Makefile.in Mon Jan 2 18:25:45 2012
-@@ -300,6 +300,7 @@ upower_LDFLAGS = -pthread
+--- tools/Makefile.in.orig Wed May 16 23:31:39 2012
++++ tools/Makefile.in Tue Jun 26 09:28:56 2012
+@@ -301,6 +301,7 @@ upower_LDFLAGS = -pthread
upower_LDADD = \
$(DBUS_GLIB_LIBS) \
$(UPOWER_LIBS) \