Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2144005

Summary: find-lang.sh doesn't find locales or generate wrong when qm file has 3 characters
Product: Red Hat Enterprise Linux 9 Reporter: Yaakov Selkowitz <yselkowi>
Component: rpmAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED ERRATA QA Contact: Eva Mrakova <emrakova>
Severity: medium Docs Contact: Mariya Pershina <mpershin>
Priority: unspecified    
Version: 9.1CC: emrakova, extras-qa, ffesti, igor.raits, mbanas, mjw, mpershin, packaging-team-maint, pmatilai, pmoravco, sixg0000d, vmukhame
Target Milestone: rcKeywords: AutoVerified, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: rpm-4.16.1.3-21.el9 Doc Type: Bug Fix
Doc Text:
.Qt message QM files with 3-letter names are now packaged when an RPM package is being built or rebuilt Previously, the `find-lang.sh` script could not find Qt message QM files (`.qm`) with names consisting of 3 characters. Consequently, these files were not added to an RPM package. With this update, the issue has been fixed, and the 3-letter Qt message QM files can now be packaged when building or rebuilding an RPM.
Story Points: ---
Clone Of: 1894854 Environment:
Last Closed: 2023-05-09 08:23:27 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: 1894854    
Bug Blocks:    
Deadline: 2023-01-10   

Description Yaakov Selkowitz 2022-11-18 16:51:00 UTC
This also affects RHEL 8 and 9 as well, preventing the building of certain Qt-based packages (such as LXQt) on top of RHEL.

+++ This bug was initially created as a clone of Bug #1894854 +++

Description of problem:
The find-lang script cannot find qm files when my qm file name with a ISO 639-3 code like 'yue.qm' .

Version-Release number of selected component (if applicable):
$ rpm -qf /usr/lib/rpm/find-lang.sh
rpm-build-4.16.0-1.fc33.x86_64

How reproducible:
always

Steps to Reproduce:
1.Has some qm files in buildroot
$ ls path/usr/share/name/lang/
en_US.qm  ja_JP.qm  yue_HK.qm  yue.qm  zh_CN.qm  zh_TW.qm

2.Try to use script to handle there
$ /usr/lib/rpm/find-lang.sh path name --with-qt --all-name

Actual results:
$ cat name.lang 
%lang(en_US) /usr/share/name/lang/en_US.qm
%lang(ja_JP) /usr/share/name/lang/ja_JP.qm
%lang(zh_CN) /usr/share/name/lang/zh_CN.qm
%lang(zh_TW) /usr/share/name/lang/zh_TW.qm
# This is a wrong locale code, because it is missing language code
%lang(HK) /usr/share/name/lang/yue_HK.qm


Expected results:
$ cat name.lang 
%lang(en_US) /usr/share/name/lang/en_US.qm
%lang(ja_JP) /usr/share/name/lang/ja_JP.qm
%lang(zh_CN) /usr/share/name/lang/zh_CN.qm
%lang(zh_TW) /usr/share/name/lang/zh_TW.qm
%lang(yue_HK) /usr/share/name/lang/yue_HK.qm
%lang(yue) /usr/share/name/lang/yue.qm

Additional info:
I think the problem is in the sed expression in the script:
...
'
s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$QT"'s:\(.*/'"$NAME"'_\([a-zA-Z]\{2\}\([_@].*\)\?\)\.qm$\):%lang(\2) \1:
'"$ALL_NAME$QT"'s:^\([^%].*/\([a-zA-Z]\{2\}[_@].*\)\.qm$\):%lang(\2) \1:
'"$ALL_NAME$QT"'s:^\([^%].*/\([a-zA-Z]\{2\}\)\.qm$\):%lang(\2) \1:
'"$ALL_NAME$QT"'s:^\([^%].*/[^/_]\+_\([a-zA-Z]\{2\}[_@].*\)\.qm$\):%lang(\2) \1:
'"$ALL_NAME$QT"'s:^\([^%].*/[^/_]\+_\([a-zA-Z]\{2\}\)\.qm$\):%lang(\2) \1:
'"$ALL_NAME$QT"'s:^\([^%].*/[^/]\+_\([a-zA-Z]\{2\}[_@].*\)\.qm$\):%lang(\2) \1:
'"$ALL_NAME$QT"'s:^\([^%].*/[^/]\+_\([a-zA-Z]\{2\}\)\.qm$\):%lang(\2) \1:
s:^[^%].*::
s:%lang(C) ::
/^$/d'
...
It seems that it only captures the Alpha-2 code, and misses the Alpha-3 code.

Comment 1 Yaakov Selkowitz 2022-11-18 17:08:23 UTC
Filed https://gitlab.com/redhat/centos-stream/rpms/rpm/-/merge_requests/25 with a fix.

Comment 16 errata-xmlrpc 2023-05-09 08:23:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (rpm bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:2538