[arch-commits] Commit in ibam/trunk (PKGBUILD ibam-0.5.2-debian-sysfs-lenovo.patch)
Sergej Pupykin
spupykin at archlinux.org
Mon Jul 27 09:32:33 UTC 2015
Date: Monday, July 27, 2015 @ 11:32:32
Author: spupykin
Revision: 137487
upgpkg: ibam 0.5.2-8
upd
Added:
ibam/trunk/ibam-0.5.2-debian-sysfs-lenovo.patch
Modified:
ibam/trunk/PKGBUILD
--------------------------------------+
PKGBUILD | 9 ++-
ibam-0.5.2-debian-sysfs-lenovo.patch | 76 +++++++++++++++++++++++++++++++++
2 files changed, 82 insertions(+), 3 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2015-07-27 09:29:41 UTC (rev 137486)
+++ PKGBUILD 2015-07-27 09:32:32 UTC (rev 137487)
@@ -5,7 +5,7 @@
pkgname=ibam
pkgver=0.5.2
-pkgrel=7
+pkgrel=8
pkgdesc="An intelligent battery monitor"
arch=('i686' 'x86_64')
url="http://ibam.sourceforge.net/"
@@ -16,10 +16,12 @@
install="ibam.install"
source=("http://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz"
03acpi-check.dpatch
- ibam-0.5.2-sysfs.patch)
+ ibam-0.5.2-sysfs.patch
+ ibam-0.5.2-debian-sysfs-lenovo.patch)
md5sums=('2d5222ff504dd19e7c1ea8acc2f13cf5'
'2f27fc97932bd59cabacbad063a13f0e'
- '2a50027f73276d91555105b713687a4d')
+ '2a50027f73276d91555105b713687a4d'
+ '49f0667537a221f9f1ab5b8a1f513adb')
prepare() {
cd "${srcdir}/${pkgname}-${pkgver}"
@@ -29,6 +31,7 @@
Makefile
patch -p1 <$srcdir/03acpi-check.dpatch
patch -p1 <$srcdir/ibam-0.5.2-sysfs.patch
+ patch -p1 <$srcdir/ibam-0.5.2-debian-sysfs-lenovo.patch
}
build() {
Added: ibam-0.5.2-debian-sysfs-lenovo.patch
===================================================================
--- ibam-0.5.2-debian-sysfs-lenovo.patch (rev 0)
+++ ibam-0.5.2-debian-sysfs-lenovo.patch 2015-07-27 09:32:32 UTC (rev 137487)
@@ -0,0 +1,76 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 05_sysfs_lenovo.dpatch by Martin Wuertele <maxx at debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: add lenovo sysfs detection
+
+ at 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)
+ {
More information about the arch-commits
mailing list