tag 665987 patch
thanks

On Wed, 2012-03-28 at 09:43:49 +0200, Michael Meskes wrote:
> On Tue, Mar 27, 2012 at 06:08:22PM +0200, Guillem Jover wrote:
> > The latest version got a new dependency on consolekit, would it be
> > possible to demote it to a Recommends?
> 
> No.

>From this reply it's not really clear why, so maybe the attached patch
can change your mind? consolekit it not usable anyway with things like
startx or when the system is not running an X session, for example.

thanks,
guillem
diff --git a/debian/changelog b/debian/changelog
index f78aa73..41f6aba 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+acpi-support (0.140-1local1) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * Demote consolekit to a recommends, by only using ck-list-sessions when
+    available, it does not work for startx sessions anyway.
+
+ -- Guillem Jover <guil...@debian.org>  Wed, 28 Mar 2012 15:58:58 +0200
+
 acpi-support (0.140-1) unstable; urgency=low
 
   * Imported new Upstream version 0.140
diff --git a/debian/control b/debian/control
index 9d521b8..160ba9e 100644
--- a/debian/control
+++ b/debian/control
@@ -11,9 +11,9 @@
 Package: acpi-support
 Architecture: all
 Depends: acpi-support-base (>= 0.109-1), x11-xserver-utils, acpid (>= 1.0.4),
-	lsb-base (>= 1.3-9), pm-utils, acpi-fakekey, consolekit, ${arch:Depends},
+	lsb-base (>= 1.3-9), pm-utils, acpi-fakekey, ${arch:Depends},
 	${misc:Depends}
-Recommends: dbus, vbetool, xscreensaver|gnome-screensaver, radeontool
+Recommends: dbus, vbetool, consolekit, xscreensaver|gnome-screensaver, radeontool
 Suggests: rfkill, xinput, ${arch:Suggests}
 Breaks: uswsusp (<= 0.2)
 Description: scripts for handling many ACPI events
diff --git a/debian/patches/power-funcs.diff b/debian/patches/power-funcs.diff
index 2831c3a..5dcb7fd 100644
--- a/debian/patches/power-funcs.diff
+++ b/debian/patches/power-funcs.diff
@@ -1,6 +1,21 @@
---- acpi-support-0.139/lib/power-funcs
-+++ acpi-support-0.139/lib/power-funcs
-@@ -10,24 +10,40 @@
+---
+ lib/power-funcs |   53 ++++++++++++++++++++++++++++++++++++++++++-----------
+ 1 file changed, 42 insertions(+), 11 deletions(-)
+
+--- a/lib/power-funcs
++++ b/lib/power-funcs
+@@ -5,29 +5,50 @@
+ PATH="$PATH:/usr/bin/X11"
+ POWERSTATE="/var/lib/acpi-support/powerstate"
+ 
++if which ck-list-sessions >/dev/null; then
++	LISTSESSIONS=ck-list-sessions
++else
++	LISTSESSIONS=:
++fi
++
+ # getXuser: get the user for the specified X display, or if none is
+ # specified, then the user for whatever X display we find.
  # input: $displaynum: the X display to query
  # output: $XAUTHORITY: the path to the xauth data used for connecting to the
  #                      detected X display.
@@ -15,8 +30,8 @@
  	else
  		display=":$displaynum"
  	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); }')
++	uid=$($LISTSESSIONS | 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)
@@ -46,7 +61,7 @@
  }
  
  # getXconsole: get the information for the active X console, if any.
-@@ -36,7 +52,7 @@
+@@ -36,11 +57,11 @@
  # output: $XAUTHORITY: the path to the xauth data used for connecting to the
  #                      detected X display.
  #         $DISPLAY: the X display
@@ -55,7 +70,12 @@
  getXconsole() {
  	local displaynum
  
-@@ -48,6 +64,7 @@
+-	displaynum=$(ck-list-sessions | awk 'BEGIN { active = 0; } /^Session/ { active = 0; } /active = TRUE/ { active = 1; } active && /x11-display = '\':.+\''/ { gsub(/'\':*'/,"",$3); print $3; exit (0); }')
++	displaynum=$($LISTSESSIONS | awk 'BEGIN { active = 0; } /^Session/ { active = 0; } /active = TRUE/ { active = 1; } active && /x11-display = '\':.+\''/ { gsub(/'\':*'/,"",$3); print $3; exit (0); }')
+ 
+ 	if [ -n "$displaynum" ]; then
+ 		export DISPLAY=":$displaynum"
+@@ -48,6 +69,7 @@
  	fi
  }
  
@@ -63,7 +83,7 @@
  getState() {
          /usr/bin/on_ac_power
          if [ "$?" -eq 1 ]; then
-@@ -56,25 +73,34 @@
+@@ -56,25 +78,34 @@
                  STATE="AC"
          fi
  }

Reply via email to