On Mon, 2002-02-25 at 18:16, Eduard Bloch wrote:
>  - modconf call must get a proper locale, like de_DE.UTF-8. Phil, could
>    you have a look?

I haven't had a chance to test this yet but I think it should be
somewhere near right.  Setting LANG=C@utf-8 may not be necessary
(LC_CTYPE is already set to that anyway) but it shouldn't hurt.  All
that modconf probably cares about is the value of LC_MESSAGES.

If we had more confidence in our convictions, we could just set
LC_MESSAGES in main.c and forget about it thereafter.  I haven't done
this just in case some other program that gets called is not yet
i18n-tolerant.

p.

Index: baseconfig.c
===================================================================
RCS file: 
/org/cvs.debian.org/cvs/debian-boot/boot-floppies/utilities/dbootstrap/baseconfig.c,v
retrieving revision 1.104
diff -u -r1.104 baseconfig.c
--- baseconfig.c        2002/02/25 08:47:07     1.104
+++ baseconfig.c        2002/02/25 20:24:13
@@ -528,7 +528,7 @@
   char buffer1[PATH_MAX];
   char buffer2[PATH_MAX];
 #endif
-  char *old_locale;
+  char *old_locale, *old_lc_messages, *p;
 
   if (! NAME_ISEXE("/usr/bin/whiptail", &statbuf))
       symlink("/target/usr/bin/whiptail", "/usr/bin/whiptail");
@@ -575,11 +575,18 @@
      will work.  See bug #78750 */
   execlog("echo /sbin/modprobe >/proc/sys/kernel/modprobe", LOG_INFO);
 
-  /* Modconf needs the correct LANG or LC_MESSAGES string (test later). If it
-   * does not, fix this later, also see below
+#ifdef USE_LANGUAGE_CHOOSER
+  old_locale = getenv("LANG");
+  old_lc_messages = getenv("LC_MESSAGES");
+
+  strcpy(prtbuf, lang->locale);
+  p = strchr(prtbuf, '.');
+  if (p)
+    strcpy(p+1, "UTF-8");
 
-  old_locale = getenv("LC_ALL");
-  setenv("LC_ALL", "C", 1); */
+  setenv("LANG", "C@utf-8", 1);
+  setenv("LC_MESSAGES", prtbuf, 1);
+#endif
   
   /* copy the preconfigured modules file to target/etc */
   execlog("test -f /target/etc/modules || cp /etc/modules /target/etc/", LOG_INFO);
@@ -595,11 +602,17 @@
   /* Turn kmod off again */
   execlog("echo /bin/true >/proc/sys/kernel/modprobe", LOG_INFO);
 
-  /* Restore the old locale
+#ifdef USE_LANGUAGE_CHOOSER
+  /* Restore the old locale */
   if (old_locale)
-    setenv("LC_ALL", old_locale, 1);
+    setenv("LANG", old_locale, 1);
+  else
+    unsetenv("LANG");
+  if (old_lc_messages)
+    setenv("LC_MESSAGES", old_lc_messages, 1);
   else
-    unsetenv("LC_ALL"); */
+    unsetenv("LC_MESSAGES");
+#endif
 
   update_cdrom_symlink();
 


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

Reply via email to