From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5564 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Locale bikeshed time Date: Tue, 22 Jul 2014 16:35:40 -0400 Message-ID: <20140722203540.GA11570@brightrain.aerifal.cx> References: <20140722184932.GA4914@brightrain.aerifal.cx> <20140722201008.GC16795@example.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1406061363 16017 80.91.229.3 (22 Jul 2014 20:36:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 22 Jul 2014 20:36:03 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-5569-gllmg-musl=m.gmane.org@lists.openwall.com Tue Jul 22 22:35:55 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1X9gmu-0002N4-Ux for gllmg-musl@plane.gmane.org; Tue, 22 Jul 2014 22:35:53 +0200 Original-Received: (qmail 14123 invoked by uid 550); 22 Jul 2014 20:35:52 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 14113 invoked from network); 22 Jul 2014 20:35:52 -0000 Content-Disposition: inline In-Reply-To: <20140722201008.GC16795@example.net> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:5564 Archived-At: On Tue, Jul 22, 2014 at 10:10:08PM +0200, u-igbb@aetey.se wrote: > A musl-specific variable name would be a better/cleaner choice. One question is whether this is really musl-specific or specific to a locale scheme that could be used outside of musl too. However, either way it's probably appropriate for the variable to be musl-specific. Having one variable configure multiple things is usually error-prone and inflexible. > > The second issue is how locale categories are split up. Glibc has each > > category in a separate file, except for the "locale-archive" file > > which stores everything in one file for easy mapping. My leaning so > > By the way, please do not follow the way of a single big file. > For systems which rely on file boundaries to reflect data clustering > (i.e. which data is most probable to be used together) it is very useful > to let the files correspond to the data structure. Otherwise some cheap > and efficient distributed data access optimizations become impossible. I hadn't even considered this aspect, but I think the whole concept of a single big file is undesirable with data that's naturally subject to change over time, and where the data comes from multiple sources. So I wasn't really considering that option anyway. > > far is to put the whole locale -- time format and translations, > > message translations, ... in a single file. This avoids the need for > > multiple mappings (and syscall overhead, and vma overhead, ...) if > > you're using the same value for all categories. But on the other hand, > > if you wanted to have lots of subtle variants of a locale, you might > > end up with largely-duplicate files on disk. Fortunately I think > > they'll all be very small anyway so this may not matter. > > I actually do mix categories from different locales. > No problem as long as the files are small. Note that if you're just mixing "ll_TT" and "C", there wouldn't be any cost anyway since the C locale (and its aliases) are builtin and never loaded from a file. Where I was thinking you might see duplication is for things like: LC_ALL=ll_TT@modifier where modifier is really just an alternate for one category (e.g. ISO date format for time, alt collation order, etc.), but the file ends up storing duplicates of all the data from other categories. However, I think the alternate preferred usage here would be to provide a file for just the category being overridden that does not contain the base data and require users to set the individual categories, like what you're doing, e.g. LANG=ll_TT LC_TIME=ll_TT@isodate rather than: LC_ALL=ll_TT@isodate Rich