Strange point in xserver-xfree86.config
Hello.
I'm experimenting with preloading default values to debconf database.
Among others, I was playing with the question about method of display
configuration (simple/medium/advanced).
I wanted to preload answer "Simple", but still let user to change it.
So I preload the following:
Name: xserver-xfree86/config/monitor/selection-method
Template: xserver-xfree86/config/monitor/selection-method
Value: Simple
Owners: xserver-xfree86
Since I want the question to be asked, I don't set "seen" flag.
However, when I try to install xserver-xfree86 package, I see the question
with "Advanced" selected by default.
I looked at the config script, and found the flooing code (near line 1569):
if [ "$RET" = "true" ]; then
db_subst xserver-xfree86/config/monitor/selection-method choices "Medium,
Advanced"
db_subst xserver-xfree86/config/monitor/selection-method default "Medium"
else # not an LCD
db_subst xserver-xfree86/config/monitor/selection-method choices "Simple,
Medium, Advanced"
db_subst xserver-xfree86/config/monitor/selection-method default "Simple"
fi
auto_answer db_input "$(priority_ceil $PRIORITY)"
xserver-xfree86/config/monitor/selection-method "Advanced"
That is, showing "Advanced" by default is hardcoded.
Isn't this a bug? Perhaps default selection should be one set by the above
lines, not "Advanced"?
Also, maybe auto_answer routine should be fixed to better support
preloading debconf values? In particular, if something is preloaded, use
that instead of provided in parameter 4? Patch for this (not tested) is
something like
@@ -846,8 +846,8 @@
debug_echo "auto_answer: (reconfiguring) preserving existing answer
\"$RET\""
else
# not reconfiguring; has the question been seen before?
- db_fget "$TEMPLATE" seen
- if [ "$RET" = "true" ]; then
+ db_get "$TEMPLATE"
+ if [ -n "$RET" ]; then
db_get "$TEMPLATE"
debug_echo "auto_answer: (not reconfiguring) preserving existing
answer \"$RET\""
else
Reply to: