1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-09 17:39:31 +00:00

lib/oe/package: fix LOCALE_PATHS scan to create locale packages

split_locales() must only check subdirectories in paths added to
LOCALE_PATHS to avoid creating weird packages based on filenames also
present in paths.

Without such a filter, cups recipe adding ${datadir}/cups/templates to
LOCALE_PATHS creates the following incorrect packages:
- cups-locale-add-class.tmpl
- cups-locale-add-printer.tmpl
- cups-locale-admin.tmpl

(From OE-Core rev: ba3aee0d516bd066829d6edaa8d7bacdd75dd6ef)

Signed-off-by: Jonathan GUILLOT <jonathan@joggee.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Jonathan GUILLOT
2024-02-19 16:19:28 +00:00
committed by Richard Purdie
parent 396bc832b7
commit ca25926d07
2 changed files with 10 additions and 6 deletions
+9 -5
View File
@@ -652,11 +652,15 @@ def split_locales(d):
locales = set()
for localepath in (d.getVar('LOCALE_PATHS') or "").split():
localedir = dvar + localepath
if cpath.isdir(localedir):
locales.update(os.listdir(localedir))
localepaths.append(localepath)
else:
bb.debug(1, "No locale files in %s" % localepath)
if not cpath.isdir(localedir):
bb.debug(1, 'No locale files in %s' % localepath)
continue
localepaths.append(localepath)
with os.scandir(localedir) as it:
for entry in it:
if entry.is_dir():
locales.add(entry.name)
if len(locales) == 0:
bb.debug(1, "No locale files in this package")