[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#179904: xfree86-common: Xsession could use xmessage to display errors



tags 179904 + patch
thanks


Here is a tested patch to fix the problem.  Please apply in the next
version of XFree86 for Debian.

Having X fail without any error message is a usability problem
confusing users and giving university support personel extra work.  It
would be very nice if this could be fixed on the official packages.

I'm not sure where the message_nonl() function is used.  It is not
used in any of the Xsession.d scripts we got installed, but I added
the call to xmessage there as well just in case. :)

--- Xsession.orig       2003-04-09 16:50:30.000000000 +0200
+++ Xsession    2003-04-09 17:01:20.000000000 +0200
@@ -9,11 +9,17 @@
 message () {
   # pretty-print messages of arbitrary length
   echo "$*" | fold -s -w ${COLUMNS:-80} >&2;
+  if [ ! -z "$DISPLAY" ] ; then
+    echo "$*" | fold -s -w ${COLUMNS:-80} | xmessage -file -
+  fi
 }

 message_nonl () {
   # pretty-print messages of arbitrary length (no trailing newline)
   echo -n "$*" | fold -s -w ${COLUMNS:-80} >&2;
+  if [ ! -z "$DISPLAY" ] ; then
+    echo -n "$*" | fold -s -w ${COLUMNS:-80} | xmessage -file -
+  fi
 }

 errormsg () {
@@ -24,8 +30,8 @@

 internal_errormsg () {
   # exit script with error; essentially a "THIS SHOULD NEVER HAPPEN" message
-  message "$*"
-  message "Please report the package name, version, and the text of the" \
+  message "$*\n"
+          "Please report the package name, version, and the text of the" \
           "above error message(s) to <debian-x@lists.debian.org>.";
   exit 1;
 }




Reply to: