[Pkg-acpi-devel] Bug#603864: acpi-support-base: latest revision; some small improvements
Cristian Ionescu-Idbohrn
cristian.ionescu-idbohrn at axis.com
Wed Nov 17 23:19:16 UTC 2010
Package: acpi-support-base
Version: 0.137-7
Severity: normal
Tags: patch
See attached. Motivations (not only on 'policy-funcs'):
--- check_policy.diff 2010-11-17 22:23:01.000000000 +0100
+++ check_policy.cii.diff 2010-11-17 23:04:21.000000000 +0100
@@ -1,7 +1,9 @@
--- acpi-support-0.137/lib/policy-funcs 2010-11-15 13:40:42.000000000 +0100
+++ acpi-support-0.137/lib/policy-funcs 2010-11-15 13:50:58.000000000 +0100
-@@ -7,16 +7,25 @@
+@@ -7,1 +7,1 @@
return 1;
+*** ^
+*** not needed
fi
}
+
@@ -21,7 +23,17 @@
+ PMS="$PMS /usr/bin/guidance-power-manager /usr/lib/dalston/dalston-power-applet"
if pidof -x $PMS > /dev/null ||
- (pidof dcopserver > /dev/null && test -x /usr/bin/dcop && /usr/bin/dcop kded kded loadedModules | grep -q klaptopdaemon) ||
+
+*** I would write it:
+
+ { test "$XUSER" != "" && pidof dcopserver > /dev/null && test -x /usr/bin/dcop && /usr/bin/dcop --user $XUSER kded kded loadedModules | grep -q klaptopdaemon; } ||
+
+*** like this:
+
++ { [ "$XUSER" ] && pidof dcopserver > /dev/null &&
+ [ -x /usr/bin/dcop ] &&
+ /usr/bin/dcop --user $XUSER kded kded loadedModules | grep -q klaptopdaemon; } ||
+
PowerDevilRunning ; then
- echo 0;
+ return 0
@@ -44,23 +56,44 @@
--- acpi-support-0.137/power.sh 2010-06-30 11:40:57.000000000 +0200
+++ acpi-support-0.137/power.sh 2010-11-15 14:11:14.000000000 +0100
-@@ -4,7 +4,7 @@
+@@ -4,4 +4,3 @@
. /usr/share/acpi-support/policy-funcs
-if [ -z "$*" ] && ( [ `CheckPolicy` = 0 ] || CheckUPowerPolicy ); then
+
+*** you should not need to run second part in a subshell:
+
+if [ -z "$*" ] && ( CheckPolicy || CheckUPowerPolicy ); then
+
+*** similar to the above, but do it like this:
+
++if [ -z "$*" ] && { CheckPolicy || CheckUPowerPolicy; }; then
exit;
+ ^
+*** not needed
fi
-
+
--- acpi-support-0.137/lid.sh 2010-11-15 13:40:42.000000000 +0100
+++ acpi-support-0.137/lid.sh 2010-11-15 14:11:32.000000000 +0100
-@@ -8,7 +8,7 @@
+@@ -8,4 +8,4 @@
[ -x /etc/acpi/local/lid.sh.pre ] && /etc/acpi/local/lid.sh.pre
-if [ `CheckPolicy` = 0 ]; then exit; fi
+if CheckPolicy; then exit; fi
-
+
+*** or:
+
++! CheckPolicy || exit
+
+
+
+*** equivalent to this:
+
grep -q closed /proc/acpi/button/lid/*/state
if [ $? = 0 ]
+
+*** is:
+
+ if grep -q closed /proc/acpi/button/lid/*/state
-- 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-base depends on:
ii acpid 1:2.0.7-1 Advanced Configuration and Power I
ii console-tools [console-uti 1:0.2.3dbs-69 Linux console and font utilities
acpi-support-base recommends no packages.
Versions of packages acpi-support-base suggests:
ii acpi-support 0.137-7 scripts for handling many ACPI eve
-- no debconf information
Cheers,
--
Cristian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: policy-funcs.patch
Type: text/x-diff
Size: 2091 bytes
Desc:
URL: <http://lists.alioth.debian.org/pipermail/pkg-acpi-devel/attachments/20101118/a2db2ba1/attachment.patch>
More information about the Pkg-acpi-devel
mailing list