summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorJonathan GUILLOT <jonathan@joggee.fr>2024-02-19 16:19:28 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-02-24 16:10:19 +0000
commitba3aee0d516bd066829d6edaa8d7bacdd75dd6ef (patch)
tree8d9ba91adebfac46e6e234b1583b4a0a709feed1 /meta/lib
parentbfff81195cb9ba2493e366022470b2e0051d8071 (diff)
downloadopenembedded-core-ba3aee0d516bd066829d6edaa8d7bacdd75dd6ef.tar.gz
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 Signed-off-by: Jonathan GUILLOT <jonathan@joggee.fr> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/package.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py
index d1738d3b61..587810bdaf 100644
--- a/meta/lib/oe/package.py
+++ b/meta/lib/oe/package.py
@@ -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")