Bug#486892: different behavior from debconf when noninteractively asking a select question with a default not in the select list

2008-06-23 Thread Frans Pop
On Thursday 19 June 2008, Joey Hess wrote:
 Even that could diverge slightly from debconf: If two questions are to
 be asked, the second is a noninteractive select, and the user backs up
 from the first, debconf will not change the value of the noninteractive
 select, while cdebconf would.

 (It could instead handle the noninteractive questions only if the user
 didn't back up, but that would just make it instead differ in the case
 where the noninteractive question is first, and the user backs up from
 the second question.)

 I think this would be a small enough difference, in an area that is
 not well specified, that it would be acceptable though, unlike the
 current glaring difference..

As backing up basically translates to either I'll come back to this 
later or to the values are of no interest to me, I think that is 
acceptable.

From a D-I PoV I do not think it really matters which of the two 
alternatives for divergence are chosen. For regular debconf use for 
package configuration I can see a slight argument for leaving things 
unset, i.e. preferring your alternative approach.

Question: what does debconf do if there has never been a db_input? I.e. if 
you do just 'db_subst' directly followed by 'db_get'.
Does it then also return first in list or the default or what? We could 
still have a divergence there I think.

On Friday 20 June 2008, Joey Hess wrote:
 Attached patch seems to work (mirror works in auto mode), and the small
 test suite I added shows it does the right thing in all 4 cases.

 Could use some more testing,

I see no problems with the patch. Have also tested that using Go Back 
around a seen template still works correctly.

 and my caveats about this being a hacky and suboptimal approach still
 apply. 

Sorry, can't really help with that :-/

Again thanks for picking up the issue.


signature.asc
Description: This is a digitally signed message part.


Bug#486892: different behavior from debconf when noninteractively asking a select question with a default not in the select list

2008-06-23 Thread Joey Hess
Frans Pop wrote:
 Question: what does debconf do if there has never been a db_input? I.e. if 
 you do just 'db_subst' directly followed by 'db_get'.

In this case behavior of debconf and cdebconf are the same, you'll get
the Default, and if there's no Default, you'll get .

Similarly, you can db_set a selection question to any value, even a
value not in the Choices, and db_get it back unchanged, until db_input
forces it to the one of the Choices.

-- 
see shy jo


signature.asc
Description: Digital signature


Bug#486892: different behavior from debconf when noninteractively asking a select question with a default not in the select list

2008-06-19 Thread Frans Pop
This bug is even more severe than it first looked. The Choices list is
completely ignored by cdebconf when a db_get is done immediately after a
db_subst that sets a variable used in Choices (or with a db_input in
between that gets skipped because of priority).

From a trace in #486558:

debconf: -- SUBST mirror/http/mirror mirrors ftp.us.debian.org, 
ftp.egr.msu.edu, [...]
debconf: Adding [mirrors] - [ftp.us.debian.org, ftp.egr.msu.edu, 
mirrors.kernel.org, [...]
debconf: rfc822db_question_set(db,q=mirror/http/mirror,q=0x8076ed8)
debconf: -- 0
debconf: -- INPUT high mirror/http/mirror
debconf: Comparing priorities high (2) with critical (3)
debconf: -- 30 question skipped
debconf: -- GO
debconf: -- 0 ok
[...]
debconf: -- GET mirror/http/mirror
debconf: -- 0

I tried if displaying the question but not confirming an answer (by
backing up when the question is displayed) helped, but that does not
change anything.

From template.dat:
Name: mirror/http/mirror
Type: select
Choices: ${mirrors}
Description: [...]

From questions.dat:
Name: mirror/http/mirror
Template: mirror/http/mirror
Owners: d-i
Variables:
 mirrors = ftp.us.debian.org, [...]



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