Bug 1169027 - missing %lang info for LC_TIME locale subdirs
Summary: missing %lang info for LC_TIME locale subdirs
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: coreutils
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Ondrej Vasik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-29 05:06 UTC by (GalaxyMaster)
Modified: 2015-05-30 15:37 UTC (History)
7 users (show)

Fixed In Version: coreutils-8.21-22.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-12-01 11:01:06 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description (GalaxyMaster) 2014-11-29 05:06:18 UTC
Description of problem:

The filesystem package owns /usr/share/locale/<lang>/LC_MESSAGES, but it should also own /usr/share/locale/<lang>/LC_TIME .  Moreover, some packages (e.g. coreutils) own /usr/share/locale/<lang>/LC_TIME (which is a bug by itself), yet they do not provide the corresponding %lang tag for these directories.  I think the latter is a bug related to the %find_lang macro.

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

The following packages are known to have the related bugs

filesystem - should define the LC_TIME directories the very same way as it does for LC_MESSAGES
coreutils - should not own LC_TIME directories themselves

Steps to Reproduce:

[root@localhost ~]# rpm -ql --queryformat '[%{FILELANGS}\t%{FILENAMES}\n]' coreutils | grep LC_TIME | head -5
	/usr/share/locale/af/LC_TIME
af	/usr/share/locale/af/LC_TIME/coreutils.mo
	/usr/share/locale/be/LC_TIME
be	/usr/share/locale/be/LC_TIME/coreutils.mo
	/usr/share/locale/bg/LC_TIME
[root@localhost ~]# rpm -qf /usr/share/locale/af
filesystem-3.2-18.el7.x86_64
[root@localhost ~]# rpm -qf /usr/share/locale/af/LC_MESSAGES
filesystem-3.2-18.el7.x86_64
[root@localhost ~]# rpm -qf /usr/share/locale/af/LC_TIME
coreutils-8.22-11.el7.x86_64
[root@localhost ~]#

Comment 1 Ondrej Vasik 2014-11-30 08:40:27 UTC
Thanks for report, but I disagree with some portions.
There is a difference between <lang>/LC_MESSAGES and <lang>/LC_TIME . Looking on my installation:
1)ls /usr/share/locale/*/LC_TIME/* | grep -cv coreutils
0
IOW: LC_TIME subdir is used just by coreutils, it is not used by other packages. Therefore filesystem ownership doesn't make sense here. I'm not really sure how many other packages use LC_TIME subdir. Can you please explain in more details? Unless 
2)ls /usr/share/locale/*/LC_MESSAGES/* | grep -cv coreutils
11889
IOW: MANY packages use LC_MESSAGES subdirs, therefore it is owned by filesystem.

Package coreutils owns both dir and file /usr/share/locale/*/LC_TIME* - so it follows packaging guidelines there.
You are right with one small detail - lang specific ownership for the subdir is missing - as find_lang macro probably intentionally skips directories there.

Coreutils use coreutils.lang file - which contains correct lang-ed ownerships for the files, but not for the dirs. This could probably be solved by adjusting the coreutils.lang file (and removing the %dir ownership from the files section).
Adjusting the summary according to what I plan to adjust, feel free to comment on your original description.

Comment 2 Ondrej Vasik 2014-11-30 08:42:19 UTC
btw. filesystem package doesn't use lang specific ownerships for the LC_MESSAGES directories, so I'm not really sure I should change even this detail.

Comment 3 Ondrej Vasik 2014-11-30 08:43:59 UTC
hmmms, it has, but only for some of the directories... still, doable on for LC_TIME subdirs.

Comment 4 (GalaxyMaster) 2014-11-30 11:42:20 UTC
Well, /usr/share/locale/*/LC_TIME is used not only by coreutils.  For example dc3dd and abook projects are using /usr/share/locale/*/LC_TIME directories.  There are quite a few packages that use other LC_* subdirectories under /usr/share/locale/*/ .  However, I'd agree that the number of such packages is small.

Anyway, what's so special about LC_MESSAGES in comparison to all other LC_* (LC_TIME, LC_COLLATE, etc.)?

According to the section 10.4 Locales in The Linux Programming Interface book by Michael Kerrisk
(http://books.google.com.au/books?id=2SAQAQAAQBAJ&pg=PA201&lpg=PA201&dq=directories+under+/usr/share/locale&source=bl&ots=qQq48bEyuu&sig=4HVvkMm-cscoHZzzftTx57wlDMo&hl=en&sa=X&ei=4_96VJLIIYjk8AWdwIKIBQ&ved=0CCkQ6AEwAg#v=onepage&q=directories%20under%20%2Fusr%2Fshare%2Flocale&f=false) the /usr/share/locale/*/ directories can contain the following files/directories:

LC_CTYPE
LC_COLLATE
LC_MONETARY
LC_NUMERIC
LC_TIME
LC_MESSAGES

However, truth to be told I have only seen LC_COLLATE and LC_TIME used in the wild.

Comment 5 (GalaxyMaster) 2014-11-30 12:02:29 UTC
Ondrej,

Just to confirm that LC_TIME is a system-wide directory, here is a test:

[root@localhost ~]# LC_TIME=ru_RU strace -fF -eopen tar --help >/dev/null
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libacl.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libselinux.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libattr.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libpcre.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/liblzma.so.5", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/locale/ru_RU/LC_TIME", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/locale/ru/LC_TIME", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/proc/meminfo", O_RDONLY|O_CLOEXEC) = 3
+++ exited with 0 +++
[root@localhost ~]#

It shows that if I run GNU tar with LC_TIME set to ru_RU tar will lookup /usr/share/locale/*/LC_TIME .  Unfortunately, the documentation on gettext is too sparse in this respect and I'm not sure whether the LC_TIME directory allowed or not (the mentioned book states that it should be a file), but I also found an interesting arbitration on gettext for the OpenCSW project (http://wiki.opencsw.org/arbitration-gettext) where they are discussing a topic involving the LC_TIME directory.

Comment 6 Ondrej Vasik 2014-11-30 12:07:10 UTC
LC_MESSAGES are used for any localized message translation - therefore they were always part of the filesystem package. By its definition it owns the directories frequently owned by other packages.
So the difference between LC_MESSAGES and other LC_* is that others are much less frequently used. I agree these can exist on the system, I just find the inode burden of all LC_* subdirs created by default by filesystem package too big. That's why I prefer to have this dirs owned by packages that actually use them.
Just ghosted ownership of the subdirs in filesystem package would be possible, however in my opinion it would bring nothing to the system sanity - even now, filelist of filesystem package has more than 14k entries, with all LC_* vars for all 700 locales it would mean additional 8k+ entries (actually, LSB-Core specification defines even more LC_* variables than those listed in your ebook - see http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic.pdf - and all these can have files under /usr/share/locale/*/LC_*/ ).

Comment 7 (GalaxyMaster) 2014-11-30 12:17:47 UTC
Well, to be honest my goal there was to ensure that my "%_install_langs en_AU" RPM macro is respected when I install packages.  The coreutils (and few other packages) are polluting our systems with either empty directories (in this case all these */LC_TIME ones) or mislabeled language files (not the case with coreutils).  So if it means that you can fix it locally in the coreutils spec, I'm all for it :).  I really understand your concern re: the ever growing file list for the filesystem package and I respect that.  Still, there is something that should be done re: the issue since it's clearly a bug, although a minor one.

Comment 8 (GalaxyMaster) 2014-11-30 12:24:19 UTC
Also, I've just checked LSB 4.1.0 (thanks for the direct link, BTW) and there the list of LC_* catalogs (NOTE: there is a difference between catalogs and variables, not every  LC_* variable has its catalog) is exactly the same as I quoted from the book (search LSB for dcgettext (or for LC_TIME inside that section)).  JFYI.

Comment 9 Ondrej Vasik 2014-11-30 14:07:10 UTC
Ok, I do plan to fix the %lang macros for the subdirs... for the filesystem ownership - you may raise the question whether we want all LC_ catalogs for at least some basic locales owned and created by filesystem package - either to Fedora Packaging Comittee or on Fedora devel list.

Comment 10 Ondrej Vasik 2014-12-01 11:01:06 UTC
The minor coreutils issue should be fixed by http://pkgs.fedoraproject.org/cgit/coreutils.git/commit/?id=ac62214984ad6b83898e8db0ae5bdbd6cdc327cd ... closing RAWHIDE.

Comment 11 Fedora Update System 2015-05-14 13:29:50 UTC
coreutils-8.22-22.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/coreutils-8.22-22.fc21

Comment 12 Fedora Update System 2015-05-14 18:51:47 UTC
coreutils-8.21-22.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/coreutils-8.21-22.fc20

Comment 13 Fedora Update System 2015-05-19 16:18:09 UTC
coreutils-8.22-22.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2015-05-30 15:37:23 UTC
coreutils-8.21-22.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.