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

localising base-config - end game



A while ago, you discussed on debian-boot about better boot-floppies and
base-config localisation. I did the same thing, but due to lack of time
and more important tasks, this was not possible. 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
 - the configuration and locales generation is done by base-config in
   the beginning
 - I am still not sure whether the user should be forced to reconfigure
   debconf and locales

(*) BFs can install additional packages when isntalling from CD or from
net. There should still be one hook to disable wants_locale if we are
isntalling from prepared basedebs.tar.

Gruss/Regards,
Eduard.
-- 
My growing impression of C++, object-oriented programming, etc., is that
it attempts to allow programmers to conveniently reuse their mistakes.
                                                        -- Stephen Uitti
diff -Nurd base-config-1.33.13.original/debian/changelog base-config-1.33.14/debian/changelog
--- base-config-1.33.13.original/debian/changelog	Wed Feb 20 21:58:07 2002
+++ base-config-1.33.14/debian/changelog	Wed Mar  6 19:49:45 2002
@@ -1,3 +1,9 @@
+base-config (1.33.14) unstable; urgency=low
+
+  * local hacked version with localisation
+
+ -- Eduard Bloch <blade@debian.org>  Wed,  6 Mar 2002 19:49:35 +0100
+
 base-config (1.33.13) unstable; urgency=medium
   
   * Changed last tzsetup question to allow allow backing up. This
diff -Nurd base-config-1.33.13.original/lib/00dbootstrap_settings base-config-1.33.14/lib/00dbootstrap_settings
--- base-config-1.33.13.original/lib/00dbootstrap_settings	Mon Nov 19 19:41:06 2001
+++ base-config-1.33.14/lib/00dbootstrap_settings	Wed Mar  6 20:06:31 2002
@@ -6,6 +6,23 @@
 if [ -e /root/dbootstrap_settings ]; then
 	. /root/dbootstrap_settings || true
 
+  if [ "$USE_LOCALE" ]; then
+     # get xx_XX@euro from the mixed string and extract the charset
+     export LANG=`echo $INST_LOCALE | sed 's/\..*@/@/'`
+     CHARSET=`echo $INST_LOCALE | sed 's/.*\.//' | sed 's/@.*//' | sed 's/ISO8/ISO-8/' `
+     echo "$LANG $CHARSET" >> /etc/locale.gen
+     db_set locales/locales "$LANG $CHARSET"
+     db_set locales/default_environment_locale "$LANG"
+     # from /var/lib/dpkg/info/locales.postinst
+     umask 022
+     grep -v '^LANG=' /etc/environment > /etc/environment.tmp 2> /dev/null || true
+     echo "LANG=$LANG" >> /etc/environment.tmp
+     cat /etc/environment.tmp > /etc/environment
+     rm -f /etc/environment.tmp
+     echo Creating the system locale, please wait...
+     /usr/sbin/locale-gen
+  fi
+
 	# Take whatever verbosity level was used in boot floppies, and use
 	# it, unless DEBIAN_PRIORITY is set (which overrides that..)
 	if [ -z "$DEBIAN_PRIORITY" ]; then
Index: utilities/dbootstrap/dbootstrap.h
===================================================================
RCS file: /cvs/debian-boot/boot-floppies/utilities/dbootstrap/dbootstrap.h,v
retrieving revision 1.100
diff -u -r1.100 dbootstrap.h
--- utilities/dbootstrap/dbootstrap.h	2002/03/06 12:43:17	1.100
+++ utilities/dbootstrap/dbootstrap.h	2002/03/06 19:05:17
@@ -175,7 +175,7 @@
 struct fdisk_partition *Root;
 int noSwap, notCreatedBootFloppy, notInstalledLILO;
 extern char *kernel_cd, *base_cd;
-extern int wants_cd, probe_mode;
+extern int wants_cd, wants_locale;
 
 static const char * fs_type_tab[];
 
Index: utilities/dbootstrap/extract_base.c
===================================================================
RCS file: /cvs/debian-boot/boot-floppies/utilities/dbootstrap/extract_base.c,v
retrieving revision 1.73
diff -u -r1.73 extract_base.c
--- utilities/dbootstrap/extract_base.c	2002/03/05 19:18:01	1.73
+++ utilities/dbootstrap/extract_base.c	2002/03/06 19:05:18
@@ -255,6 +255,11 @@
   char filename [512];
   int status;
 
+#ifdef USE_LANGUAGE_CHOOSER
+  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)
@@ -329,17 +334,38 @@
       source = strdup(prtbuf);
   }
   argv[0] = "/usr/sbin/debootstrap";
-  argv[1] = "--boot-floppies";
-  argv[2] = "--arch";
-  argv[3] = ARCHNAME;
-  argv[4] = "woody";
-  argv[5] = "/target";
-  argv[6] = source;
-  argv[7] = NULL;
+#ifdef USE_LANGUAGE_CHOOSER
+  if(wants_locale) {
+     argv[1] = "--boot-floppies";
+     argv[2] = "--include=debconf,locales";
+     /* people needing special terminal emulation can still extend the above */
+     argv[2] = "--boot-floppies";
+     argv[3] = "--arch";
+     argv[4] = ARCHNAME;
+     argv[5] = "woody";
+     argv[6] = "/target";
+     argv[7] = source;
+     argv[8] = NULL;
+  }
+  else {
+#endif
+     argv[1] = "--boot-floppies";
+     argv[2] = "--arch";
+     argv[3] = ARCHNAME;
+     argv[4] = "woody";
+     argv[5] = "/target";
+     argv[6] = source;
+     argv[7] = NULL;
+  }
+
+#ifdef USE_LANGUAGE_CHOOSER
+  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]);
   
+#else
   INFOMSG("running '%s %s %s %s %s %s %s'",
           argv[0], argv[1], argv[2], argv[3], argv[4], argv[5], argv[6]);
-
+#endif
   rs = exec_debootstrap(argv);
 
   if (rs) {
Index: utilities/dbootstrap/main.c
===================================================================
RCS file: /cvs/debian-boot/boot-floppies/utilities/dbootstrap/main.c,v
retrieving revision 1.146
diff -u -r1.146 main.c
--- utilities/dbootstrap/main.c	2002/03/06 15:28:18	1.146
+++ utilities/dbootstrap/main.c	2002/03/06 19:05:20
@@ -36,7 +36,7 @@
 char drivers_path[PATH_MAX + 1];
 char *base_cd;
 char *kernel_cd;
-int wants_cd;
+int wants_cd, wants_locale;
 
 /* Defaults to no serial console present */
 int serialConsole = -1;
@@ -765,6 +765,7 @@
     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: utilities/dbootstrap/util.c
===================================================================
RCS file: /cvs/debian-boot/boot-floppies/utilities/dbootstrap/util.c,v
retrieving revision 1.78
diff -u -r1.78 util.c
--- utilities/dbootstrap/util.c	2002/03/06 08:29:59	1.78
+++ utilities/dbootstrap/util.c	2002/03/06 19:05:22
@@ -700,7 +700,8 @@
 
 #ifdef USE_LANGUAGE_CHOOSER
   if ( lang != NULL )
-    write_userconfig("LANG_INST", lang->locale);
+    write_userconfig("INST_LOCALE", lang->locale);
+  write_userconfig("USE_LOCALE", wants_locale);
 #endif
 
 #if #cpu(powerpc)

Attachment: pgpn_v77oLJAO.pgp
Description: PGP signature


Reply to: