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

Re: cdebconf always falling back to English?



[Denis Barbier]
> Ok I had boot parameters in mind, but maybe you are thinking about
> pre-existing answers in debconf databases.

I was thinking about adding LANGUAGE=en to /sbin/debian-installer.

> Well cdebconf should certainly have some '#ifdef DEBIAN_INSTALLER'
> because there are always special cases.  Here is a patch against
> template.c (not tested), but finding a better solution might be a
> good idea.

I got a better idea.  Why not have cdebconf change language when the
debconf/language value is set.  This way I can set it at the start of
languagechooser, and get the display I want.

We need to update main-menu as well, to get it to stop sending
SIGUSR1.  But it is no rush, because I let it ignore the signal for
now.

The patch is untested.  Do you think it will work?  I tried to get rid
of the environment variable completely, but the 'questions' variable
is not available in template.c, and I do not know how to get a debconf
value without it.

Index: commands.c
===================================================================
RCS file: /cvs/debian-boot/debian-installer/tools/cdebconf/src/commands.c,v
retrieving revision 1.42
diff -u -3 -p -u -r1.42 commands.c
--- commands.c  26 Mar 2003 14:05:40 -0000      1.42
+++ commands.c  6 Apr 2003 22:01:01 -0000
@@ -239,8 +239,12 @@ int command_set(struct confmodule *mod,
         question_setvalue(q, buf);

         if (mod->questions->methods.set(mod->questions, q) != 0)
+        {
             snprintf(out, outsize, "%u value set",
                     CMDSTATUS_SUCCESS);
+            if (0 == strcmp("debconf/language", argv[1]))
+                setenv("LANGUAGE", buf, 1);
+        }
         else
             snprintf(out, outsize, "%u cannot set value",
                     CMDSTATUS_INTERNALERROR);
Index: debconf.c
===================================================================
RCS file: /cvs/debian-boot/debian-installer/tools/cdebconf/src/debconf.c,v
retrieving revision 1.21
diff -u -3 -p -u -r1.21 debconf.c
--- debconf.c   21 Dec 2002 22:06:14 -0000      1.21
+++ debconf.c   6 Apr 2003 22:01:01 -0000
@@ -57,12 +57,7 @@ void sighandler(int sig)
        save();
        if (sig == SIGUSR1)
        {
-               if (questions != NULL)
-               {
-                       q = questions->methods.get(questions, "debconf/language");
-                       if (q != NULL)
-                               setenv("LANGUAGE", question_getvalue(q, NULL), 1);
-               }
+               /* This used to force language update.  Obsolete now */
                return;
        }
        cleanup();



Reply to: