Bug 989437

Summary: find-lang.sh doesn't find qm files
Product: [Fedora] Fedora Reporter: Mario Blättermann <mario.blaettermann>
Component: rpmAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: ffesti, jzeleny, kevin, novyjindrich, packaging-team-maint, pknirsch, pmatilai
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-09 09:08:31 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:
Bug Depends On:    
Bug Blocks: 985065    

Description Mario Blättermann 2013-07-29 09:23:10 UTC
Description of problem:

The find-lang script cannot find qm files in a certain case. We don't have the files with the same name in different folders, but with the following naming scheme in the same folder:

$ rpm -ql peg-solitaire
...
/usr/share/games/peg-solitaire/locales
/usr/share/games/peg-solitaire/locales/solitari.qm
/usr/share/games/peg-solitaire/locales/solitari_ca_ES.qm
/usr/share/games/peg-solitaire/locales/solitari_de_DE.qm
/usr/share/games/peg-solitaire/locales/solitari_en_EN.qm
/usr/share/games/peg-solitaire/locales/solitari_en_US.qm
/usr/share/games/peg-solitaire/locales/solitari_es_ES.qm
/usr/share/games/peg-solitaire/locales/solitari_eu_ES.qm
/usr/share/games/peg-solitaire/locales/solitari_fr_FR.qm
/usr/share/games/peg-solitaire/locales/solitari_gl_ES.qm
/usr/share/games/peg-solitaire/locales/solitari_it_IT.qm
/usr/share/games/peg-solitaire/locales/solitari_pl_PL.qm
/usr/share/games/peg-solitaire/locales/solitari_pt_BR.qm
/usr/share/games/peg-solitaire/locales/solitari_pt_PT.qm 


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

$ rpm -qf /usr/lib/rpm/find-lang.sh
rpm-build-4.11.1-1.fc19.x86_64


How reproducible:


I tried to call the %find_lang macro as follows:

%find_lang solitari --with-qt --without-mo


This is the error message:

+ /usr/lib/rpm/find-lang.sh /home/mariobl/rpmbuild/BUILDROOT/peg-solitaire-2.0-3.fc19.x86_64 solitari --with-qt --without-mo
No translations found for solitari in /home/mariobl/rpmbuild/BUILDROOT/peg-solitaire-2.0-3.fc19.x86_64

Comment 1 Fedora End Of Life 2013-09-16 14:53:03 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 20 development cycle.
Changing version to '20'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora20

Comment 2 Mario Blättermann 2013-10-08 19:34:40 UTC
Would be nice if someone would have a look at this. I'm forced by the guidelines to use the find_lang macro, that's why nobody can review my package at bug #985065 as long as it hasn't been fixed.

Comment 3 Panu Matilainen 2013-10-09 09:08:31 UTC
Um, looking at http://mariobl.fedorapeople.org/Review/SPECS/peg-solitaire.spec, the problem is that %find_lang is used *before* %make_install when there's nothing for %find_lang to find in the buildroot.

After changing %install to:

%make_install

%find_lang solitari --with-qt --without-mo

...and correcting the name referred to in %files:
%files -f solitari.lang

...building it fails because of (other) unpackaged files, but %find_lang actually works (somewhat to my surprise):
[pmatilai@localhost SPECS]$ cat ../BUILD/peg-solitaire-2.0/solitari.lang 
%lang(en_EN) /usr/share/games/peg-solitaire/locales/solitari_en_EN.qm
%lang(pt_PT) /usr/share/games/peg-solitaire/locales/solitari_pt_PT.qm
%lang(eu_ES) /usr/share/games/peg-solitaire/locales/solitari_eu_ES.qm
%lang(it_IT) /usr/share/games/peg-solitaire/locales/solitari_it_IT.qm
%lang(gl_ES) /usr/share/games/peg-solitaire/locales/solitari_gl_ES.qm
%lang(de_DE) /usr/share/games/peg-solitaire/locales/solitari_de_DE.qm
%lang(fr_FR) /usr/share/games/peg-solitaire/locales/solitari_fr_FR.qm
%lang(en_US) /usr/share/games/peg-solitaire/locales/solitari_en_US.qm
%lang(pt_BR) /usr/share/games/peg-solitaire/locales/solitari_pt_BR.qm
%lang(ca_ES) /usr/share/games/peg-solitaire/locales/solitari_ca_ES.qm
%lang(es_ES) /usr/share/games/peg-solitaire/locales/solitari_es_ES.qm
%lang(pl_PL) /usr/share/games/peg-solitaire/locales/solitari_pl_PL.qm
[pmatilai@localhost SPECS]$

Somewhat hysterical that none of the reviewers noticed the simple mistake of calling %find_lang too early but ... guess we're all humans, even the reviewers :)

Comment 4 Mario Blättermann 2013-10-09 18:30:34 UTC
Many thanks for catching this! Now someone can proceed with reviewing my package.