Comment 8 for bug 68267

Revision history for this message
Paul Dufresne (paulduf) wrote : Re: x11-common is uninstallable when debconf method is kde

I think I have found ('a' or 'the') bug:
---
validate_nice_value () {
  _retval=1
  # first, try to subtract number from itself to validate numeric input
  # (expr is noisy, always throw away its output)
  set +e
  expr "$1" - "$1" > /dev/null 2>&1
  if [ $? -ne 2 ]; then
    # now check for valid range
---
but I get:
---
paul@paul-Caspar:~$ expr "raton" "-" "raton"
expr: non-numeric argument
paul@paul-Caspar:~$ echo $?
3
paul@paul-Caspar:~$ expr "" "-" ""
expr: non-numeric argument
paul@paul-Caspar:~$ echo $?
3
---
2 is a syntax error
3 if an error occured
here an error appears on empty or non-numeric value

Replacing:
if [ $? -ne 2 ]; then
by
if [ $? -ne 3 ]; then
would probably work.