Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37373826
en ru br
ALT Linux repos
S:0.5.2-alt4
5.0: 0.5.1-alt1
4.1: 0.4-alt4
4.0: 0.4-alt2

Group :: Monitoring
RPM: ibam

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: ibam-0.5.2-debian-sysfs-lenovo.patch
Download


#! /bin/sh /usr/share/dpatch/dpatch-run
## 05_sysfs_lenovo.dpatch by Martin Wuertele <maxx@debian.org>
##
## 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)
          {
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin