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

Bug#257180: loses default answer to unseen question if it is fset seen

On Thu, Jul 01, 2004 at 02:49:23PM -0400, Joey Hess wrote:
> After the fset, cdebconf incorrectly makes the stanza for this
> question in config.dat have an empty value, like this:
> Name: hw-detect/start_pcmcia
> Template: hw-detect/start_pcmcia
> Value: 
> Owners: d-i
> Flags: seen
> This plays havoc with stuff that expects to get a true/false from a
> boolean. In this particular example, it utterly breaks pcmcia restarting
> in d-i. It's out of spec for a boolean to have a value that is not true
> or false.
> The correct thing to do in this case is to either copy the Value from
> the template, or not put in a Value field when the value is not set, and
> inherit from the template still. debconf does the latter, which cdebconf
> should do depends on its internal design, I suppose.

Here is a patch (untested).

Index: packages/cdebconf/src/modules/db/rfc822db/rfc822db.c
--- packages/cdebconf/src/modules/db/rfc822db/rfc822db.c	(revision 17355)
+++ packages/cdebconf/src/modules/db/rfc822db/rfc822db.c	(working copy)
@@ -438,8 +438,8 @@
         INFO(INFO_VERBOSE, "dumping question %s\n", (q)->tag); 
         fprintf(outf, "Name: %s\n", escapestr((q)->tag));
         fprintf(outf, "Template: %s\n", escapestr((q)->template->tag));
-        if (((q)->flags & DC_QFLAG_SEEN) || (q)->value)
-            fprintf(outf, "Value: %s\n", ((q)->value ? escapestr((q)->value) : ""));
+        if ((q)->value)
+            fprintf(outf, "Value: %s\n", escapestr((q)->value));
         if ((owner = (q)->owners))

Reply to: