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

Re: localising base-config - end game



I've been studying your patch, and have some comments and an improved
patch.

[Eduard Bloch]
> Now, some weeks later, we created some infrastructure (*) and you
> discussed about possible implementations (patches attached). So the
> concret plans of mine:
> 
>  - add additional prompt, asking the user about keeping the locale

Keeping the locale means two different things in this context:

 - use the current language during the second stage installation
   (base-config)
 - use the current language and locale as the system default for all
   users after the second stage installer is finished.

Which one do you want?  I want the first one, but not the second one.
This means making base-config pass LANG and LANGUAGE on to its
sub-processes (tasksel, tzconfig, etc), but leaving /etc/environment
alone.

For the first one to work, the 'locales' package must be installed
installed and /etc/locale.gen updated before locale-gen is executed.
The second needs this in addition to your modification of
/etc/environment.

The change to boot-floppies would be almost the same for both.  The
only difference is which question to ask, and how to interpret the
answer.

In addition to the 'locales' package, some languages needs to install
a special frame buffer terminal to be able to show the characters.
Japanese is an example, but I guess Russian have the same problem.
The package must be installed before base-config (or more correctly
termwrap) starts.  My patch do not address that problem.

Here is a modified patch for boot-floppies.

Index: dbootstrap.h
===================================================================
RCS file: /cvs/debian-boot/boot-floppies/utilities/dbootstrap/dbootstrap.h,v
retrieving revision 1.100
diff -u -3 -p -u -r1.100 dbootstrap.h
--- dbootstrap.h	2002/03/06 12:43:17	1.100
+++ dbootstrap.h	2002/03/07 14:05:30
@@ -176,6 +176,7 @@ struct fdisk_partition *Root;
 int noSwap, notCreatedBootFloppy, notInstalledLILO;
 extern char *kernel_cd, *base_cd;
 extern int wants_cd, probe_mode;
+extern int wants_locale;
 
 static const char * fs_type_tab[];
 
Index: main.c
===================================================================
RCS file: /cvs/debian-boot/boot-floppies/utilities/dbootstrap/main.c,v
retrieving revision 1.146
diff -u -3 -p -u -r1.146 main.c
--- main.c	2002/03/06 15:28:18	1.146
+++ main.c	2002/03/07 14:05:30
@@ -37,6 +37,7 @@ char drivers_path[PATH_MAX + 1];
 char *base_cd;
 char *kernel_cd;
 int wants_cd;
+int wants_locale;
 
 /* Defaults to no serial console present */
 int serialConsole = -1;
@@ -765,6 +766,7 @@ int main (void) {
     base_cd=NULL;
     kernel_cd=NULL;
     wants_cd=0;
+    wants_locale=0;
 
     /* setup rescue & drivers disks images filenames
      * (should be done before the first call to stderrToTTY) */
Index: extract_base.c
===================================================================
RCS file: /cvs/debian-boot/boot-floppies/utilities/dbootstrap/extract_base.c,v
retrieving revision 1.73
diff -u -3 -p -u -r1.73 extract_base.c
--- extract_base.c	2002/03/05 19:18:01	1.73
+++ extract_base.c	2002/03/07 14:05:30
@@ -249,12 +249,23 @@ exec_debootstrap(char **argv){
 int 
 debootstrap_extract_base (void) {
   int rs=0;
-  char *argv[8];
+  char *argv[9];
   struct stat statbuf;
   char *source;
   char filename [512];
+  char *locales = NULL;
   int status;
 
+#ifdef USE_LANGUAGE_CHOOSER
+  /* Hm, is this is the wrong question?  The question should parhaps
+     be if the second phase of the installation should use the same
+     language as the first phase.  If the answer is yes, then
+     'locales' needs to be installed.
+  */
+  if (yesNoBox(_("You are installing with a localised version of Debian's boot-floppies. Would you like to keep the current locale (language and format settings) as the main system locale after the system has been installed?"), _("Localisations")) == DLG_YES)
+      wants_locale=1;
+#endif
+
   /* Sanity Check */
   if (NAME_ISREG ("/target/etc/debian_version", &statbuf)) {
     if (yesNoBox(_("It looks like either you have already installed the base system once or there is a Debian system installed already. This installer routine is not intended to overwrite an existing system. It's safer to start from scratch, i.e. umount the partition, create a new filesystem upon it and come back to this step.  Installing the base system over an existing system will cause existing data to be overwritten. Do you want to continue?"), _("Warning")) == DLG_NO)
@@ -268,6 +279,12 @@ debootstrap_extract_base (void) {
 
   disqtype=debootstrap;
   if ( choose_medium() ) return 1;
+
+#if defined(USE_LANGUAGE_CHOOSER)
+  if (wants_locale)
+      /* Needed to get locale data */
+      locales = "--include=locales";
+#endif
   
   DEBUGMSG("Extracting base, Archive_Dir: %s", Archive_Dir);
   if (!strcmp (Archive_Dir, "netfetch"))
@@ -335,10 +352,12 @@ debootstrap_extract_base (void) {
   argv[4] = "woody";
   argv[5] = "/target";
   argv[6] = source;
-  argv[7] = NULL;
+  argv[7] = locales;
+  argv[8] = NULL;
   
-  INFOMSG("running '%s %s %s %s %s %s %s'",
-          argv[0], argv[1], argv[2], argv[3], argv[4], argv[5], argv[6]);
+  INFOMSG("running '%s %s %s %s %s %s %s %s'",
+          argv[0], argv[1], argv[2], argv[3], argv[4], argv[5], argv[6],
+          argv[7] ? argv[7] : "(null)" );
 
   rs = exec_debootstrap(argv);
 
Index: util.c
===================================================================
RCS file: /cvs/debian-boot/boot-floppies/utilities/dbootstrap/util.c,v
retrieving revision 1.79
diff -u -3 -p -u -r1.79 util.c
--- util.c	2002/03/07 13:42:17	1.79
+++ util.c	2002/03/07 14:05:30
@@ -706,6 +706,14 @@ check_pending_config(void)
 
     /* Specify priority list of translations to use when displaying messages */
     write_userconfig("LANGUAGE_INST", lang->msgcat);
+
+    /* one of two (not sure how it should be used):
+        - should the seconds stage installer use the same langauge as
+          the first stage?
+	- should the default locale for all users be the locale used
+          during installation.
+    */
+    write_userconfig("USE_LOCALE", wants_locale ? "true" : "");
   }
 #endif
 



Reply to: