Package: acpi-support
Version: 0.138-4
Severity: normal
Tags: patch

Seems previous patching rounds missed fixing one CheckPolicy instance
in /usr/share/doc/acpi-support/examples/acpi/sleep.sh (attached patch
corrects that).

The second part of the patch optimizes this command:

-if [ -z "$*" ] && ( CheckPolicy || CheckUPowerPolicy ); then
                   ^                                  ^
to _not_ run the second part of the condition in a _forked_ subshell:

+if [ -z "$*" ] && { CheckPolicy || CheckUPowerPolicy; }; then
                   ^                                 ^ ^
I recall seeing this sort of thing in other places too.

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages acpi-support depends on:
ii  acpi-fakekey                  0.138-4    tool to generate fake key events
ii  acpi-support-base             0.138-4    scripts for handling base ACPI eve
ii  acpid                         1:2.0.7-1  Advanced Configuration and Power I
ii  lsb-base                      3.2-26     Linux Standard Base 3.2 init scrip
ii  pm-utils                      1.3.0-3    utilities and scripts for power ma
ii  x11-xserver-utils             7.5+2      X server utilities

Versions of packages acpi-support recommends:
ii  dbus                          1.2.24-3   simple interprocess messaging syst
pn  radeontool                    <none>     (no description available)
ii  vbetool                       1.1-2      run real-mode video BIOS code to a
pn  xscreensaver | gnome-screensa <none>     (no description available)

Versions of packages acpi-support suggests:
ii  rfkill                        0.4-1      tool for enabling and disabling wi
ii  xinput                        1.5.2-1    Runtime configuration and test of

-- no debconf information


Cheers,

-- 
Cristian
--- ./debian/acpi-support/usr/share/doc/acpi-support/examples/acpi/sleep.sh.orig	2010-12-14 10:15:51.000000000 +0100
+++ ./debian/acpi-support/usr/share/doc/acpi-support/examples/acpi/sleep.sh	2010-12-14 13:14:55.000000000 +0100
@@ -11,9 +11,5 @@ test -f /usr/share/acpi-support/key-cons
 
 . /usr/share/acpi-support/policy-funcs
 
-if [ `CheckPolicy` != 0 ]; then
   # No power management daemons are running. Divert to our own implementation.
-  /usr/share/acpi-support/suspendorhibernate suspend
-fi
-
-
+CheckPolicy || /usr/share/acpi-support/suspendorhibernate suspend
--- ./power.sh.orig	2010-12-14 11:37:17.000000000 +0100
+++ ./power.sh	2010-12-14 11:45:03.000000000 +0100
@@ -4,7 +4,7 @@ test -f /usr/share/acpi-support/key-cons
 
 . /usr/share/acpi-support/policy-funcs
 
-if [ -z "$*" ] && ( CheckPolicy || CheckUPowerPolicy ); then
+if [ -z "$*" ] && { CheckPolicy || CheckUPowerPolicy; }; then
     exit;
 fi
 

Reply via email to