Update port: sysutils/xfce4-battery-plugin

Update xfce4-battery-plugin to 0.2.0.

PR:		ports/56741
Submitted by:	Thorsten Greiner <thorsten.greiner@web.de>
This commit is contained in:
Edwin Groothuis 2003-09-24 12:01:53 +00:00
parent e927e0b286
commit edf55c7a6d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=89204
4 changed files with 15 additions and 58 deletions

View file

@ -6,7 +6,7 @@
#
PORTNAME= xfce4-battery-plugin
PORTVERSION= 0.1.2
PORTVERSION= 0.2.0
CATEGORIES= sysutils xfce
MASTER_SITES= http://download.berlios.de/xfce-goodies/
DIST_SUBDIR= xfce4

View file

@ -1 +1 @@
MD5 (xfce4/xfce4-battery-plugin-0.1.2.tar.gz) = 387ddb80deff5b9cbf5c5ac94dddbd8f
MD5 (xfce4/xfce4-battery-plugin-0.2.0.tar.gz) = ad6cbb65b356342bf1b474b612beadf4

View file

@ -1,5 +1,5 @@
--- configure.orig Wed Jul 23 22:20:56 2003
+++ configure Fri Aug 1 12:56:48 2003
--- configure.orig Sat Aug 9 04:05:09 2003
+++ configure Fri Sep 12 23:28:29 2003
@@ -19273,7 +19273,8 @@
@ -10,7 +10,7 @@
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
@@ -19567,7 +19568,7 @@
@@ -19651,7 +19652,7 @@
echo "$as_me:$LINENO: checking where to install panel plugins" >&5
echo $ECHO_N "checking where to install panel plugins... $ECHO_C" >&6

View file

@ -1,53 +1,10 @@
--- panel-plugin/battmon.c.orig Fri Jul 18 15:15:29 2003
+++ panel-plugin/battmon.c Fri Aug 1 12:14:50 2003
@@ -32,6 +32,10 @@
#ifdef __FreeBSD__
#include <machine/apm_bios.h>
+#include <fcntl.h>
+#ifndef APMDEVICE
+#define APMDEVICE "/dev/apm"
+#endif
#elif __OpenBSD__
#include <sys/param.h>
#include <machine/apmvar.h>
@@ -187,6 +191,9 @@
#else
struct apm_info apm;
#endif
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
+ int fd;
+#endif
int charge;
int time_remaining;
gboolean acline;
@@ -217,8 +224,6 @@
FreeBSD. Each time this functions is called (once every second)
the APM device is opened, read from and then closed.
*/
- int fd;
-
battmon->method = BM_BROKEN;
fd = open(APMDEVICE, O_RDONLY);
if (fd == -1) return TRUE;
@@ -232,12 +237,18 @@
time_remaining = apm.ai_batt_time;
time_remaining = time_remaining / 60; /* convert from seconds to minutes */
charge = apm.ai_batt_life;
+
+ /*
+ * Work around a bug in the FreeBSD ACPI APM emulation layer which will
+ * sometimes return funny values for the battery life.
+ */
+ if(charge > 100) {
+ charge = 100;
+ }
#elif __OpenBSD__
/* Code for OpenBSD by Joe Ammond <jra@twinight.org>. Using the same
procedure as for FreeBSD.
*/
- int fd;
-
battmon->method = BM_BROKEN;
fd = open(APMDEVICE, O_RDONLY);
if (fd == -1) return TRUE;
--- panel-plugin/battmon.c.orig Fri Sep 12 23:38:01 2003
+++ panel-plugin/battmon.c Fri Sep 12 23:38:24 2003
@@ -362,6 +362,7 @@
if(charge < 0) charge = 0;
+ if(charge > 100) charge = 100;
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(battmon->battstatus), charge / 100.0);
if(battmon->options.display_label){