diff -Nru upower-0.9.9/debian/changelog upower-0.9.9/debian/changelog --- upower-0.9.9/debian/changelog 2011-06-25 22:12:22.000000000 +0100 +++ upower-0.9.9/debian/changelog 2011-04-12 12:10:36.000000000 +0100 @@ -1,17 +1,8 @@ -upower (0.9.9-4eyre1) natty; urgency=low - - * Specific issue bugfix - - Fix battery discharge estimate for hardware that does not report - battery current - - -- Andy Eyre Sat, 25 Jun 2011 20:21:53 +0100 - upower (0.9.9-4) unstable; urgency=low - [ Michael Biebl ] * debian/control: Make pm-utils dependency [linux-any]. - -- Michael Biebl Sun, 10 Apr 2011 20:29:56 +0200 + -- Michael Biebl Tue, 12 Apr 2011 13:10:19 +0200 upower (0.9.9-3) unstable; urgency=low diff -Nru upower-0.9.9/debian/patches/998_meterfix_eyre.patch upower-0.9.9/debian/patches/998_meterfix_eyre.patch --- upower-0.9.9/debian/patches/998_meterfix_eyre.patch 2011-06-25 22:12:22.000000000 +0100 +++ upower-0.9.9/debian/patches/998_meterfix_eyre.patch 1970-01-01 01:00:00.000000000 +0100 @@ -1,111 +0,0 @@ ---- ../upower-orig/src/linux/up-device-supply.c 2010-07-02 14:04:42.000000000 +0100 -+++ upower-0.9.5/src/linux/up-device-supply.c 2010-10-31 16:48:12.870619040 +0000 -@@ -25,6 +25,8 @@ - - #include - #include -+//eyreremove -+//eyreremove#include - - #include - #include -@@ -54,6 +56,7 @@ - gboolean coldplug_units; - gdouble energy_old; - GTimeVal energy_old_timespec; -+ gdouble old_rate; - guint unknown_retries; - gboolean enable_poll; - }; -@@ -214,43 +217,46 @@ - } - - /** -- * up_device_supply_calculate_rate: -+ * up_device_supply_calculate_rate: eyre - **/ --static void --up_device_supply_calculate_rate (UpDeviceSupply *supply) -+static gdouble -+up_device_supply_calculate_rate (gdouble energy,UpDeviceSupply *supply) - { - guint time_s; -- gdouble energy; - gdouble energy_rate; - GTimeVal now; - UpDevice *device = UP_DEVICE (supply); - -- g_object_get (device, "energy", &energy, NULL); -- - if (energy < 0.1f) -- return; -+ return 0.f; - - if (supply->priv->energy_old < 0.1f) -- return; -+ return 0.f; - - if (supply->priv->energy_old == energy) -- return; -+ return supply->priv->old_rate; -+ -+ //eyreremove printf("en: %f, %f\n",energy,supply->priv->energy_old); - - /* get the time difference */ - g_get_current_time (&now); - time_s = now.tv_sec - supply->priv->energy_old_timespec.tv_sec; -+ //eyreremove printf("dt: %u\n",time_s); - - if (time_s == 0) -- return; -+ return supply->priv->old_rate; -+ //eyreremove printf("through"); - - /* get the difference in charge */ -- energy = supply->priv->energy_old - energy; -- if (energy < 0.1f) -- return; -+ energy = fabs(supply->priv->energy_old - energy); -+ //eyreremove printf("de: %f\n",energy); - - /* probably okay */ - energy_rate = energy * 3600 / time_s; -- g_object_set (device, "energy-rate", energy_rate, NULL); -+ //eyreremove printf("prerate: %f",energy_rate); -+ //eyreremove printf("rate: %f %f \n",energy_rate,supply->priv->old_rate); -+ //eyreremove fflush(stdout); -+ return energy_rate; - } - - /** -@@ -590,9 +596,11 @@ - if (energy_rate > 100*1000) - energy_rate = 0; - -- /* the hardware reporting failed -- try to calculate this */ -- if (energy_rate < 0) -- up_device_supply_calculate_rate (supply); -+ /* the hardware reporting failed -- try to calculate this - eyre */ -+ if (energy_rate <= 0) -+ energy_rate=up_device_supply_calculate_rate (energy,supply); -+ //eyreremove printf("main rate: %f\n",energy_rate); -+ //eyreremove fflush(stdout); - - /* get a precise percentage */ - if (energy_full > 0.0f) { -@@ -680,9 +688,12 @@ - if (time_to_full > (20 * 60 * 60)) - time_to_full = 0; - -- /* set the old status */ -- supply->priv->energy_old = energy; -- g_get_current_time (&supply->priv->energy_old_timespec); -+ /* eyre - set the old status if it hasn't changed */ -+ if (supply->priv->energy_old != energy) { -+ supply->priv->energy_old = energy; -+ g_get_current_time (&supply->priv->energy_old_timespec); -+ supply->priv->old_rate = energy_rate; -+ } - - /* we changed state */ - g_object_get (device, "state", &old_state, NULL); diff -Nru upower-0.9.9/debian/patches/series upower-0.9.9/debian/patches/series --- upower-0.9.9/debian/patches/series 2011-06-25 22:12:22.000000000 +0100 +++ upower-0.9.9/debian/patches/series 2011-04-12 12:10:36.000000000 +0100 @@ -1,2 +1 @@ # Debian patches for upower -998_meterfix_eyre.patch