Opened 6 hours ago

Last modified 4 hours ago

#5669 new enhancement

Glibc duplicate locales installed

Reported by: DJ Lucas Owned by: lfs-book
Priority: normal Milestone: 12.4
Component: Book Version: git
Severity: normal Keywords:
Cc:

Description

In Chapter 8 GLibC, the minimum required locales for the test suites now include C.UTF-8 and ja_JP.SJIS. They are installed a second time below in reference to locales not listed in the localedata/SUPPORTED file. Both are in userinput tags (though both have nodump for jhalfs).

Change History (9)

comment:1 by Xi Ruoyao, 6 hours ago

The instruction for C.UTF-8 and ja_JP.SJIS should only be used if running make localedata/install-locales instead of the minimum required locales for the test suites.

comment:2 by Xi Ruoyao, 6 hours ago

"Alternatively, install all the locales listed in the glibc-2.41/localedata/SUPPORTED file (it includes every locale listed above and many more) at once with the following time-consuming command:"

The emphasized part seems just wrong here. It should be something like "every locale but C.UTF-8 and ja_JP.SJIS."

comment:3 by DJ Lucas, 6 hours ago

Yeah, that's perfectly clear in the source with the remap tags for jhalfs, but not so much in the text. The part you have bolded above is incorrect, but you really don't want to include two clauses in parenthesis either. Maybe:

"Alternatively, install all the locales listed in the localedata/SUPPORTED file with the following command:" ... "Additionally, if you installed all locales instead of the minimum necessary, two additional locales (not included in localedata/SUPPORTED) are needed. Install with the following commands:"

comment:4 by Bruce Dubbs, 5 hours ago

Just throwing in my 2 cents here.

I think the issue is how one reads the text. If someone starts at the top of the page and runs the commands as they read them, the minimal locales are already installed by the time they get to the alternate part.

I think it is the rare user that would want to install all locales, but to make things more clear, perhaps just putting the whole alternate locale install in a <note> would emphasize what needs to be done. I don't think any text needs to be changed.

comment:5 by DJ Lucas, 5 hours ago

You are suggesting to put the full locales install in a note box, correct? I don't remember who wrote that section, but given the presentation, I think part of the point was to emphasize the localedata/SUPPORTED file. That's an important file for packagers. At least the "it includes every locale listed above" part needs to be removed, but otherwise, that works well as long as it doesn't break anything for Pierre.

comment:6 by Bruce Dubbs, 5 hours ago

I just checked the xml and the only locale command that does NOT have role="nodump" is

<screen><userinput remap="locale-full">make localedata/install-locales</userinput></screen>

I do not know what the remap="locale-full" or the earlier remap="locale-test" options do.

Checking jhalfs code, it looks like it's a user option to do the full locale or just the test locales. I don't know if I'm reading the code right, but it looks like in the case of locale-full, the C and ja_JP are not installed.

comment:7 by Xi Ruoyao, 4 hours ago

At least C.UTF-8 is in the localedata/SUPPORTED file, so maybe we should only keep ja_JP here.

comment:8 by Xi Ruoyao, 4 hours ago

We added ja_JP.SJIS to support a bash-5.0 test:

TestCodePage ja_JP.SJIS jp_JP_SHIFT_JIS

But now the bash-5.2.37 test is skipped if the locale is not installed:

if locale -a | grep -i '^ja_JP.SJIS' >/dev/null ; then
    TestCodePage ja_JP.SJIS jp_JP_SHIFT_JIS
else
    echo "unicode1.sub: warning: you do not have the ja_JP.SJIS locale installed;" >&2
    echo "unicode1.sub: that will cause some of these tests to be skipped." >&2 fi
fi

So to me we can just remove ja_JP.SJIS now.

comment:9 by Xi Ruoyao, 4 hours ago

Proposed change:

  • chapter08/glibc.xml

    diff --git a/chapter08/glibc.xml b/chapter08/glibc.xml
    index c803d0c07..a04bc8ac3 100644
    a b localedef -i it_IT -f ISO-8859-1 it_IT  
    393393localedef -i it_IT -f ISO-8859-15 it_IT@euro
    394394localedef -i it_IT -f UTF-8 it_IT.UTF-8
    395395localedef -i ja_JP -f EUC-JP ja_JP
    396 localedef -i ja_JP -f SHIFT_JIS ja_JP.SJIS 2> /dev/null || true
    397396localedef -i ja_JP -f UTF-8 ja_JP.UTF-8
    398397localedef -i nl_NL@euro -f ISO-8859-15 nl_NL@euro
    399398localedef -i ru_RU -f KOI8-R ru_RU.KOI8-R
    localedef -i zh_TW -f UTF-8 zh_TW.UTF-8</userinput></screen>  
    415414
    416415<screen><userinput remap="locale-full">make localedata/install-locales</userinput></screen>
    417416
    418     <para>Then use the <command>localedef</command> command to create and
    419     install locales not listed in the
    420     <filename>glibc-&glibc-version;/localedata/SUPPORTED</filename> file
    421     when you need them. For instance, the following two locales are
    422     needed for some tests later in this chapter:</para>
    423 
    424 <screen role="nodump"><userinput remap="locale-full">localedef -i C -f UTF-8 C.UTF-8
    425 localedef -i ja_JP -f SHIFT_JIS ja_JP.SJIS 2> /dev/null || true</userinput></screen>
    426 
    427417    <note><para>Glibc now uses libidn2 when resolving internationalized
    428418    domain names.  This is a run time dependency.  If this capability
    429419    is needed, the instructions for installing libidn2 are in the
Note: See TracTickets for help on using tickets.