Hi,

I think I could make the modifications we wrote about
yesterday. I have tested with:
lang=fr_FR.UTF-8 full-locale=n
-> locale -a lists only the minimal set, including
fr_FR.UTF-8
lang=POSIX full-locale=n
-> locale -a lists only the minimal set
lang=en_GB.UTF-8 full-locale=n
->  locale -a lists the minimal set + en_GB.UTF-8
lang=en_GB.utf8 full-locale=n
->  locale -a lists the minimal set
lang={fr_FR.UTF-8,POSIX,en_GB} full-locale=n
-> locale -a lists the whole set (and glibc build is 1 mn longer)

My main concern is that I have to rely on LANG being a
canonical name (i.e. as in the SUPPORTED file). Right
now, I just ignore it, if it is not found in that file.
And actually, I do not know what else to do.
BTW (maybe more appropriate to the LFS list),
mentioning the `SUPPORTED' file would be of
some help for beginners (like me a few
years ago) scratching their heads in front
of the "7.13 The bash shell startup files" sections on
canonical names.

Furthermore, the attached patch :
- adds `check' to the list of packages which are not
  built when testsuite=0 (same behavior as presently
  for tcl expect and dejagnu)
- corrects a typo (fylesystem)
- suppresses the warnings when compiling conf and mconf
  (try "make clean ; make" before and after applying the patch)
  Not a big deal of course, but annoying.

Regards
Pierre

Index: LFS/master.sh
===================================================================
--- LFS/master.sh	(révision 3544)
+++ LFS/master.sh	(copie de travail)
@@ -77,12 +77,14 @@
     # Keep the script file name
     this_script=`basename $file`
 
-    # If no testsuites will be run, then TCL, Expect and DejaGNU aren't needed
+    # If no testsuites are run, then TCL, Expect, DejaGNU and check
+    # aren't needed.
     # Fix also locales creation when running chapter05 testsuites (ugly)
     case "${this_script}" in
       *tcl)       [[ "${TEST}" = "0" ]] && continue ;;
       *expect)    [[ "${TEST}" = "0" ]] && continue ;;
       *dejagnu)   [[ "${TEST}" = "0" ]] && continue ;;
+      *check)     [[ "${TEST}" = "0" ]] && continue ;;
       *stripping) [[ "${STRIP}" = "n" ]] && continue ;;
       *glibc)     [[ "${TEST}" = "3" ]] && \
                   sed -i 's@/usr/lib/locale@/tools/lib/locale@' $file ;;
Index: LFS/lfs.xsl
===================================================================
--- LFS/lfs.xsl	(révision 3544)
+++ LFS/lfs.xsl	(copie de travail)
@@ -40,6 +40,9 @@
   <!-- Locale settings -->
   <xsl:param name="lang" select="C"/>
   
+  <!-- Install the whole set of locales -->
+  <xsl:param name='full-locale' select='n'/>
+
   <xsl:template match="/">
     <xsl:apply-templates select="//sect1"/>
   </xsl:template>
@@ -180,8 +183,28 @@
         <xsl:text>&#xA;</xsl:text>
       </xsl:if>
       <xsl:if test="@id='ch-system-glibc'">
-	<xsl:copy-of select="//userinput[@remap='locale-full']"/>
-	<xsl:text>&#xA;</xsl:text>
+        <xsl:choose>
+          <xsl:when test="$full-locale='y'">
+            <xsl:copy-of select="//userinput[@remap='locale-full']"/>
+            <xsl:text>&#xA;</xsl:text>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:copy-of select="//userinput[@remap='locale-test']"/>
+            <xsl:text>&#xA;</xsl:text>
+            <xsl:if test="not(contains(string(//userinput[@remap='locale-test']),$lang)) and $lang!='C' and $lang!='POSIX'">
+              <xsl:text>LOCALE=`grep "</xsl:text>
+              <xsl:value-of select="$lang"/>
+              <xsl:text>/" $PKGDIR/localedata/SUPPORTED`
+if ! [ -z "$LOCALE" ]; then
+  CHARMAP=`echo $LOCALE | sed 's,[^/]*/\([^ ]*\) [\],\1,'`
+  INPUT=`echo $LOCALE | sed 's,[/.].*,,'`
+  LOCALE=`echo $LOCALE | sed 's,/.*,,'`
+  localedef -i $INPUT -f $CHARMAP $LOCALE
+fi
+</xsl:text>
+            </xsl:if>
+          </xsl:otherwise>
+        </xsl:choose>
       </xsl:if>
       <xsl:apply-templates
          select=".//screen[
Index: common/libs/func_book_parser
===================================================================
--- common/libs/func_book_parser	(révision 3544)
+++ common/libs/func_book_parser	(copie de travail)
@@ -141,6 +141,7 @@
                  --stringparam testsuite $TEST \
                  --stringparam bomb-testsuite $BOMB_TEST \
                  --stringparam vim-lang $VIMLANG \
+                 --stringparam full-locale $FULL_LOCALE \
                  --stringparam timezone $TIMEZONE \
                  --stringparam page $PAGE \
                  --stringparam lang $LANG \
Index: common/libs/func_validate_configs.sh
===================================================================
--- common/libs/func_validate_configs.sh	(révision 3544)
+++ common/libs/func_validate_configs.sh	(copie de travail)
@@ -41,7 +41,7 @@
   local -r CLFS3_book="$BOOK_common                  $BOOK_clfsX PLATFORM MIPS_LEVEL"
 
   # Build Settings by book
-  local -r   LFS_build="$BUILD_chroot VIMLANG $BUILD_common PKGMNGT"
+  local -r   LFS_build="$BUILD_chroot VIMLANG $BUILD_common PKGMNGT FULL_LOCALE"
   local -r  HLFS_build="$BUILD_chroot         $BUILD_common"
   local -r  CLFS_build="$BUILD_chroot VIMLANG $BUILD_common"
   local -r CLFS2_build="STRIP         VIMLANG $BUILD_common"
Index: common/common-functions
===================================================================
--- common/common-functions	(révision 3544)
+++ common/common-functions	(copie de travail)
@@ -54,7 +54,7 @@
       exit 1
     # Test that dev filesystems are not mounted in $BUILDDIR
     elif mount | grep $BUILDDIR/dev > /dev/null ; then
-      echo "Looks like kernel fylesystems are yet mounted on $BUILDDIR."
+      echo "Looks like kernel filesystems are yet mounted on $BUILDDIR."
       exit 1
     else
       # Clean the build directory
@@ -106,4 +106,4 @@
 [[ $? > 0 ]] && echo "file libs/func_blfs_deps did not load.." && exit 1
 [[ $VERBOSITY2 > 0 ]] && echo "OK"
 
-[[ $VERBOSITY2 > 0 ]] && echo -n "    ..."
\ No newline at end of file
+[[ $VERBOSITY2 > 0 ]] && echo -n "    ..."
Index: menu/lxdialog/dialog.h
===================================================================
--- menu/lxdialog/dialog.h	(révision 3544)
+++ menu/lxdialog/dialog.h	(copie de travail)
@@ -174,7 +174,7 @@
 int dialog_checklist (const char *title, const char *prompt, int height,
 		int width, int list_height, int item_no,
 		struct dialog_list_item ** items, int flag);
-extern unsigned char dialog_input_result[];
+extern char dialog_input_result[];
 int dialog_inputbox (const char *title, const char *prompt, int height,
 		int width, const char *init);
 
Index: menu/lxdialog/inputbox.c
===================================================================
--- menu/lxdialog/inputbox.c	(révision 3544)
+++ menu/lxdialog/inputbox.c	(copie de travail)
@@ -21,7 +21,7 @@
 
 #include "dialog.h"
 
-unsigned char dialog_input_result[MAX_LEN + 1];
+char dialog_input_result[MAX_LEN + 1];
 
 /*
  *  Print the termination buttons
@@ -48,7 +48,7 @@
 {
     int i, x, y, box_y, box_x, box_width;
     int input_x = 0, scroll = 0, key = 0, button = -1;
-    unsigned char *instr = dialog_input_result;
+    char *instr = dialog_input_result;
     WINDOW *dialog;
 
     /* center dialog box on screen */
Index: menu/lxdialog/textbox.c
===================================================================
--- menu/lxdialog/textbox.c	(révision 3544)
+++ menu/lxdialog/textbox.c	(copie de travail)
@@ -39,11 +39,8 @@
 {
     int i, x, y, cur_x, cur_y, fpos, key = 0;
     int passed_end;
-    char search_term[MAX_LEN + 1];
     WINDOW *dialog, *text;
 
-    search_term[0] = '\0';	/* no search term entered yet */
-
     /* Open input file for reading */
     if ((fd = open (file, O_RDONLY)) == -1) {
 	endwin ();
@@ -459,7 +456,6 @@
 static void
 print_line (WINDOW * win, int row, int width)
 {
-    int y, x;
     char *line;
 
     line = get_line ();
@@ -468,10 +464,11 @@
     waddch (win, ' ');
     waddnstr (win, line, MIN (strlen (line), width - 2));
 
-    getyx (win, y, x);
     /* Clear 'residue' of previous line */
 #if OLD_NCURSES
     {
+        int y, x;
+        getyx (win, y, x);
 	int i;
 	for (i = 0; i < width - x; i++)
 	    waddch (win, ' ');
Index: menu/lex.zconf.c_shipped
===================================================================
--- menu/lex.zconf.c_shipped	(révision 3544)
+++ menu/lex.zconf.c_shipped	(copie de travail)
@@ -3,6 +3,10 @@
 
 #define  YY_INT_ALIGNED short int
 
+/* Define this to avoid warnings when compiling
+   P. Labastie 2012/02/08*/
+#define YY_NO_INPUT 1
+
 /* A lexical scanner generated by flex */
 
 #define FLEX_SCANNER
Index: menu/conf.c
===================================================================
--- menu/conf.c	(révision 3544)
+++ menu/conf.c	(copie de travail)
@@ -179,7 +179,7 @@
 				help = nohelp_text;
 				if (menu->sym->help)
 					help = menu->sym->help;
-				printf("\n%s\n", menu->sym->help);
+				printf("\n%s\n", help);
 				def = NULL;
 				break;
 			}
@@ -195,7 +195,6 @@
 static int conf_sym(struct menu *menu)
 {
 	struct symbol *sym = menu->sym;
-	int type;
 	tristate oldval, newval;
 	const char *help;
 
@@ -203,7 +202,7 @@
 		printf("%*s%s ", indent - 1, "", menu->prompt->text);
 		if (sym->name)
 			printf("(%s) ", sym->name);
-		type = sym_get_type(sym);
+		(void)sym_get_type(sym);
 		putchar('[');
 		oldval = sym_get_tristate_value(sym);
 		switch (oldval) {
@@ -270,11 +269,10 @@
 {
 	struct symbol *sym, *def_sym;
 	struct menu *child;
-	int type;
 	bool is_new;
 
 	sym = menu->sym;
-	type = sym_get_type(sym);
+	(void)sym_get_type(sym);
 	is_new = !sym_has_value(sym);
 	if (sym_is_changable(sym)) {
 		conf_sym(menu);
Index: jhalfs
===================================================================
--- jhalfs	(révision 3544)
+++ jhalfs	(copie de travail)
@@ -107,6 +107,7 @@
 STRIP=${STRIP:=n}
 REPORT=${REPORT:=n}
 VIMLANG=${VIMLANG:-n}
+FULL_LOCALE=${FULL_LOCALE:-n}
 GRSECURITY_HOST=${GRSECURITY_HOST:-n}
 CUSTOM_TOOLS=${CUSTOM_TOOLS:-n}
 REBUILD_MAKEFILE=${REBUILD_MAKEFILE:-n}
Index: Config.in
===================================================================
--- Config.in	(révision 3544)
+++ Config.in	(copie de travail)
@@ -980,7 +980,19 @@
 		string "Language"
 		default "$LANG"
 		help
-			#-- Language information in /etc/profile  See <locale -a> for values
+			#-- LANG variable set in /etc/profile
+			#   See http://sourceware.org/git/?p=glibc.git;a=blob;f=localedata/SUPPORTED
+			#   for values (or the file localedata/SUPPORTED in glibc tarball)
+	# Added 2012/02/07 Pierre
+	config	FULL_LOCALE
+		bool "Install the full set of locales"    
+		default n
+		help
+			#-- If set to y, the full set of supported locales
+			#   will be installed. Otherwise, only the minimal set
+			#   necessary for the tests will be installed,
+			#   together with the locale associated to the
+			#   LANG you have chosen, if not in the minimal set.
 
 	#--- Groff page
 	choice
-- 
http://linuxfromscratch.org/mailman/listinfo/alfs-discuss
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to