Bug 1254483 - %lang / %_install_langs does not work
%lang / %_install_langs does not work
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
24
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: packaging-team-maint
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-18 04:45 EDT by Vít Ondruch
Modified: 2016-04-06 07:00 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-04-06 06:59:23 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Vít Ondruch 2015-08-18 04:45:31 EDT
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 08:11:38 EDT
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 08:26:17 EDT
(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 09:13:30 EDT
> 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 10:40:46 EST
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 10:59:35 EST
> 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 08:38:09 EST
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 05:51:29 EDT
(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 06:59:23 EDT
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 07:00:12 EDT
s/feature/fix/

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