Hi, while working on the dreaded dependency on consolekit (#665987) I found a much more severe problem (#680409) and fixed both. I don't think we should release without a fix to #680409 because that bug opens a whole can of worms. We've had a lot of problems with acpi-support and other power managers interfering with each other and I don't want to see those come up again. So please unblock.
Thanks. Michael P.S.: Debdiff attached. -- Michael Meskes Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org) Michael at BorussiaFan dot De, Meskes at (Debian|Postgresql) dot Org Jabber: michael.meskes at googlemail dot com VfL Borussia! Força Barça! Go SF 49ers! Use Debian GNU/Linux, PostgreSQL
diff -u acpi-support-0.140/debian/changelog acpi-support-0.140/debian/changelog --- acpi-support-0.140/debian/changelog +++ acpi-support-0.140/debian/changelog @@ -1,3 +1,13 @@ +acpi-support (0.140-5) unstable; urgency=low + + * Rewrote getXuser in power-funcs to only use ck-list-sessions if installed, + if not fallback to using pinky instead. This enables us to downgrade + consolekit to a recommendation instead of a dependency. (Closes: #665987) + * Unset IFS after using it to make other commands use standard setting again. + (Closes: #680409) + + -- Michael Meskes <[email protected]> Thu, 05 Jul 2012 11:03:20 +0200 + acpi-support (0.140-4) unstable; urgency=low * Remove examples that are variants of files still in use. diff -u acpi-support-0.140/debian/control acpi-support-0.140/debian/control --- acpi-support-0.140/debian/control +++ acpi-support-0.140/debian/control @@ -35,7 +35,8 @@ Package: acpi-support-base Architecture: all -Depends: acpid (>= 1.0.4), consolekit, ${misc:Depends} +Depends: acpid (>= 1.0.4), ${misc:Depends} +Recommends: consolekit Suggests: acpi-support Replaces: acpi-support (<< 0.109-1) Description: scripts for handling base ACPI events such as the power button diff -u acpi-support-0.140/debian/patches/power-funcs.diff acpi-support-0.140/debian/patches/power-funcs.diff --- acpi-support-0.140/debian/patches/power-funcs.diff +++ acpi-support-0.140/debian/patches/power-funcs.diff @@ -1,6 +1,6 @@ --- acpi-support-0.140/lib/power-funcs +++ acpi-support-0.140/lib/power-funcs -@@ -1,33 +1,51 @@ +@@ -1,33 +1,83 @@ # a micro library of helper functions for the power scripts -umask 022; @@ -21,32 +21,62 @@ getXuser() { - local display userhome uid - if [ -z "$displaynum" ]; then -- display=.+ -+ local display uid user startx pid userhome IFS ++ local plist display uid user startx pid userhome IFS + + if [ "$displaynum" ]; then + display=:$displaynum ++ else + display=.+ ++ fi ++ ++ user= ++ if [ -x /usr/bin/ck-list-sessions ]; then ++ uid=$(ck-list-sessions | awk 'BEGIN { unix_user = ""; } /^Session/ { unix_user = ""; } /unix-user =/ { gsub(/'\''/,"",$3); unix_user = $3; } /x11-display = '\'$display\''/ { print unix_user; exit (0); }') ++ ++ if [ "$uid" ]; then ++ IFS=: ++ set -- $(getent passwd $uid) ++ user=$1 ++ unset IFS ++ fi else - display=":$displaynum" -+ display=.+ ++ plist=$(pinky -fw) || pwf_error "pinky lost" ++ while read l; do ++ set -- $l ++ eval lastpp=\$$# ++ for ds in $2 $lastpp; do ++ case $ds in ++ $display) ++ user=$1 ++ break ++ ;; ++ esac ++ done ++ [ -z "$user" ] || break ++ for ds in $2 $lastpp; do ++ case $ds in ++ $display.0) ++ user=$1 ++ break ++ ;; ++ esac ++ done ++ [ -z "$user" ] || break ++ done <<-EOF ++ $plist ++ EOF fi -+ - uid=$(ck-list-sessions | awk 'BEGIN { unix_user = ""; } /^Session/ { unix_user = ""; } /unix-user =/ { gsub(/'\''/,"",$3); unix_user = $3; } /x11-display = '\'$display\''/ { print unix_user; exit (0); }') +- uid=$(ck-list-sessions | awk 'BEGIN { unix_user = ""; } /^Session/ { unix_user = ""; } /unix-user =/ { gsub(/'\''/,"",$3); unix_user = $3; } /x11-display = '\'$display\''/ { print unix_user; exit (0); }') - if [ -n "$uid" ]; then - user=$(getent passwd $uid | cut -d: -f1) - userhome=$(getent passwd $user | cut -d: -f6) - export XAUTHORITY=$userhome/.Xauthority -+ if [ "$uid" ]; then -+ IFS=: -+ set -- $(getent passwd $uid) -+ user=$1 - else -- user= -- export XAUTHORITY="" ++ if [ -z "$user" ]; then + startx=$(pgrep -n startx || :) + [ -z "$startx" ] || user=$(ps -o user --no-headers $startx || :) - fi ++ fi + + if [ x"$user" != x ]; then + for pid in `ps -U $user -o pid=`; do @@ -59,14 +89,16 @@ + eval userhome=~$user + export XAUTHORITY=$userhome/.Xauthority + fi -+ else + else +- user= +- export XAUTHORITY="" + export XAUTHORITY= -+ fi + fi + export XUSER=$user } # getXconsole: get the information for the active X console, if any. -@@ -36,45 +54,55 @@ +@@ -36,45 +86,55 @@ # output: $XAUTHORITY: the path to the xauth data used for connecting to the # detected X display. # $DISPLAY: the X display

