From 6676033c4da4fa8afe48081672258f2cef8ecb22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Sun, 10 Jan 2021 20:22:38 +0100 Subject: [PATCH] qt5-translation: rework MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Get rid of the nasty FILES_${PN}_remove because it forces our recipes using qt5-translation to add paths usually added automatically. To make this happen we prepend locale packages. To avoid performance penalties, we use python collections. Signed-off-by: Andreas Müller --- classes/qt5-translation.bbclass | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/classes/qt5-translation.bbclass b/classes/qt5-translation.bbclass index 3a5f9853..ed1be22c 100644 --- a/classes/qt5-translation.bbclass +++ b/classes/qt5-translation.bbclass @@ -7,17 +7,15 @@ QT_TRANSLATION_FILES ??= "${datadir}/*/translations/*.qm ${datadir}/*/translatio FILES_${PN}-locale = "${datadir}/*/translations" -# remove ${datadir}/${BPN} set by bitbake.conf -FILES_${PN}_remove = "${datadir}/${BPN}" - python qt_do_split_locales() { import glob + import collections if (d.getVar('PACKAGE_NO_LOCALE') == '1'): bb.debug(1, "package requested not splitting locales") return - packages = (d.getVar('PACKAGES') or "").split() + packages = collections.deque((d.getVar('PACKAGES') or "").split()) datadir = d.getVar('datadir') if not datadir: @@ -51,7 +49,7 @@ python qt_do_split_locales() { for l in sorted(locales): ln = legitimize_package_name(l) pkg = pn + '-locale-' + ln - packages.append(pkg) + packages.appendleft(pkg) files = '' for transvar in d.getVar('QT_TRANSLATION_FILES').split(): files = '%s %s' % (files, transvar.replace('*.qm', '*_%s.qm' % l)) @@ -63,7 +61,7 @@ python qt_do_split_locales() { if locale_section: d.setVar('SECTION_' + pkg, locale_section) - d.setVar('PACKAGES', ' '.join(packages)) + d.setVar('PACKAGES', ' '.join(list(packages))) } PACKAGESPLITFUNCS_prepend = "qt_do_split_locales "