[arch-commits] Commit in devicekit-power/repos (6 files)

Jan de Groot jgc at archlinux.org
Sat Dec 19 20:29:08 UTC 2009


    Date: Saturday, December 19, 2009 @ 15:29:07
  Author: jgc
Revision: 61581

Merged revisions 56821,61560,61579 via svnmerge from 
svn+ssh://gerolde.archlinux.org/srv/svn-packages/devicekit-power/trunk

........
  r56821 | jgc | 2009-10-28 09:14:20 +0100 (Wed, 28 Oct 2009) | 1 line
  
  Set keyword
........
  r61560 | jgc | 2009-12-19 20:28:56 +0100 (Sat, 19 Dec 2009) | 2 lines
  
  upgpkg: devicekit-power 013-1
      Update to 013 - add some upstream patches, remove some old ones applied in 013 already
........
  r61579 | jgc | 2009-12-19 21:26:56 +0100 (Sat, 19 Dec 2009) | 1 line
  
  Add missing patches
........

Added:
  devicekit-power/repos/extra-x86_64/check-swap.patch
    (from rev 61579, devicekit-power/trunk/check-swap.patch)
  devicekit-power/repos/extra-x86_64/fix-segfault-history.patch
    (from rev 61579, devicekit-power/trunk/fix-segfault-history.patch)
Modified:
  devicekit-power/repos/extra-x86_64/	(properties)
  devicekit-power/repos/extra-x86_64/PKGBUILD	(contents, properties)
Deleted:
  devicekit-power/repos/extra-x86_64/fix-hibernate.patch
  devicekit-power/repos/extra-x86_64/fix-recall.patch

----------------------------+
 PKGBUILD                   |   22 +++++++++++-----------
 check-swap.patch           |   43 +++++++++++++++++++++++++++++++++++++++++++
 fix-hibernate.patch        |   21 ---------------------
 fix-recall.patch           |   26 --------------------------
 fix-segfault-history.patch |   25 +++++++++++++++++++++++++
 5 files changed, 79 insertions(+), 58 deletions(-)


Property changes on: devicekit-power/repos/extra-x86_64
___________________________________________________________________
Modified: svnmerge-integrated
   - /devicekit-power/trunk:1-56289
   + /devicekit-power/trunk:1-61580

Modified: extra-x86_64/PKGBUILD
===================================================================
--- extra-x86_64/PKGBUILD	2009-12-19 20:27:17 UTC (rev 61580)
+++ extra-x86_64/PKGBUILD	2009-12-19 20:29:07 UTC (rev 61581)
@@ -1,11 +1,11 @@
-# $Id: $
+# $Id$
 # Maintainer: Jan de Groot <jgc at archlinux.org>
 # Contributor: Denis Zawada <deno at rootnode.net>
 
 pkgname=devicekit-power
-pkgver=012
-pkgrel=2
-pkgdesc="DeviceKit-power is an abstraction for enumerating power devices, listening to device events and querying history and statistics"
+pkgver=013
+pkgrel=1
+pkgdesc="Abstraction for enumerating power devices, listening to device events and querying history and statistics"
 arch=('i686' 'x86_64')
 url="http://www.freedesktop.org/wiki/Software/DeviceKit"
 license=('GPL')
@@ -14,16 +14,16 @@
 replaces=('devicekit')
 options=('!emptydirs' '!libtool')
 source=(http://hal.freedesktop.org/releases/DeviceKit-power-${pkgver}.tar.gz
-        fix-hibernate.patch
-        fix-recall.patch)
-md5sums=('34b8d698658cce77050443125fa9fab4'
-         'a519e25412404d472e1d48f23dccebed'
-         '4b43f53622f71ebe922bf3db3c881515')
+        fix-segfault-history.patch
+        check-swap.patch)
+md5sums=('4fd56be8344556f55f86d476adbc9ab5'
+         'e6126f620264ab4f690bf3173515db2b'
+         '873222f0c6a1284d0cea3dda72a6d020')
 
 build() {
   cd "${srcdir}/DeviceKit-power-${pkgver}"
-  patch -Np1 -i "${srcdir}/fix-hibernate.patch" || return 1
-  patch -Np1 -i "${srcdir}/fix-recall.patch" || return 1
+  patch -Np1 -i "${srcdir}/fix-segfault-history.patch" || return 1
+  patch -Np1 -i "${srcdir}/check-swap.patch" || return 1
   ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
       --libexecdir=/usr/lib/DeviceKit --disable-static || return 1
   make || return 1


Property changes on: devicekit-power/repos/extra-x86_64/PKGBUILD
___________________________________________________________________
Added: svn:keywords
   + Id

Copied: devicekit-power/repos/extra-x86_64/check-swap.patch (from rev 61579, devicekit-power/trunk/check-swap.patch)
===================================================================
--- extra-x86_64/check-swap.patch	                        (rev 0)
+++ extra-x86_64/check-swap.patch	2009-12-19 20:29:07 UTC (rev 61581)
@@ -0,0 +1,43 @@
+From bbb102c394eff71d84801b48b11e022b1fecb497 Mon Sep 17 00:00:00 2001
+From: Debbie Beliveau <debbie.beliveau at gmail.com>
+Date: Wed, 16 Dec 2009 16:29:29 +0000
+Subject: Check if swap exists before determining how much is free
+
+Signed-off-by: Richard Hughes <richard at hughsie.com>
+---
+diff --git a/src/dkp-daemon.c b/src/dkp-daemon.c
+index eb16a63..47d84d5 100644
+--- a/src/dkp-daemon.c
++++ b/src/dkp-daemon.c
+@@ -250,6 +250,7 @@ dkp_daemon_check_swap_space (DkpDaemon *daemon)
+ 	gboolean ret;
+ 	guint active = 0;
+ 	guint swap_free = 0;
++	guint swap_total = 0;
+ 	guint len;
+ 	guint i;
+ 	gfloat percentage = 0.0f;
+@@ -271,12 +272,21 @@ dkp_daemon_check_swap_space (DkpDaemon *daemon)
+ 		if (len > 3) {
+ 			if (g_strcmp0 (tokens[0], "SwapFree") == 0)
+ 				swap_free = atoi (tokens[len-2]);
++			if (g_strcmp0 (tokens[0], "SwapTotal") == 0)
++				swap_total = atoi (tokens[len-2]);
+ 			else if (g_strcmp0 (tokens[0], "Active") == 0)
+ 				active = atoi (tokens[len-2]);
+ 		}
+ 		g_strfreev (tokens);
+ 	}
+ 
++	/* first check if we even have swap, if not consider all swap space used */
++	if (swap_total == 0) {
++		egg_debug ("no swap space found");
++		percentage = 100.0f;
++		goto out;
++	}
++
+ 	/* work out how close to the line we are */
+ 	if (swap_free > 0 && active > 0)
+ 		percentage = (active * 100) / swap_free;
+--
+cgit v0.8.3-6-g21f6

Deleted: extra-x86_64/fix-hibernate.patch
===================================================================
--- extra-x86_64/fix-hibernate.patch	2009-12-19 20:27:17 UTC (rev 61580)
+++ extra-x86_64/fix-hibernate.patch	2009-12-19 20:29:07 UTC (rev 61581)
@@ -1,21 +0,0 @@
-From 390c5b3aeb3d07ff6de3594fd08370e43b43c652 Mon Sep 17 00:00:00 2001
-From: Richard Hughes <richard at hughsie.com>
-Date: Wed, 21 Oct 2009 08:26:48 +0000
-Subject: Fix a trivial copy-paste error that broke hibernate for a lot of people
-
----
-diff --git a/src/dkp-daemon.c b/src/dkp-daemon.c
-index 20e65f8..eb16a63 100644
---- a/src/dkp-daemon.c
-+++ b/src/dkp-daemon.c
-@@ -563,7 +563,7 @@ dkp_daemon_hibernate (DkpDaemon *daemon, DBusGMethodInvocation *context)
- 	}
- 
- 	/* encrypted swap? */
--	if (!daemon->priv->hibernate_has_encrypted_swap) {
-+	if (daemon->priv->hibernate_has_encrypted_swap) {
- 		error = g_error_new (DKP_DAEMON_ERROR,
- 				     DKP_DAEMON_ERROR_GENERAL,
- 				     "Swap space is encrypted");
---
-cgit v0.8.2

Deleted: extra-x86_64/fix-recall.patch
===================================================================
--- extra-x86_64/fix-recall.patch	2009-12-19 20:27:17 UTC (rev 61580)
+++ extra-x86_64/fix-recall.patch	2009-12-19 20:29:07 UTC (rev 61581)
@@ -1,26 +0,0 @@
-From 54f37398c06fa2573aa6e734dd65ea87751ec3b1 Mon Sep 17 00:00:00 2001
-From: Martin Pitt <martin.pitt at ubuntu.com>
-Date: Wed, 14 Oct 2009 11:20:58 +0000
-Subject: Bug 24262 – incorrect battery recall warning for Lenovo T61
-
-According to
-http://www-307.ibm.com/pc/support/site.wss/document.do?sitestyle=lenovo&lndocid=BATT-LENOVO
-
-the Sony batteris are only recalled on some particular models.
----
-diff --git a/rules/95-devkit-power-battery-recall-ibm.rules b/rules/95-devkit-power-battery-recall-ibm.rules
-index ecff4fb..ad3800a 100644
---- a/rules/95-devkit-power-battery-recall-ibm.rules
-+++ b/rules/95-devkit-power-battery-recall-ibm.rules
-@@ -16,6 +16,9 @@ ATTR{type}!="Battery", GOTO="dkp_battery_recall_ibm_end"
- # only match correct manufacturer
- ATTR{manufacturer}!="SONY", GOTO="dkp_battery_recall_ibm_end"
- 
-+# only recalled on some particular models
-+ATTR{[dmi/id]product_version}!="*R60*|*T60*|*Z60m*|*Z61e*|*Z61m*|*Z61p*", GOTO="dkp_battery_recall_ibm_end"
-+
- ATTR{model_name}=="92P1072", ENV{DKP_RECALL_NOTICE}="1"
- ATTR{model_name}=="92P1073", ENV{DKP_RECALL_NOTICE}="1"
- ATTR{model_name}=="92P1088", ENV{DKP_RECALL_NOTICE}="1"
---
-cgit v0.8.2

Copied: devicekit-power/repos/extra-x86_64/fix-segfault-history.patch (from rev 61579, devicekit-power/trunk/fix-segfault-history.patch)
===================================================================
--- extra-x86_64/fix-segfault-history.patch	                        (rev 0)
+++ extra-x86_64/fix-segfault-history.patch	2009-12-19 20:29:07 UTC (rev 61581)
@@ -0,0 +1,25 @@
+From 0348f788d9dc1ac35ff07d2a15acc9da109ca60c Mon Sep 17 00:00:00 2001
+From: Richard Hughes <richard at hughsie.com>
+Date: Mon, 14 Dec 2009 12:35:14 +0000
+Subject: Fix segfault in the history code. Fixes fd#25632
+
+---
+diff --git a/src/dkp-history.c b/src/dkp-history.c
+index 23bf4c2..b851642 100644
+--- a/src/dkp-history.c
++++ b/src/dkp-history.c
+@@ -295,6 +295,12 @@ dkp_history_get_profile_data (DkpHistory *history, gboolean charging)
+ 
+ 		/* round to the nearest int */
+ 		bin = rint (obj->value);
++
++		/* ensure bin is in range */
++		if (bin >= data->len)
++			bin = data->len - 1;
++
++		/* different */
+ 		if (oldbin != bin) {
+ 			oldbin = bin;
+ 			if (obj_old != NULL) {
+--
+cgit v0.8.3-6-g21f6




More information about the arch-commits mailing list