~ubuntu-branches/ubuntu/raring/pm-utils/raring-proposed

« back to all changes in this revision

Viewing changes to pm/functions.in

  • 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:
3
3
 
4
4
# Common functionality for the hooks.
5
5
 
 
6
# If a variable is set to true, yes, 1, or is simply set with no value,
 
7
# return 0, otherwise return 1.
 
8
is_set()
 
9
{
 
10
    case ${1-UNSET} in
 
11
        true|yes|TRUE|YES|on|ON|1'') return 0;;
 
12
        false|FALSE|no|NO|off|OFF|0|UNSET) return 1;;
 
13
        *) return 2;;
 
14
    esac
 
15
}
 
16
 
6
17
# for great debugging!
7
 
[ "${PM_DEBUG}" = "true" ] && set -x
 
18
is_set "${PM_DEBUG}" && set -x
 
19
 
8
20
 
9
21
# try to take the lock.  Fail if we cannot get it.
10
22
try_lock()
246
258
{
247
259
        command dbus-send "$@" 2>/dev/null || return $NA
248
260
}
 
261