1
0
Fork 0

configure: Avoid two errors if TERM=unknown

http://buildd.debian-ports.org/fetch.php?pkg=elinks&arch=hurd-i386&ver=0.12%7Epre5-1&stamp=1247378205&file=log&as=raw
shows two unsightly errors, apparently triggered by TERM=unknown:

tput: unknown terminal "unknown"
/build/buildd/elinks-0.12~pre5/configure: line 25480: test: -ge: unary operator expected

Hide the first of them by redirecting to /dev/null,
and avoid the second one by substituting "0" if tput fails.

I'm not sure why `which tput` is used instead of plain tput,
but it doesn't seem to be causing any problems in practice.
(There are problems in theory if tput is not installed,
tput is found in a directory whose name contains spaces,
or tput is a shell function or builtin.)
(cherry picked from elinks-0.12 commit 4369b052ef)
This commit is contained in:
Kalle Olavi Niemitalo 2009-08-15 01:18:20 +03:00 committed by Kalle Olavi Niemitalo
parent 87eac68dc3
commit bb20653c48
1 changed files with 1 additions and 1 deletions

View File

@ -1792,7 +1792,7 @@ EL_LOG_CONFIG(LIBS, [Library flags (LIBS)], [])
# Colored make output
# ===================================================================
if test $(`which tput` colors) -ge 4; then
if test $(`which tput` colors 2> /dev/null || echo 0) -ge 4; then
MAKE_COLOR=1
AC_SUBST(MAKE_COLOR)
fi