pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/xbattbar More ACPI-related changes:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/475d16703e87
branches:  trunk
changeset: 463199:475d16703e87
user:      mycroft <mycroft%pkgsrc.org@localhost>
date:      Sat Nov 01 09:25:31 2003 +0000

description:
More ACPI-related changes:
* Recognize "charge" in addition to "energy".
* Test ENVSYS_FCURVALID.

diffstat:

 sysutils/xbattbar/distinfo         |   4 ++--
 sysutils/xbattbar/patches/patch-ab |  16 ++++++++++------
 2 files changed, 12 insertions(+), 8 deletions(-)

diffs (57 lines):

diff -r c5b6c69299c1 -r 475d16703e87 sysutils/xbattbar/distinfo
--- a/sysutils/xbattbar/distinfo        Sat Nov 01 08:28:47 2003 +0000
+++ b/sysutils/xbattbar/distinfo        Sat Nov 01 09:25:31 2003 +0000
@@ -1,6 +1,6 @@
-$NetBSD: distinfo,v 1.6 2003/11/01 04:03:18 mrg Exp $
+$NetBSD: distinfo,v 1.7 2003/11/01 09:25:31 mycroft Exp $
 
 SHA1 (xbattbar_1.4.2.tar.gz) = 14e9aafd62919e4a625d3f84df3b074b9eef8279
 Size (xbattbar_1.4.2.tar.gz) = 14079 bytes
 SHA1 (patch-aa) = 3bd4b688ccaeebe766335245c1a8c5dde52768c2
-SHA1 (patch-ab) = 87b2b93952de2e8b356ee4a8288062a35463b45a
+SHA1 (patch-ab) = 8199c055881cff22fdabca167a0c9d4ce764b247
diff -r c5b6c69299c1 -r 475d16703e87 sysutils/xbattbar/patches/patch-ab
--- a/sysutils/xbattbar/patches/patch-ab        Sat Nov 01 08:28:47 2003 +0000
+++ b/sysutils/xbattbar/patches/patch-ab        Sat Nov 01 09:25:31 2003 +0000
@@ -1,4 +1,4 @@
-$NetBSD: patch-ab,v 1.3 2003/11/01 04:03:18 mrg Exp $
+$NetBSD: patch-ab,v 1.4 2003/11/01 09:25:31 mycroft Exp $
 
 --- xbattbar.c.orig    2001-02-02 16:25:29.000000000 +1100
 +++ xbattbar.c 2003-11-01 14:55:10.000000000 +1100
@@ -16,7 +16,7 @@
  #include <signal.h>
  #include <stdio.h>
  #include <unistd.h>
-@@ -583,46 +590,161 @@
+@@ -583,46 +590,165 @@
  #define _PATH_APM_CTLDEV       "/dev/apmctl"
  #define _PATH_APM_NORMAL       "/dev/apm"
  
@@ -142,18 +142,22 @@
 -       }
 +       if (acpi) {
 +              int32_t rtot = 0, maxtot = 0;
-+              p = APM_AC_ON;
++              p = APM_AC_OFF;
 +              for (i = 0 ; i < ns ; i++) {
++                      if ((etds[i].validflags & ENVSYS_FCURVALID) == 0)
++                              continue;
 +                      cc = strlen(ebis[i].desc);
-+                      if (strcmp(&ebis[i].desc[cc - 6], "energy") == 0) {
++                      if (strncmp(ebis[i].desc, "acpibat", 7) == 0 &&
++                          (strcmp(&ebis[i].desc[cc - 7], " charge") == 0 ||
++                           strcmp(&ebis[i].desc[cc - 7], " energy") == 0)) {
 +                              rtot += etds[i].cur.data_s;
 +                              maxtot += etds[i].max.data_s;
 +                      }
 +                      if (ebis[i].units == ENVSYS_INDICATOR &&
 +                          etds[i].cur.data_s &&
 +                          strncmp(ebis[i].desc, "acpiacad", 8) == 0 &&
-+                          strcmp(&ebis[i].desc[cc - 12], "disconnected") == 0) {
-+                              p = APM_AC_OFF;
++                          strcmp(&ebis[i].desc[cc - 10], " connected") == 0) {
++                              p = APM_AC_ON;
 +                      }
 +              }
 +              r = (rtot * 100.0) / maxtot;



Home | Main Index | Thread Index | Old Index