--- ibam-0.5.2.orig/debian/copyright +++ ibam-0.5.2/debian/copyright @@ -0,0 +1,22 @@ +This package was debianized by Martin Wuertele maxx@debian.org on +Sat, 13 Jul 2002 10:40:18 +0200. + +It was downloaded from http://ibam.sourceforge.net/ + +Upstream Authors: + Sebastian Ritterbusch + Florian Ragwitz + Brad Sawatzky + Peter Gaal + Misha Nasledov + +Copyright 2002 - 2009 Sebastian Ritterbusch + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. + --- ibam-0.5.2.orig/debian/changelog +++ ibam-0.5.2/debian/changelog @@ -0,0 +1,234 @@ +ibam (1:0.5.2-2.1) unstable; urgency=low + + * Non maintainer upload. + * Fix build failure with GCC 4.7. Closes: #667204. + + -- Matthias Klose Fri, 04 May 2012 08:23:56 +0200 + +ibam (1:0.5.2-2) unstable; urgency=low + + * added armhf to Architecture (closes: #604674) + * revert 03acpi-sysfs.dpatch sysfs changes (closes: #578586) + + -- Martin Wuertele Fri, 10 Dec 2010 11:00:39 +0100 + +ibam (1:0.5.2-1) unstable; urgency=low + + * New upstream release + * uses sysfs instead of /proc/acpi when available (closes: #495140) + * removed Florian from the uploaders list (closes: #523166) + + -- Martin Wuertele Thu, 17 Sep 2009 15:19:04 +0200 + +ibam (1:0.4-5.1) unstable; urgency=low + + * Non-maintainer upload. + * Remove libgdk-pixbuf-dev build dependency (Closes: #517322). + + -- Moritz Muehlenhoff Mon, 09 Mar 2009 20:50:24 +0100 + +ibam (1:0.4-5) unstable; urgency=low + + * removed sparc from supported archs (closes: #449122) + * added armel to supported archs (closes: #461090) + + -- Martin Wuertele Sun, 20 Jan 2008 14:48:06 +0100 + +ibam (1:0.4-4) unstable; urgency=low + + * added patch by Brad Sawatzky to make ibam + realise in some APM cases that the battery is charging (Closes: #409577) + * removed sparc from the arch list as I'm not aware of the power management + facilities in sparc laptops + * change derivation to deviation (Closes: #272033) + + -- Martin Wuertele Sun, 20 May 2007 09:55:52 +0200 + +ibam (1:0.4-3) unstable; urgency=low + + * reenable most archs (Closes: #408895) since ACPI exists on sparc, arm, + mips as well + + -- Martin Wuertele Wed, 14 Mar 2007 19:48:54 +0100 + +ibam (1:0.4-2) unstable; urgency=low + + * restrict archs to amd64 i386 powerpc + + -- Martin Wuertele Fri, 26 Jan 2007 19:30:57 +0100 + +ibam (1:0.4-1) unstable; urgency=low + + * new upstream release + + -- Martin Wuertele Sun, 17 Dec 2006 10:37:21 +0100 + +ibam (1:0.3-8) unstable; urgency=low + + * added swedish debconf template (closes: #333593) + + -- Martin Wuertele Sun, 26 Nov 2006 13:36:58 +0100 + +ibam (1:0.3-7) unstable; urgency=low + + * updated CFLAGS to prevent FTBFS on m68k + (Closes: #321953) + + -- Martin Wuertele Fri, 30 Sep 2005 19:06:36 +0200 + +ibam (1:0.3-6) unstable; urgency=low + + * updated dependencies to allow cdebconf transition + + -- Martin Wuertele Fri, 30 Sep 2005 18:53:39 +0200 + +ibam (1:0.3-5) unstable; urgency=low + + * fixed typos found by Clytie Siddall + (Closes: #314218) + * added Vietnamese translation, patch by Clytie Siddall + + (Closes: #314217) + * added Czech translation, patch by Martin ¦ín + (Closes: #315210) + * updated manpage + (Closes: #289497) + * added Florian Ragwitz as Co-Maintainer + + -- Martin Wuertele Fri, 5 Aug 2005 13:13:31 +0200 + +ibam (1:0.3-4) unstable; urgency=low + + * added Japanese debconf templates, patch by Hideki Yamane + + (Closes: #260920) + + -- Martin Wuertele Sun, 1 Aug 2004 21:39:57 +0200 + +ibam (1:0.3-3) unstable; urgency=low + + * added German debconf templates, patch by Erik Schanze + + (Closes: #253725) + + -- Martin Wuertele Fri, 11 Jun 2004 17:57:54 +0200 + +ibam (1:0.3-2) unstable; urgency=low + + * added French debconf templates, patch by Rémi Pannequin + + (Closes: #248579) + + -- Martin Wuertele Thu, 13 May 2004 17:47:31 +0200 + +ibam (1:0.3-1) unstable; urgency=low + + * new upstream release + * switched to gettext-based debconf templates, patch by + Martin Quinson + (Closes: #239869) + + -- Martin Wuertele Sat, 1 May 2004 21:07:10 +0200 + +ibam (0.3rc2-4) unstable; urgency=low + + * fixed minor issue in copyright + + -- Martin Wuertele Tue, 16 Dec 2003 20:59:07 +0100 + +ibam (0.3rc2-3) unstable; urgency=low + + * removed libg++2.8.1.3-dev from build-depends since it is no more needed + with gcc 3.2 (Closes: #185484) + + -- Martin Wuertele Wed, 19 Mar 2003 19:53:19 +0100 + +ibam (0.3rc2-2) unstable; urgency=low + + * changed plugin path to /usr/lib/gkrellm2/plugins/ + (Closes: #177558) + + -- Martin Wuertele Mon, 20 Jan 2003 19:57:01 +0100 + +ibam (0.3rc2-1) unstable; urgency=low + + * new upstream release + * fixed namespace for gcc 3.2 + + -- Martin Wuertele Tue, 14 Jan 2003 20:44:45 +0100 + +ibam (0.2-9) unstable; urgency=low + + * placed ibam package in correct section + + -- Martin Wuertele Thu, 21 Nov 2002 13:46:41 +0100 + +ibam (0.2-8) unstable; urgency=low + + * fixed a type in the template file + + -- Martin Wuertele Tue, 24 Sep 2002 10:32:18 +0200 + +ibam (0.2-7) unstable; urgency=low + + * extended --help description for --plot + * improved install scripts to provide optional apm module loading, useing + debconf (Closes: #159965, Closes: #161816) + + -- Martin WÃŒrtele Mon, 23 Sep 2002 16:47:52 +0200 + +ibam (0.2-6) unstable; urgency=low + + * added support for DEB_BUILD_OPTIONS + (Closes: #159856) + + -- Martin WÃŒrtele Fri, 6 Sep 2002 17:16:14 +0200 + +ibam (0.2-5) unstable; urgency=low + + * fixed permissions for preinst (was not executable) + * updated description to state that IBAM requires /proc/apm + (Closes: #159008) + * changed build-depends from gdk-imlib-dev to gdk-imlib1-dev + + -- Martin WÃŒrtele Fri, 6 Sep 2002 13:03:33 +0200 + +ibam (0.2-4) unstable; urgency=low + + * updated man page (thx to Robert Bihlmeyer for + helping) + * removed gkrellm-ibam depenency on apmd (forgot that one so finall + #153256 is really closed thx to Michel DÀnzer ) + * added suggestion for gnuplot + (Closes: #153964) + * ibam-gkrellm: fixed namespace for g+ 3.0 + (Closes: #154076) + + -- Martin WÃŒrtele Wed, 24 Jul 2002 09:16:33 +0200 + +ibam (0.2-3) unstable; urgency=low + + * removed /usr/share/gkrellm/plugins/ibam-krell.so symlink + (Closes: #153423) + * added check for /proc/apm and removed dependency on powermgmt-base + + -- Martin WÃŒrtele Thu, 18 Jul 2002 14:41:01 +0200 + +ibam (0.2-2) unstable; urgency=low + + * added std namespace for g++ 3.0 + (Closes: #153207) + * removed dependency against apmd in favour of powermgmt-base + (Closes: #153256) + * changed plugin position from MON_MAIL to MON_APM + (Closes: #153274) + + -- Martin WÃŒrtele Wed, 17 Jul 2002 15:41:02 +0200 + +ibam (0.2-1) unstable; urgency=low + + * Initial release. + (Closes: #152852) + + -- Martin WÃŒrtele Sat, 13 Jul 2002 10:40:18 +0200 + --- ibam-0.5.2.orig/debian/compat +++ ibam-0.5.2/debian/compat @@ -0,0 +1 @@ +7 --- ibam-0.5.2.orig/debian/ibam.dirs +++ ibam-0.5.2/debian/ibam.dirs @@ -0,0 +1 @@ +usr/bin --- ibam-0.5.2.orig/debian/control +++ ibam-0.5.2/debian/control @@ -0,0 +1,30 @@ +Source: ibam +Section: utils +Priority: optional +Build-Depends: debhelper (>= 7.0.50), gkrellm (>= 2.1.4), libgtk2.0-dev, dpatch +Maintainer: Martin Wuertele +Standards-Version: 3.9.1 +Homepage: http://ibam.sourceforge.net/ + +Package: ibam +Architecture: amd64 i386 powerpc arm mips mipsel armel armhf +Section: utils +Depends: ${shlibs:Depends}, ${misc:Depends}, debconf (>= 1.2.0) | debconf-2.0 +Suggests: gnuplot +Description: Advanced battery monitor for laptops + IBAM is an advanced battery monitor for laptops, which uses statistical and + adaptive linear methods to provide accurate estimations of minutes of + battery left or of the time needed until full recharge. It requires APM, ACPI + or PMU. + +Package: gkrellm-ibam +Architecture: amd64 i386 powerpc arm mips mipsel armel +Section: x11 +Depends: ${shlibs:Depends}, ${misc:Depends}, gkrellm (>= 2.1.4), ibam (>> 0.3rc2) +Description: Advanced battery monitor for laptops - gkrellm plugin + This is the ibam plugin for gkrellm. + . + IBAM is an advanced battery monitor for laptops, which uses statistical and + adaptive linear methods to provide accurate estimations of minutes of + battery left or of the time needed until full recharge. It requires APM, ACPI + or PMU. --- ibam-0.5.2.orig/debian/gkrellm-ibam.dirs +++ ibam-0.5.2/debian/gkrellm-ibam.dirs @@ -0,0 +1 @@ +usr/lib/gkrellm2/plugins --- ibam-0.5.2.orig/debian/README.source +++ ibam-0.5.2/debian/README.source @@ -0,0 +1,2 @@ +This packages uses dpatch to manage differences between the upsteram and the +Debian version. --- ibam-0.5.2.orig/debian/rules +++ ibam-0.5.2/debian/rules @@ -0,0 +1,97 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 +#export DH_NO_ACT=1 + +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +CFLAGS = -Wall +ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) + CFLAGS += -g +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +# call dpatch +include /usr/share/dpatch/dpatch.make + +build: build-stamp +build-stamp: patch + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + $(MAKE) ibam-krell.so + + touch build-stamp + +clean: clean1 unpatch + +clean1: + dh_testdir + dh_testroot + rm -f build-stamp + + # Add here commands to clean up after the build process. + $(MAKE) clean + #-$(MAKE) distclean + + dh_clean + +install: +install: build + dh_testdir + dh_testroot + dh_clean + dh_installdirs + + # Add here commands to install the package into debian/tmp. + install -m0755 ibam `pwd`/debian/ibam/usr/bin + install -m0644 ibam-krell.so `pwd`/debian/gkrellm-ibam/usr/lib/gkrellm2/plugins + #install -c -s -m 755 ibam-krell.so `pwd`/debian/gkrellm-ibam/usr/lib/gkrellm/plugins + + dh_install + +# Build architecture-independent files here. +binary-indep: build install + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir -a + dh_testroot -a + dh_installchangelogs CHANGES + dh_installdocs README +# dh_installexamples -a +# dh_installmenu -a + dh_installdebconf -a +# dh_installlogrotate -a +# dh_installemacsen -a +# dh_installpam -a +# dh_installmime -a +# dh_installinit -a +# dh_installcron -a +# dh_installinfo -a +# dh_undocumented + dh_installman `pwd`/debian/ibam.1 + dh_strip -a + dh_link + dh_compress -a + dh_fixperms -a +# dh_makeshlibs -a + dh_installdeb -a +# dh_perl -a + dh_shlibdeps -a + dh_gencontrol -a + dh_md5sums -a + dh_builddeb -a + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- ibam-0.5.2.orig/debian/ibam.1 +++ ibam-0.5.2/debian/ibam.1 @@ -0,0 +1,91 @@ +.TH "IBAM" "1" "2" "" "" +.SH "NAME" +IBAM \- the Intelligent Battery Monitor +.SH "SYNOPSIS" +.B ibam +[\fIoptions\fR] +.SH "DESCRIPTION" +IBAM\-0.3, the Intelligent Battery Monitor +.br +(C) 2001\-2004 Sebastian Ritterbusch +.SH "OPTIONS" +.TP +\fB\-h\fR, \fB\-\-help\fR +displays help message +.TP +\fB\-v\fR, \fB\-\-version\fR +displays software version +.TP +\fB\-b\fR, \fB\-\-bios\fR +show bios apm guesses +.TP +\fB\-s\fR, \fB\-\-seconds\fR +displays times in seconds +.TP +\fB\-c\fR, \fB\-\-correctseconds\fR +displays changes in seconds +.TP +\fB\-r\fR, \fB\-\-readonly\fR +no files will be updated +.TP +\fB\-a\fR, \fB\-\-all\fR +show ALL information +.TP +\fB\-\-battery\fR +show battery time +.TP +\fB\-\-batteryadaptive\fR +show adaptive battery time +.TP +\fB\-\-batterybios\fR +show bios battery time guess +.TP +\fB\-\-percentbattery\fR +show battery percentage +.TP +\fB\-\-percentbios\fR +show bios percentage +.TP +\fB\-\-charge\fR +show charge time +.TP +\fB\-\-chargeadaptive\fR +show adaptive charge time +.TP +\fB\-\-percentcharge\fR +show charge percentage +.TP +\fB\-\-totalbattery\fR +show total battery time +.HP +\fB\-\-totalbatteryadaptive\fR show adaptive total battery +.TP +\fB\-\-totalcharge\fR +show total charge time +.TP +\fB\-\-totalchargeadaptive\fR +show adaptive total charge +.TP +\fB\-\-plot[=profiles]\fR +use gnuplot to plot battery and charge graphs +and plot the last additional profiles +.TP +\fB\-\-plotderivations\fR +same as above plus standard deviations +.TP +\fB\-\-plotdeviations\fR +same as above plus standard deviations +.TP +\fB\-\-import\fR +import V0.1 data from current directory +.TP +\fB\-\-profile\fR +enable additional yet unused profiling +.TP +\fB\-\-noprofile\fR +disable additional profiling +.TP +\fB\-\-credits\fR +to everyone contributing to ibam +.SH "AUTHOR" +This manual page was written by Martin Wuertele for the Debian GNU/Linux system (but may be used by others). --- ibam-0.5.2.orig/debian/patches/03acpi-check.dpatch +++ ibam-0.5.2/debian/patches/03acpi-check.dpatch @@ -0,0 +1,28 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 03acpi-check.dpatch by Martin Wuertele +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: change detection for sysfs and sysfs variable names for 2.6.30+ kernels + +@DPATCH@ +--- ibam-0.5.2/ibam.inl.orig 2010-01-03 12:17:10.000000000 +0100 ++++ ibam-0.5.2/ibam.inl 2010-01-03 12:17:19.000000000 +0100 +@@ -945,7 +945,7 @@ + string sysfs_path = "/sys/class/power_supply"; // ... + ifstream pmu,acpi,sysfs; + pmu.open((pmu_path+"/info").c_str()); +- acpi.open((acpi_path+"/info").c_str()); ++ acpi.open((acpi_path+"/event").c_str()); + if (pmu.is_open()) { + #ifdef IBAM_DEBUG + cout << "using pmu" << endl; +@@ -959,7 +959,7 @@ + acpi.close(); + apm = new acpi_status(); + } else { +- sysfs.open((sysfs_path+"/BAT1/charge_full").c_str()); ++ sysfs.open((sysfs_path+"/BAT0/present").c_str()); + if(sysfs.is_open()) { + #ifdef IBAM_DEBUG + cout << "using sysfs" << endl; + --- ibam-0.5.2.orig/debian/patches/05_sysfs_lenovo.dpatch +++ ibam-0.5.2/debian/patches/05_sysfs_lenovo.dpatch @@ -0,0 +1,76 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 05_sysfs_lenovo.dpatch by Martin Wuertele +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: add lenovo sysfs detection + +@DPATCH@ + +--- ibam-0.5.2/ibam.inl.orig 2011-02-15 21:42:39.000000000 +0100 ++++ ibam-0.5.2/ibam.inl 2011-02-15 21:41:08.000000000 +0100 +@@ -540,6 +540,7 @@ + + if(present) + { ++ // try charge_full + in.open((((Path)+battery_entry->d_name)+"/charge_full").c_str()); + if(!in.fail()) + { +@@ -547,10 +548,19 @@ + total_capacity+=capacity; + } + in.close(); ++ // try energy_full ++ in.open((((Path)+battery_entry->d_name)+"/energy_full").c_str()); ++ if(!in.fail()) ++ { ++ in>>capacity; ++ total_capacity+=capacity; ++ } ++ in.close(); + } + + if(present && capacity) + { ++ // try charge_now + in.open((((Path)+battery_entry->d_name)+"/charge_now").c_str()); + if(!in.fail()) + { +@@ -558,10 +568,19 @@ + total_remain+=remain; + } + in.close(); +- } ++ // try energy_now ++ in.open((((Path)+battery_entry->d_name)+"/energy_now").c_str()); ++ if(!in.fail()) ++ { ++ in>>remain; ++ total_remain+=remain; ++ } ++ in.close(); ++ } + + if(present && capacity) + { ++ // try current_now + in.open((((Path)+battery_entry->d_name)+"/current_now").c_str()); + if(!in.fail()) + { +@@ -569,7 +588,15 @@ + total_rate+=rate; + } + in.close(); +- } ++ // try energy_now ++ in.open((((Path)+battery_entry->d_name)+"/energy_now").c_str()); ++ if(!in.fail()) ++ { ++ in>>rate; ++ total_rate+=rate; ++ } ++ in.close(); ++ } + + if(present && capacity) + { --- ibam-0.5.2.orig/debian/patches/02deviation.dpatch +++ ibam-0.5.2/debian/patches/02deviation.dpatch @@ -0,0 +1,27 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 02deviation.dpatch by Martin Wuertele +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: change derivation to deviation + +@DPATCH@ +--- ibam-0.4.orig/ibam.cpp 2007-05-20 09:54:48.000000000 +0200 ++++ ibam-0.4/ibam.cpp 2007-05-20 09:52:47.000000000 +0200 +@@ -91,6 +91,7 @@ + {"totalchargeadaptive",0,0,11}, + {"plot",optional_argument,0,12}, + {"plotderivations",optional_argument,0,13}, ++ {"plotdeviations",optional_argument,0,13}, + {"import",0,0,14}, + {"correctseconds",0,0,'c'}, + {"seconds",0,0,'s'}, +@@ -254,7 +255,8 @@ + cout << " --totalchargeadaptive show adaptive total charge" << endl; + cout << " --plot[=profiles] use gnuplot to plot battery and charge graphs" << endl; + cout << " and plot the last additional profiles" << endl; +- cout << " --plotderivations[=profiles] same as above plus standard derivations" << endl; ++ cout << " --plotderivations[=profiles] same as above plus standard deviations" << endl; ++ cout << " --plotdeviations[=profiles] same as above plus standard deviations" << endl; + cout << " --import import V0.1 data from current directory" << endl; + cout << " --profile enable additional yet unused profiling" << endl; + cout << " --noprofile disable additional profiling" << endl; --- ibam-0.5.2.orig/debian/patches/06_ftbfs_gcc_47.dpatch +++ ibam-0.5.2/debian/patches/06_ftbfs_gcc_47.dpatch @@ -0,0 +1,24 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run + +@DPATCH@ + +--- ./Makefile~ ++++ ./Makefile +@@ -35,7 +35,7 @@ + krell: ibam-krell.so + + ibam-krell.so: ibam-krell.o +- $(CC) $(CFLAGS) -fPIC -shared -Wl -o ibam-krell.so ibam-krell.o ++ $(CC) $(CFLAGS) -fPIC -shared -o ibam-krell.so ibam-krell.o + + ibam-krell.o: ibam-krell.cpp ibam.hpp ibam.inl + $(CC) $(CFLAGS) -fPIC `pkg-config gtk+-2.0 --cflags` `gdk-pixbuf-config --cflags` -c ibam-krell.cpp +@@ -43,7 +43,7 @@ + krell1: ibam-krell1.so + + ibam-krell1.so: ibam-krell1.o +- $(CC) $(CFLAGS) -shared -Wl -o ibam-krell1.so ibam-krell1.o ++ $(CC) $(CFLAGS) -shared -o ibam-krell1.so ibam-krell1.o + + ibam-krell1.o: ibam-krell1.cpp ibam.hpp ibam.inl + $(CC) $(CFLAGS) -fPIC `gtk-config --cflags` `imlib-config --cflags-gdk` -c ibam-krell1.cpp --- ibam-0.5.2.orig/debian/patches/00list +++ ibam-0.5.2/debian/patches/00list @@ -0,0 +1,4 @@ +02deviation.dpatch +03acpi-check.dpatch +05_sysfs_lenovo.dpatch +06_ftbfs_gcc_47.dpatch --- ibam-0.5.2.orig/debian/patches/04sysfs.dpatch +++ ibam-0.5.2/debian/patches/04sysfs.dpatch @@ -0,0 +1,76 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 04sysfs.dpatch by Martin Wuertele +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: consider energy_* and current_* in sysfs + +@DPATCH@ + +--- ibam-0.5.2/ibam.inl 2010-12-10 11:34:38.584151204 +0100 ++++ ibam-0.5.2/ibam.inl.orig 2010-12-10 11:29:43.151172174 +0100 +@@ -540,7 +540,6 @@ + + if(present) + { +- // try charge_full + in.open((((Path)+battery_entry->d_name)+"/charge_full").c_str()); + if(!in.fail()) + { +@@ -548,19 +547,10 @@ + total_capacity+=capacity; + } + in.close(); +- // try energy_full +- in.open((((Path)+battery_entry->d_name)+"/energy_full").c_str()); +- if(!in.fail()) +- { +- in>>capacity; +- total_capacity+=capacity; +- } +- in.close(); + } + + if(present && capacity) + { +- // try charge_now + in.open((((Path)+battery_entry->d_name)+"/charge_now").c_str()); + if(!in.fail()) + { +@@ -568,19 +558,10 @@ + total_remain+=remain; + } + in.close(); +- // try energy_now +- in.open((((Path)+battery_entry->d_name)+"/energy_now").c_str()); +- if(!in.fail()) +- { +- in>>remain; +- total_remain+=remain; +- } +- in.close(); +- } ++ } + + if(present && capacity) + { +- // try current_now + in.open((((Path)+battery_entry->d_name)+"/current_now").c_str()); + if(!in.fail()) + { +@@ -588,15 +569,7 @@ + total_rate+=rate; + } + in.close(); +- // try energy_now +- in.open((((Path)+battery_entry->d_name)+"/energy_now").c_str()); +- if(!in.fail()) +- { +- in>>rate; +- total_rate+=rate; +- } +- in.close(); +- } ++ } + + if(present && capacity) + {