~ubuntu-branches/ubuntu/precise/pm-utils/precise-updates

« back to all changes in this revision

Viewing changes to debian/patches/03-on_ac_power-devkit-power.patch

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-11-25 15:36:42 UTC
  • mfrom: (1.1.7 upstream) (2.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20091125153642-2ks4aeo101eyo6uq
Tags: 1.2.6.1-2
* Add 01-modprobe-blacklist.patch: Respect module blacklists when calling
  modprobe on resume. (fd.o #25254)
* Add 02-logging-append.patch: Do not clear the log file on each operation,
  but instead append to it. This makes debugging of several suspends much
  easier. Thanks to James Westby for the patch! (fd.o #25255, LP #410352)
* Add debian/pm-utils.logrotate: Rotate above log file.
* Prevent hibernation after a kernel update:
  - Add debian/kernel-postinst-hibernate-stamp: /etc/kernel/postinst.d/ hook
    to create /var/run/do-not-hibernate stamp.
  - Add debian/no-hibernate-on-kernel-update: sleep.d hook to make
    hibernation fail early if above stamp exists.
  - debian/rules: Install above scripts.
  - Closes: #457515, LP: #350491
* debian/rules: When building on Ubuntu, revert the effect of
  10-debian-defaults.patch; uswsusp is not supported in Ubuntu. Add
  lsb-release build dependency for this.
* debian/control: Add myself to Uploaders: with Michael's consent.
* Add 03-on_ac_power-devkit-power.patch: Try to contact DeviceKit-Power in
  on_ac_power, and if it succeeds, use that. Otherwise fall back to hal.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 7e0669993909e51fa8c3ad0d1d613083a3c5122d Mon Sep 17 00:00:00 2001
 
2
From: Martin Pitt <martin.pitt@ubuntu.com>
 
3
Date: Wed, 25 Nov 2009 12:31:34 +0100
 
4
Subject: [PATCH 3/5] on_ac_power: DeviceKit-power support
 
5
 
 
6
Try to contact DeviceKit-Power in on_ac_power, and if it succeeds, use that.
 
7
Otherwise fall back to hal.
 
8
 
 
9
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=25274
 
10
---
 
11
 src/on_ac_power |    9 +++++++++
 
12
 1 files changed, 9 insertions(+), 0 deletions(-)
 
13
 
 
14
diff --git a/src/on_ac_power b/src/on_ac_power
 
15
index edddf72..3a77734 100755
 
16
--- a/src/on_ac_power
 
17
+++ b/src/on_ac_power
 
18
@@ -30,6 +30,15 @@
 
19
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
20
 #
 
21
 
 
22
+# prefer DeviceKit-power if available
 
23
+if s=`dbus-send --system --print-reply --dest=org.freedesktop.DeviceKit.Power /org/freedesktop/DeviceKit/Power org.freedesktop.DBus.Properties.Get string:org.freedesktop.DeviceKit.Power string:OnBattery`; then
 
24
+    if echo "$s" | grep -q 'boolean false'; then
 
25
+       exit 0
 
26
+    else
 
27
+       exit 1
 
28
+    fi
 
29
+fi
 
30
+
 
31
 # Check for AC/DC/etc adapters
 
32
 ac_adapters="$(hal-find-by-capability --capability ac_adapter)"
 
33
 
 
34
-- 
 
35
1.6.5
 
36