Bug 1254483 - %lang / %_install_langs does not work
Summary: %lang / %_install_langs does not work
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 24
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-18 08:45 UTC by Vít Ondruch
Modified: 2016-04-06 11:00 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-04-06 10:59:23 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Vít Ondruch 2015-08-18 08:45:31 UTC
Description of problem:
# rpm -E "%_install_langs"
ja

# rpm -i https://kojipkgs.fedoraproject.org//packages/ruby/2.2.2/43.fc23/x86_64/ruby-libs-2.2.2-43.fc23.x86_64.rpm --nodeps

# ls /usr/share/doc/ruby-libs/
COPYING  COPYING.ja  GPL  LEGAL  NEWS  NEWS-1.8.7  NEWS-1.9.1  NEWS-1.9.2  NEWS-1.9.3  NEWS-2.0.0  NEWS-2.1.0  README.ja.md  README.md

But there should be installed just COPYING.ja and README.ja.md, since these are the only marked by "%lang(ja)":

http://pkgs.fedoraproject.org/cgit/ruby.git/tree/ruby.spec#n647



Version-Release number of selected component (if applicable):
# rpm -q rpm
rpm-4.12.90-7.fc24.x86_64


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:
All doc file are installed.


Expected results:
Only files marked by %lang(ja) are installed.


Additional info:

Comment 1 Ľuboš Kardoš 2015-08-21 12:11:38 UTC
This doesn't work as you expect. When %_install_langs == "ja" then all files which have defined other langauge than "ja" are not installed but files with undefined language are installed always.

For example we have a following spec:
...
%files
%lang(sk) /test/test.sk
%lang(cz) /test/test.cz
%lang(ja) /test/test.ja
/test/test

After you install the package built from this spec with the command:
# rpm -Uvh --define "_install_langs ja" test.rpm

rpm will install these files:
/test/test.ja
/test/test

Nevertheless there is a bug. %lang combined with %doc doesn't work. And it seems it never worked.

Comment 2 Vít Ondruch 2015-08-21 12:26:17 UTC
(In reply to Ľuboš Kardoš from comment #1)
> This doesn't work as you expect.

Actually that makes sense. This would not be probably surprising, since I tried several other values for _install_langs, but probably never succeeded due to the issue with %doc as you said ;)

BTW is there a way how to display flags of the files marked by %lang or %doc?

Comment 3 Ľuboš Kardoš 2015-08-21 13:13:30 UTC
> BTW is there a way how to display flags of the files marked by %lang or %doc?

$ rpm -q --qf "[%{FILENAMES} %{FILELANGS} %{FILEFLAGS:fflags} \n ]" -p test.rpm

Doc files have "d" in the last column of output. The problem is that for doc files the lang is empty so the lang won't be in output of this command for doc files.

Comment 4 Florian Festi 2015-11-13 15:40:46 UTC
Guess the %lang mystery is solved. If the %lang vs %doc incompatibility is an issue for you feel free to reopen this bug or file a new one.

Comment 5 Vít Ondruch 2015-11-13 15:59:35 UTC
> The problem is that for doc files the lang is empty so the lang won't be in output of this command for doc files.

Well, this might explain how the lang marked files are installed, but I can't see why doc files should not have lang specified. I'd like to see this fixed and that is why this ticket was not closed.

Comment 6 Jan Kurik 2016-02-24 13:38:09 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase

Comment 8 Vít Ondruch 2016-03-22 09:51:29 UTC
(In reply to Ľuboš Kardoš from comment #7)
> Fixed upstream:
> https://github.com/rpm-software-management/rpm/commit/
> 877d5b130cbfdfd93ad39c1f0f1505790eba264e

Great, thx!

Comment 9 Ľuboš Kardoš 2016-04-06 10:59:23 UTC
Pushed also to rawhide as rpm-4.13.0-0.rc1.28.fc25 to enable testing of this feature and finding eventual problems. I will close this as rawhide, if you need this feature in the current fedora then please reopen this bug. I could probably push this also to the current fedora after this will be some time in rawhide and it won't broke nothing but I would prefer leaving this feature only in rawhide.

Comment 10 Ľuboš Kardoš 2016-04-06 11:00:12 UTC
s/feature/fix/


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