Bug 1624528

Summary: glibc: glibc-all-langpacks does not provide libc.mo files
Product: [Fedora] Fedora Reporter: Rafal Luzynski <digitalfreak>
Component: glibcAssignee: DJ Delorie <dj>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 31CC: arjun.is, codonell, dj, fweimer, law, mfabian, petersen, pfrankli, rth, siddhesh
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: glibc-2.30.9000-15.fc32 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-10-25 21:10:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Rafal Luzynski 2018-08-31 23:53:37 UTC
Description of problem:

If I understand correctly, glibc-all-langpacks is meant to provide the same user experience as if all glibc-langpack-* packages were installed. However, it does not because it does not provide /usr/share/locale/*/LC_MESSAGES/libc.mo files which contain translated messages of all command line utilities provided by glibc.


Version-Release number of selected component (if applicable):

I guess this is since glibc-langpacks have been introduced.


How reproducible:

Always.


Steps to Reproduce:

1. Select a locale for which you don't have a glibc-langpack installed (rpm -q glibc-langpack-<language> should say it is not installed, rpm -qa glibc\* should not find it)
2. LC_ALL=<selected_locale> locale --help
3. Install glibc-langpack-<language>
4. LC_ALL=<selected_locale> locale --help


Actual results:

If the proper glibc-langpack-* package is not installed then "locale --help" always displays an English text even if the program is correctly localized and glibc-all-langpacks is installed. Installing the proper glibc-langpack-* fixes the problem.


Expected results:

Display the localized text if a program is translated and if glibc-all-langpacks is installed (that means, glibc-all-langpacks should provide libc.mo files for all languages).


Additional info:

The locale command line utility is provides as an example only. The same problem applies to all command line utilities provided by glibc.

glibc supports about 200 languages but only 34 of them provide any translated messages which land in their proper libc.mo file. This could help estimate the increase of the size of glibc-all-langpacks package.

Maybe glibc-common (which actually provides the command line utilities) is the correct location for the libc.mo files rather than langpacks?

Comment 1 Rafal Luzynski 2018-09-01 11:23:01 UTC
s/command line utility is provides/command line utility is provided/

The total size of all libc.mo files is 4 MB.

Comment 2 Mike FABIAN 2019-01-30 15:14:42 UTC
One could put a file like glibc-langpack-de-2.28-26.fc29.x86_64 into a seperate sub-package
like glibc-translations-de and make both glibc-all-langpacks and glibc-langpack-de require glibc-translations-de.

Comment 3 Jens Petersen 2019-01-31 07:12:29 UTC
Personally for now I would probably just move */libc.mo into glibc-common.

Comment 4 Jens Petersen 2019-01-31 07:13:40 UTC
That's where they still live in RHEL 7 anyway.

Comment 5 Jens Petersen 2019-01-31 07:14:33 UTC
Though they could be duplicated across and glibc-all-langpacks and glibc-langpack-*.

Comment 6 Rafal Luzynski 2019-01-31 10:15:50 UTC
If duplication is technically possible I would support it. As I wrote in comment 1, this would make glibc-all-langpacks grow by 4 MB.

Jens, please note that RHEL 7 uses rather old version of glibc, something like 2.18 IIRC. I'm not sure if it supports langpacks at all.

Comment 7 Mike FABIAN 2019-02-01 10:52:24 UTC
(In reply to Jens Petersen from comment #3)
> Personally for now I would probably just move */libc.mo into glibc-common.

I think that would be also OK, as they are quite small.

But in that case I would put them only in glibc-common and take them out of the langpacks
to avoid duplication.

Comment 8 Mike FABIAN 2019-02-01 11:07:19 UTC
(In reply to Rafal Luzynski from comment #6)
> If duplication is technically possible I would support it. As I wrote in
> comment 1, this would make glibc-all-langpacks grow by 4 MB.

I asked Florian Festi and he told that duplication of files in rpms is technically possible if the files
are really *identical* (identical includes file attributes like permissions, owner, ...)

But one should usually avoid this anyway, one reason to avoid it is that the files
are moved around several times in that case (Not a big problem for small files probably).

But it is possible to do in exceptional cases.

Comment 9 Ben Cotton 2019-08-13 17:04:37 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to '31'.

Comment 10 Ben Cotton 2019-08-13 19:14:09 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to 31.

Comment 12 DJ Delorie 2019-10-15 02:56:23 UTC
Duplicating the *.mo files into glibc-all-langpacks looks as simple as a one-line change.  Moving them into glibc-common means all will get installed if the user only selects a subset of languages.

diff --git a/glibc.spec b/glibc.spec
index 11865a4..28441aa 100644
--- a/glibc.spec
+++ b/glibc.spec
@@ -1975,6 +1975,7 @@ fi
 %files all-langpacks
 %{_prefix}/lib/locale/locale-archive
 %{_prefix}/lib/locale/locale-archive.real
+%{_prefix}/share/locale/*/LC_MESSAGES/libc.mo
 
 %files locale-source
 %dir %{_prefix}/share/i18n/locales

Comment 13 DJ Delorie 2019-10-25 21:10:13 UTC
Pushed to rawhide as glibc-2.30.9000-15.fc32