This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] A couple of localedef fixes


Hi!

make install-locales currently gives a bunch of errors and warnings, e.g.
a couple of:
LC_MONETARY: value of field `int_curr_symbol' does not correspond to a valid name in ISO 4217
circular dependencies between locale definitions
cannot add already read locale `sr_YU' a second time
./locales/fi_FI:82: `CAPITAL' already defined as collating symbol
(actually there were tons of similar warnings when processing sv_FI)
charmaps/BIG5-HKSCS:18312: unknown character `U0000E000'

The following patch should fix all but ISO 4217 warnings for ar_SD, es_EC,
sr_YU and sr_YU@cyrillic (for those I really don't know whether ISO 4217
file should be changed or the locales, or just live with warnings:
google search reveals Sudan seems to either use SDP (Sudanesse Pound)
or SDD (Sudanesse Dinar), Ecuador either uses USD or ECS (Ecuador Sucre)
and Yugoslavian New Dinar is sometimes abbreviated as YUM and sometimes
as YUN).

The circular errors were triggered even when no circle was present
(first hunk, I've tested that a real loop is detected just fine),
there was a bug in linereader which if LC_CTYPE was not above some
category needing transliteration (e.g. LC_MONETARY), it wouldn't actually
read LC_CTYPE and thus no transliteration would happen, locfile read both
needed and not avail categories and unneeded but available ones (while
only the first set is needed - this is what cured all the sv_FI warnings),
BIG5-HKSCS defined WIDTH for <UE000>..something, but it actually does not
define <UE000> character, earliest is <UE003> and charmaps.c (new_width)
both ends of the range to be valid characters.

Plus there is a message printed when enlarging archive even when quiet
is requested (maybe the message should be just commented out, dunno).

I've tested this on the full set of our locales and the only differences
between what localedef without this patch and localedef with this patch
created were for the problematic locales (actually, sv_FI locale was
identical too, just the warnings went away).

2002-08-15  Jakub Jelinek  <jakub@redhat.com>

	* locale/programs/localedef.c (add_to_readlist): Error about
	circular dependencies only if the locale in question hasn't
	been finished.
	* locale/programs/linereader.c (get_string): Pass LC_CTYPE not
	CTYPE_LOCALE to load_locale.
	* locale/programs/locfile.c (locfile_read): Don't include
	unneeded but available locales in locale_mask.

	* locale/programs/locarchive.c (enlarge_archive): If quiet, don't
	print any messages about enlarging archive.

localedata/
	* charmaps/BIG5-HKSCS (WIDTH): Change <UE000> to <UE003> at start of
	range.

--- libc/locale/programs/localedef.c.jj	Tue Aug 13 02:01:51 2002
+++ libc/locale/programs/localedef.c	Thu Aug 15 06:58:13 2002
@@ -561,7 +561,9 @@ add_to_readlist (int locale, const char 
 	}
     }
 
-  if (generate && (runp->needed & (1 << locale)) != 0)
+  if (generate
+      && (runp->needed & (1 << locale)) != 0
+      && (runp->avail & (1 << locale)) == 0)
     WITH_CUR_LOCALE (error (5, 0, _("\
 circular dependencies between locale definitions")));
 
--- libc/locale/programs/linereader.c.jj	Fri Feb  8 05:39:02 2002
+++ libc/locale/programs/linereader.c	Thu Aug 15 06:59:06 2002
@@ -735,7 +735,7 @@ non-symbolic character value should not 
 				  int old_needed = locale->needed;
 
 				  locale->needed = 0;
-				  locale = load_locale (CTYPE_LOCALE,
+				  locale = load_locale (LC_CTYPE,
 							locale->name,
 							locale->repertoire_name,
 							charmap, locale);
--- libc/locale/programs/locfile.c.jj	Mon May 20 18:02:27 2002
+++ libc/locale/programs/locfile.c	Thu Aug 15 08:07:47 2002
@@ -47,7 +47,7 @@ locfile_read (struct localedef_t *result
 {
   const char *filename = result->name;
   const char *repertoire_name = result->repertoire_name;
-  int locale_mask = result->needed ^ result->avail;
+  int locale_mask = result->needed & ~result->avail;
   struct linereader *ldfile;
   int not_here = ALL_LOCALES;
 
--- libc/locale/programs/locarchive.c.jj	Wed Aug 14 05:38:29 2002
+++ libc/locale/programs/locarchive.c	Wed Aug 14 07:27:36 2002
@@ -253,8 +253,9 @@ enlarge_archive (struct locarhandle *ah,
      should be double from what is currently used.  */
   newhead.namehash_size = MAX (next_prime (2 * newhead.namehash_used),
 			       newhead.namehash_size);
-  printf ("name: size: %u, used: %d, new: size: %u\n",
-	  head->namehash_size, head->namehash_used, newhead.namehash_size);
+  if (! be_quiet)
+    printf ("name: size: %u, used: %d, new: size: %u\n",
+	    head->namehash_size, head->namehash_used, newhead.namehash_size);
 
   newhead.string_offset = (newhead.namehash_offset
 			   + (newhead.namehash_size
--- libc/localedata/charmaps/BIG5-HKSCS.jj	Fri May 10 05:56:21 2002
+++ libc/localedata/charmaps/BIG5-HKSCS	Thu Aug 15 09:06:17 2002
@@ -18309,5 +18309,5 @@ WIDTH
 <U30FD>...<U30F6> 2
 <UF7E5>...<U2EE3> 2
 <U7881>...<U256F> 2
-<UE000>...<U79D4> 2
+<UE003>...<U79D4> 2
 END WIDTH

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]