Skip to content

rpm: %find_lang --generate-subpackages may generate illegal subpackage names for locales containing '@' #54

@misaka00251

Description

@misaka00251

Package name

rpm

openRuyi version

4.20.1

Describe the bug

When using %find_lang %{name} --generate-subpackages, locales containing @ (such as be@latin) can result in generated langpack subpackage names that contain @. This appears to produce illegal RPM package names and causes the build to fail.

As a local workaround, we currently remove such locale directories before running %find_lang:

rm -rf %{buildroot}%{_datadir}/locale/*@*

Steps to reproduce

  1. Prepare a package that installs translated files under: %{buildroot}%{_datadir}/locale/be@latin/...
  2. In spec:
%install -a
%find_lang %{name} --generate-subpackages
  1. Run:
rpmbuild -ba test.spec

Expected behaviour

%find_lang --generate-subpackages should either sanitise locale-derived subpackage names or skip unsupported locale variants, so that it never emits illegal package names.

Screenshots

No response

Relevant log output

[  378s] + touch /home/abuild/rpmbuild/BUILD/gdk-pixbuf-2.44.4-build/BUILDROOT/usr/lib64/gdk-pixbuf-2.0/2.10.0/loaders.cache
[  378s] + cd /home/abuild/rpmbuild/BUILD/gdk-pixbuf-2.44.4-build/BUILDROOT/usr/bin
[  378s] + mv gdk-pixbuf-query-loaders gdk-pixbuf-query-loaders-64
[  378s] + sed -i -e s/gdk-pixbuf-query-loaders/gdk-pixbuf-query-loaders-64/ /home/abuild/rpmbuild/BUILD/gdk-pixbuf-2.44.4-build/BUILDROOT/usr/lib64/pkgconfig/gdk-pixbuf-2.0.pc
[  378s] + /usr/lib/rpm/find-lang.sh /home/abuild/rpmbuild/BUILD/gdk-pixbuf-2.44.4-build/BUILDROOT gdk-pixbuf --generate-subpackages
[  386s] + /usr/lib/rpm/brp-compress
[  386s] + /usr/lib/rpm/brp-remove-la-files
[  387s] + /usr/lib/rpm/brp-openruyi
[  387s] Reading /home/abuild/rpmbuild/BUILD/gdk-pixbuf-2.44.4-build/SPECPARTS/find-lang-gdk-pixbuf.lang.specpart
[  387s] error: line 17: Illegal char '@' (0x40) in: %package langpack-be@latin
[  387s] 
[  387s] error: parsing failed
[  387s] 
[  387s] RPM build warnings:
[  387s]     Could not canonicalize hostname: gabriel-19442
[  387s] 
[  387s] RPM build errors:
[  387s]     line 17: Illegal char '@' (0x40) in: %package langpack-be@latin
[  387s]

Additional context

No response

I assert that this issue is relevant for openRuyi

  • I assert that this is a bug and not a support request.
  • I assert that this is not a duplicate of an existing issue.
  • I assert that I have read the openRuyi Code of Conduct and agree to abide by it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority:3We want to address this but may have other higher priority items.Target: RollingTargeting rolling/current branch.Type: BugIssues related to incorrect behavior or failures that need fixing.Type: EnhancementIssues requesting improvements to existing behavior (non-breaking).Upstream bugThis label indicates issues caused by a known upstream issue or bug.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions