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

Misfeature in (c)debconf select handling



This is based on my experience with kernel-installer from the
base-installer source directory.

It is currently possible to set the value of a select question to a
option that is _not_ in the list of choices, and get the value back
from debconf.  This is annoying.

Given the following template:

  Template: nice-template
  Type: select
  Choices: ${LIST}
  Description: Nice description
   Nicer long description

If one run a script like this, with DEBCONF_PRIORITY=high, the result
will surprise me:

  db_subst nice-template LIST "foo, bar"
  db_set nice-template "baz" # Why is this successful?  The value is not legal!
  db_input medium nice-template || [ $? -eq 30 ]
  db_go
  db_get nice-template
  # $RET will contain 'baz' at this point, and not 'foo' or 'bar'

I believe (c)debconf should ignore db_set for values not in the choice
list, and at least not give a non-option back when asked about the
value using db_get.  Am I the only one?  Is this how it is supposed to
work?



Reply to: