Package: acpi-support
Version: 0.95-2
Severity: normal
Tags: patch

Hello,

The getXconsole function in /usr/share/acpi-support/power-funcs uses
"ps ax" and so doesn't work reliably when COLUMNS is set to say 80.
The grep and sed patterns used there are also not matching.  Here is a
rewritten version.

--- /usr/share/acpi-support/power-funcs.orig    2007-06-15 20:50:16.000000000 
+0100
+++ /usr/share/acpi-support/power-funcs 2007-08-10 17:38:31.000000000 +0100
@@ -20,7 +20,7 @@
 
 getXconsole() {
        console=`fgconsole`;
-       displaynum=`ps ax | grep -e 'X .* vt'$console | grep -v grep | sed -re 
's!.*/X .*:([0-9]+).*!\1!'`
+       displaynum=`find /proc -maxdepth 2 -name exe -lname /usr/bin/Xorg 
-print 2>/dev/null | sed -e 's/exe$/cmdline/' | xargs perl -ne 'print $1 and 
exit if /\0vt'$console'\0/ and /\0:(\d+)\0/'`
        if [ x"$displaynum" != x"" ]; then
                export DISPLAY=":$displaynum"   
                getXuser

Thanks,
        Ken

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

Kernel: Linux 2.6.22 (SMP w/2 CPU cores)
Locale: LANG=zh_TW.UTF-8, LC_CTYPE=zh_TW.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages acpi-support depends on:
ii  acpid                        1.0.4-7.1   Utilities for using ACPI power man
ii  dmidecode                    2.9-1       Dump Desktop Management Interface 
ii  finger                       0.17-11     user information lookup program
ii  hdparm                       7.6-1       tune hard disk parameters for high
ii  laptop-detect                0.13.2      attempt to detect a laptop
ii  libc6                        2.6.1-1     GNU C Library: Shared libraries
ii  lsb-base                     3.1-24      Linux Standard Base 3.1 init scrip
ii  powermgmt-base               1.29        Common utils and configs for power
ii  radeontool                   1.5-5       utility to control ATI Radeon back
ii  toshset                      1.72-5      Access much of the Toshiba laptop 
ii  vbetool                      0.7-1.1     run real-mode video BIOS code to a
ii  xbase-clients                1:7.2.ds2-2 miscellaneous X clients

acpi-support recommends no packages.

-- debconf-show failed

-- 
Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig
Remember Hirosima 1945-08-06, Nagasaki 1945-08-09.
http://petitions.pm.gov.uk/Free-Vanunu/ http://www.vanunu.org/

Attachment: signature.asc
Description: Digital signature

Reply via email to