Listing files twice and %lang behavior

Miro Hrončok mhroncok at redhat.com
Wed Nov 25 21:16:38 UTC 2020


Hello RPM list.

I've recently discovered a little quirk and would like to know what is the 
proper behavior and whether we can make it so if there is none.


For many times, I have used an equivalent of this:

     %files
     /xxx/foo/
     %lang(de) /xxx/foo/locale/de/LC_MESSAGES/foo.mo
     %lang(es) /xxx/foo/locale/es/LC_MESSAGES/foo.mo

It gives a warning:

   warning: File listed twice: /xxx/foo/locale/de/LC_MESSAGES/foo.mo
   warning: File listed twice: /xxx/foo/locale/es/LC_MESSAGES/foo.mo

But achieves the goal I need:

1) I don't have to carefully expand the directory structure of /xxx/foo/ and 
%dir-dance around the .mo files.
2) The files end up being marked as %lang at the end.


However, it seems that it is not always the case. I have a spec file at

https://src.fedoraproject.org/fork/churchyard/rpms/mu/blob/rpm-list-reporducer/f/mu.spec

That produces a list of files of this sort (hidden in %{pyproject_files}, but 
the file is cat'ed in %check for easier inspection).

The file list contains:

   ...
   %lang(de) /usr/lib/python3.9/site-packages/mu/locale/de_DE/LC_MESSAGES/mu.mo
   ...
   /usr/lib/python3.9/site-packages/mu/

The warnings happen:

   warning: File listed twice: 
/usr/lib/python3.9/site-packages/mu/locale/de_DE/LC_MESSAGES/mu.mo
   ...

But the files are not marked as %lang:

   $ rpm -q --qf "[%-36{FILENAMES} %{FILELANGS}\n]" -p mu-1.0.3-6.fc34.noarch.rpm
   ...
   /usr/lib/python3.9/site-packages/mu/locale/de_DE/LC_MESSAGES/mu.mo
   ...

https://koji.fedoraproject.org/koji/taskinfo?taskID=56256059

I have not yet figured out when this happens. The order in %files apparently 
makes no difference.

Is this one of the "it only works by accident" cases? And if so, can we maybe 
support it? it is really convenient.

Thanks.
-- 
Miro Hrončok
--
Phone: +420777974800
IRC: mhroncok



More information about the Rpm-list mailing list