From patchwork Thu Nov 30 12:49:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan GUILLOT X-Patchwork-Id: 36157 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE97BC4332F for ; Wed, 13 Dec 2023 14:15:12 +0000 (UTC) Received: from 18.mo582.mail-out.ovh.net (18.mo582.mail-out.ovh.net [46.105.73.110]) by mx.groups.io with SMTP id smtpd.web10.37074.1702476903951073138 for ; Wed, 13 Dec 2023 06:15:04 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=softfail (domain: joggee.fr, ip: 46.105.73.110, mailfrom: jonathan@joggee.fr) Received: from director6.ghost.mail-out.ovh.net (unknown [10.108.9.3]) by mo582.mail-out.ovh.net (Postfix) with ESMTP id 0771B28F44 for ; Wed, 13 Dec 2023 14:15:01 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-j56hl (unknown [10.110.178.147]) by director6.ghost.mail-out.ovh.net (Postfix) with ESMTPS id A1C3B1FED6 for ; Wed, 13 Dec 2023 14:15:01 +0000 (UTC) Received: from joggee.fr ([37.59.142.106]) by ghost-submission-6684bf9d7b-j56hl with ESMTPSA id sJnBJmW8eWWtJQEAcHI1ww (envelope-from ) for ; Wed, 13 Dec 2023 14:15:01 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-106R00649fc1a78-a0e8-47b4-9424-768c48bed9b6, 8AE51020AAF3E055EAEAC9529530B6D231DC969C) smtp.auth=jonathan@joggee.fr X-OVh-ClientIp: 84.14.185.34 In-Reply-To: Message-Id: To: From: "Jonathan GUILLOT" Date: Thu, 30 Nov 2023 12:49:13 +0000 Subject: [PATCH 1/3] lib/oe/package: replace in place PN-locale-* packages in PACKAGES X-Ovh-Tracer-Id: 13575256653270944891 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 21 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrudeljedgtddvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucffrghtvgcuihhnuchprghsthculddvuddmnecujfgurhepjgfkvffhfffusedttdertddttddtnecuhfhrohhmpedflfhonhgrthhhrghnucfifgfknffnqffvfdcuoehjohhnrghthhgrnhesjhhoghhgvggvrdhfrheqnecuggftrfgrthhtvghrnhepleduieejtedvveevtdfgheejhfdtheevheejhfejjeeggfehhfffgeethfdvueeknecukfhppeduvdejrddtrddtrddupdekgedrudegrddukeehrdefgedpfeejrdehledrudegvddruddtieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehjohhnrghthhgrnhesjhhoghhgvggvrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepohhpvghnvghmsggvugguvgguqdgtohhrvgeslhhishhtshdrohhpvghnvghmsggvugguvggurdhorhhgpdfovfetjfhoshhtpehmohehkedvpdhmohguvgepshhmthhpohhuth List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 13 Dec 2023 14:15:12 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/192293 split_locales() removes PN-locale from PACKAGES and adds PN-locale-* to the end. As the PN-locale package typically appears before PN base package, it may result in paths not installed in PN-locale-* packages if already catched by PN. Now insert PN-locale-* exactly where PN-locale was existing in list to avoid such an issue. --- meta/lib/oe/package.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py index 9a465eaa09..2f7a50e144 100644 --- a/meta/lib/oe/package.py +++ b/meta/lib/oe/package.py @@ -647,8 +647,11 @@ def split_locales(d): dvar = d.getVar('PKGD') pn = d.getVar('LOCALEBASEPN') - if pn + '-locale' in packages: - packages.remove(pn + '-locale') + try: + locale_index = packages.index(pn + '-locale') + packages.pop(locale_index) + except ValueError: + locale_index = len(packages) localedir = os.path.join(dvar + datadir, 'locale') @@ -665,7 +668,8 @@ def split_locales(d): for l in sorted(locales): ln = legitimize_package_name(l) pkg = pn + '-locale-' + ln - packages.append(pkg) + packages.insert(locale_index, pkg) + locale_index += 1 d.setVar('FILES:' + pkg, os.path.join(datadir, 'locale', l)) d.setVar('RRECOMMENDS:' + pkg, '%svirtual-locale-%s' % (mlprefix, ln)) d.setVar('RPROVIDES:' + pkg, '%s-locale %s%s-translation' % (pn, mlprefix, ln)) From patchwork Wed Dec 6 16:03:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan GUILLOT X-Patchwork-Id: 36158 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFC66C4167D for ; Wed, 13 Dec 2023 14:15:12 +0000 (UTC) Received: from 19.mo583.mail-out.ovh.net (19.mo583.mail-out.ovh.net [46.105.35.78]) by mx.groups.io with SMTP id smtpd.web10.37075.1702476904410644216 for ; Wed, 13 Dec 2023 06:15:04 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=softfail (domain: joggee.fr, ip: 46.105.35.78, mailfrom: jonathan@joggee.fr) Received: from director6.ghost.mail-out.ovh.net (unknown [10.109.140.200]) by mo583.mail-out.ovh.net (Postfix) with ESMTP id 390D02AE64 for ; Wed, 13 Dec 2023 14:15:02 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-j56hl (unknown [10.110.178.147]) by director6.ghost.mail-out.ovh.net (Postfix) with ESMTPS id CF2AA1FEC6 for ; Wed, 13 Dec 2023 14:15:01 +0000 (UTC) Received: from joggee.fr ([37.59.142.106]) by ghost-submission-6684bf9d7b-j56hl with ESMTPSA id iF/rMWW8eWWtJQEAcHI1ww (envelope-from ) for ; Wed, 13 Dec 2023 14:15:01 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-106R00684b68b50-265d-4978-ac94-cc38708cb65c, 8AE51020AAF3E055EAEAC9529530B6D231DC969C) smtp.auth=jonathan@joggee.fr X-OVh-ClientIp: 84.14.185.34 In-Reply-To: Message-Id: To: From: "Jonathan GUILLOT" Date: Wed, 6 Dec 2023 16:03:47 +0000 Subject: [PATCH 2/3] lib/oe/package: add LOCALEEXTRADIRS to define extra locations for locales X-Ovh-Tracer-Id: 13575538126771719291 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrudeljedgtdduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpegjkffvhfffufestddtredttddttdenucfhrhhomhepfdflohhnrghthhgrnhcuifgfkffnnffqvfdfuceojhhonhgrthhhrghnsehjohhgghgvvgdrfhhrqeenucggtffrrghtthgvrhhnpeeludeijeetvdevvedtgfehjefhtdehveehjefhjeejgefghefhffegtefhvdeukeenucfkphepuddvjedrtddrtddruddpkeegrddugedrudekhedrfeegpdefjedrheelrddugedvrddutdeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeojhhonhgrthhhrghnsehjohhgghgvvgdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopehophgvnhgvmhgsvgguuggvugdqtghorhgvsehlihhsthhsrdhophgvnhgvmhgsvgguuggvugdrohhrghdpoffvtefjohhsthepmhhoheekfedpmhhouggvpehsmhhtphhouhht List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 13 Dec 2023 14:15:12 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/192294 Some packages may contain localized files not located in /usr/share/locale. This new variables allows to add these directories in dedicated locale packages. --- meta/lib/oe/package.py | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py index 2f7a50e144..fc8b20324e 100644 --- a/meta/lib/oe/package.py +++ b/meta/lib/oe/package.py @@ -653,24 +653,37 @@ def split_locales(d): except ValueError: locale_index = len(packages) - localedir = os.path.join(dvar + datadir, 'locale') + localedirs = [os.path.join(dvar + datadir, 'locale')] - if not cpath.isdir(localedir): + for localedir in (d.getVar('LOCALEEXTRADIRS') or "").split(): + localedirs.append(dvar + localedir) + + locales = set() + locale_found = False + for localedir in localedirs: + if cpath.isdir(localedir): + locale_found = True + locales.update(os.listdir(localedir)) + + if not locale_found: bb.debug(1, "No locale files in this package") return - locales = os.listdir(localedir) - summary = d.getVar('SUMMARY') or pn description = d.getVar('DESCRIPTION') or "" locale_section = d.getVar('LOCALE_SECTION') mlprefix = d.getVar('MLPREFIX') or "" + dvar_len = len(dvar) for l in sorted(locales): ln = legitimize_package_name(l) pkg = pn + '-locale-' + ln packages.insert(locale_index, pkg) locale_index += 1 - d.setVar('FILES:' + pkg, os.path.join(datadir, 'locale', l)) + files = [] + for localedir in localedirs: + # Remove dvar prefix + files.append(os.path.join(localedir[dvar_len:], l)) + d.setVar('FILES:' + pkg, " ".join(files)) d.setVar('RRECOMMENDS:' + pkg, '%svirtual-locale-%s' % (mlprefix, ln)) d.setVar('RPROVIDES:' + pkg, '%s-locale %s%s-translation' % (pn, mlprefix, ln)) d.setVar('SUMMARY:' + pkg, '%s - %s translations' % (summary, l)) From patchwork Wed Dec 6 16:06:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan GUILLOT X-Patchwork-Id: 36159 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DFC73C4167B for ; Wed, 13 Dec 2023 14:15:12 +0000 (UTC) Received: from 3.mo576.mail-out.ovh.net (3.mo576.mail-out.ovh.net [188.165.52.203]) by mx.groups.io with SMTP id smtpd.web10.37076.1702476905197732941 for ; Wed, 13 Dec 2023 06:15:05 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=softfail (domain: joggee.fr, ip: 188.165.52.203, mailfrom: jonathan@joggee.fr) Received: from director6.ghost.mail-out.ovh.net (unknown [10.108.17.203]) by mo576.mail-out.ovh.net (Postfix) with ESMTP id 8742C304B2 for ; Wed, 13 Dec 2023 14:15:02 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-j56hl (unknown [10.110.178.147]) by director6.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 27D071FED0 for ; Wed, 13 Dec 2023 14:15:02 +0000 (UTC) Received: from joggee.fr ([37.59.142.106]) by ghost-submission-6684bf9d7b-j56hl with ESMTPSA id wBMACWa8eWWtJQEAcHI1ww (envelope-from ) for ; Wed, 13 Dec 2023 14:15:02 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-106R006ada851b9-f30c-41fb-92af-d1bcbd321fd5, 8AE51020AAF3E055EAEAC9529530B6D231DC969C) smtp.auth=jonathan@joggee.fr X-OVh-ClientIp: 84.14.185.34 In-Reply-To: Message-Id: To: From: "Jonathan GUILLOT" Date: Wed, 6 Dec 2023 16:06:43 +0000 Subject: [PATCH 3/3] cups: use LOCALEEXTRADIRS to split localized HTML templates X-Ovh-Tracer-Id: 13575538128612953211 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrudeljedgtdduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpegjkffvhfffufestddtredttddttdenucfhrhhomhepfdflohhnrghthhgrnhcuifgfkffnnffqvfdfuceojhhonhgrthhhrghnsehjohhgghgvvgdrfhhrqeenucggtffrrghtthgvrhhnpeeludeijeetvdevvedtgfehjefhtdehveehjefhjeejgefghefhffegtefhvdeukeenucfkphepuddvjedrtddrtddruddpkeegrddugedrudekhedrfeegpdefjedrheelrddugedvrddutdeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeojhhonhgrthhhrghnsehjohhgghgvvgdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopehophgvnhgvmhgsvgguuggvugdqtghorhgvsehlihhsthhsrdhophgvnhgvmhgsvgguuggvugdrohhrghdpoffvtefjohhsthepmhhoheejiedpmhhouggvpehsmhhtphhouhht List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 13 Dec 2023 14:15:12 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/192295 Localized HTML templates in /usr/share/cups/templates are now part of locale packages. --- meta/recipes-extended/cups/cups.inc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta/recipes-extended/cups/cups.inc b/meta/recipes-extended/cups/cups.inc index 31f686cdfd..560bd67cf6 100644 --- a/meta/recipes-extended/cups/cups.inc +++ b/meta/recipes-extended/cups/cups.inc @@ -110,6 +110,8 @@ CONFFILES:${PN} += "${sysconfdir}/cups/cupsd.conf" MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/cups-config" +LOCALEEXTRADIRS = "${datadir}/cups/templates/" + SYSROOT_PREPROCESS_FUNCS += "cups_sysroot_preprocess" cups_sysroot_preprocess () { sed -i ${SYSROOT_DESTDIR}${bindir_crossscripts}/cups-config -e 's:cups_datadir=.*:cups_datadir=${datadir}/cups:' -e 's:cups_serverbin=.*:cups_serverbin=${libexecdir}/cups:'