Package: lsb-base
Version: 3.1-10
Severity: normal

if TERM is set to xterm-mono the function log_use_fancy_output() returns
true and the log_* functions the try to use `tput setaf 1` and `tput op`.
These two fail with TERM=xterm-mono and scripts like /etc/init.d/apache2 exit
at that point since they have "set -e" switched on. You can fix this by
changing each `tput setaf 1` to `tput setaf 1 || exit 0` etc. or change the
log_use_fancy_output() to test "tput setaf" like it tests "tput hpa".

Actually I think the log_use_fancy_output function could be removed. The
present function is only used to set the variables RED YELLOW and NORMAL
so it could be replaced with something like

TPUT=/usr/bin/tput
EXPR=/usr/bin/expr
if [ "x$TERM" != "xdumb" ] && [ -x $TPUT ] && [ -x $EXPR ] \
   && $TPUT hpa 60 >/dev/null 2>&1 && $TPUT setaf 1 >/dev/null 2>&1; then
     FAILURE="`$TPUT setaf 1`*`$TPUT op` "
     FAILED=" `$TPUT setaf 1`failed!`$TPUT op`"
     WARNING="`$TPUT setaf 3`*`$TPUT op` "
else
     FAILURE=""
     FAILED=" failed!
     WARNING=""
fi

and then you just use those variables in the log_* functions without having
to have an if-then-else construct. It also means that you don't have to
worry about /usr being unmounted half way through a script since you've
cached all the necessary terminfo magic at the start and you no longer
need tput.

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)

Versions of packages lsb-base depends on:
ii  ncurses-bin                   5.5-2      Terminal-related programs and man 
ii  sed                           4.1.5-1    The GNU sed stream editor

lsb-base recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to