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: 37351 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 99379C47074 for ; Thu, 4 Jan 2024 14:12:02 +0000 (UTC) Received: from 8.mo560.mail-out.ovh.net (8.mo560.mail-out.ovh.net [188.165.52.147]) by mx.groups.io with SMTP id smtpd.web11.54619.1704377519580292272 for ; Thu, 04 Jan 2024 06:12:00 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=softfail (domain: joggee.fr, ip: 188.165.52.147, mailfrom: jonathan@joggee.fr) Received: from director6.ghost.mail-out.ovh.net (unknown [10.109.148.38]) by mo560.mail-out.ovh.net (Postfix) with ESMTP id 13B9F27D60 for ; Thu, 4 Jan 2024 14:11:56 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-dpg4v (unknown [10.110.178.62]) by director6.ghost.mail-out.ovh.net (Postfix) with ESMTPS id C44E31FEBB for ; Thu, 4 Jan 2024 14:11:56 +0000 (UTC) Received: from joggee.fr ([37.59.142.95]) by ghost-submission-6684bf9d7b-dpg4v with ESMTPSA id wHmyJ6y8lmUrPAAAEbo37A (envelope-from ) for ; Thu, 04 Jan 2024 14:11:56 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-95G001b08d8049-c646-4676-8a50-27db77e8ef61, E96084CFC6176DA275D818C0F1DD071750B22EF1) 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 v3 1/3] lib/oe/package: replace in place PN-locale-* packages in PACKAGES X-Ovh-Tracer-Id: 13595241379393768571 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 21 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdegjedgiedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucffrghtvgcuihhnuchprghsthculddvuddmnecujfgurhepjgfkvffhfffusedttdertddttddtnecuhfhrohhmpedflfhonhgrthhhrghnucfifgfknffnqffvfdcuoehjohhnrghthhgrnhesjhhoghhgvggvrdhfrheqnecuggftrfgrthhtvghrnhepleduieejtedvveevtdfgheejhfdtheevheejhfejjeeggfehhfffgeethfdvueeknecukfhppeduvdejrddtrddtrddupdekgedrudegrddukeehrdefgedpfeejrdehledrudegvddrleehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeojhhonhgrthhhrghnsehjohhgghgvvgdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopehophgvnhgvmhgsvgguuggvugdqtghorhgvsehlihhsthhsrdhophgvnhgvmhgsvgguuggvugdrohhrghdpoffvtefjohhsthepmhhoheeitddpmhhouggvpehsmhhtphhouhht 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 ; Thu, 04 Jan 2024 14:12:02 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/193328 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. Signed-off-by: Jonathan GUILLOT --- 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: 37350 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 885EAC47073 for ; Thu, 4 Jan 2024 14:12:02 +0000 (UTC) Received: from 6.mo560.mail-out.ovh.net (6.mo560.mail-out.ovh.net [87.98.165.38]) by mx.groups.io with SMTP id smtpd.web10.54764.1704377519328940713 for ; Thu, 04 Jan 2024 06:11:59 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=softfail (domain: joggee.fr, ip: 87.98.165.38, mailfrom: jonathan@joggee.fr) Received: from director6.ghost.mail-out.ovh.net (unknown [10.108.2.210]) by mo560.mail-out.ovh.net (Postfix) with ESMTP id 2905B2BE7D for ; Thu, 4 Jan 2024 14:11:57 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-dpg4v (unknown [10.110.178.62]) by director6.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 062631FEBD for ; Thu, 4 Jan 2024 14:11:56 +0000 (UTC) Received: from joggee.fr ([37.59.142.95]) by ghost-submission-6684bf9d7b-dpg4v with ESMTPSA id MJfgNKy8lmUrPAAAEbo37A (envelope-from ) for ; Thu, 04 Jan 2024 14:11:56 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-95G001acccf431-b4b8-441f-a817-29bfdb52e099, E96084CFC6176DA275D818C0F1DD071750B22EF1) 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 v3 2/3] lib/oe/package: add LOCALE_EXTRA_PATHS to add extra locations for locales X-Ovh-Tracer-Id: 13595522852516859003 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 21 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdegjedgiedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucffrghtvgcuihhnuchprghsthculddvuddmnecujfgurhepjgfkvffhfffusedttdertddttddtnecuhfhrohhmpedflfhonhgrthhhrghnucfifgfknffnqffvfdcuoehjohhnrghthhgrnhesjhhoghhgvggvrdhfrheqnecuggftrfgrthhtvghrnhepgeevhedtgefgjeetudeggfeivedtffehueefteegjeegveffudekkefghfetieeknecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucfkphepuddvjedrtddrtddruddpkeegrddugedrudekhedrfeegpdefjedrheelrddugedvrdelheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehjohhnrghthhgrnhesjhhoghhgvggvrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepohhpvghnvghmsggvugguvgguqdgtohhrvgeslhhishhtshdrohhpvghnvghmsggvugguvggurdhorhhgpdfovfetjfhoshhtpehmohehiedtpdhmohguvgepshhmthhpohhuth 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 ; Thu, 04 Jan 2024 14:12:02 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/193326 Some packages may contain localized files not located in ${datadir}/locale. This new variables allows to add these directories in dedicated locale packages. Signed-off-by: Jonathan GUILLOT --- meta/conf/documentation.conf | 1 + meta/lib/oe/package.py | 23 ++++++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/meta/conf/documentation.conf b/meta/conf/documentation.conf index 486c62b6e8..336bddc9d8 100644 --- a/meta/conf/documentation.conf +++ b/meta/conf/documentation.conf @@ -271,6 +271,7 @@ LICENSE_PATH[doc] = "Path to additional licenses used during the build." LINUX_KERNEL_TYPE[doc] = "Defines the kernel type to be used in assembling the configuration." LINUX_VERSION[doc] = "The Linux version from kernel.org on which the Linux kernel image being built using the OpenEmbedded build system is based. You define this variable in the kernel recipe." LINUX_VERSION_EXTENSION[doc] = "A string extension compiled into the version string of the Linux kernel built with the OpenEmbedded build system. You define this variable in the kernel recipe." +LOCALE_EXTRA_PATHS[doc] = "Whitespace separated list of paths extending base ${datadir}/locale that are scanned to construct locale packages." LOCALE_UTF8_IS_DEFAULT[doc] = "If set, locale names are renamed such that those lacking an explicit encoding (e.g. en_US) will always be UTF-8, and non-UTF-8 encodings are renamed to, e.g., en_US.ISO-8859-1. Otherwise, the encoding is specified by glibc's SUPPORTED file. Not supported for precompiled locales." LOG_DIR[doc] = "Specifies the directory to which the OpenEmbedded build system writes overall log files. The default directory is ${TMPDIR}/log" diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py index 2f7a50e144..4718082bcd 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('LOCALE_EXTRA_PATHS') 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: 37352 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 99E7AC4707C for ; Thu, 4 Jan 2024 14:12:02 +0000 (UTC) Received: from 3.mo550.mail-out.ovh.net (3.mo550.mail-out.ovh.net [46.105.60.232]) by mx.groups.io with SMTP id smtpd.web10.54765.1704377519594756156 for ; Thu, 04 Jan 2024 06:11:59 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=softfail (domain: joggee.fr, ip: 46.105.60.232, mailfrom: jonathan@joggee.fr) Received: from director6.ghost.mail-out.ovh.net (unknown [10.108.17.219]) by mo550.mail-out.ovh.net (Postfix) with ESMTP id 7EFA02D23A for ; Thu, 4 Jan 2024 14:11:57 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-dpg4v (unknown [10.110.178.62]) by director6.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 39BAE1FEC6 for ; Thu, 4 Jan 2024 14:11:57 +0000 (UTC) Received: from joggee.fr ([37.59.142.95]) by ghost-submission-6684bf9d7b-dpg4v with ESMTPSA id +Fj+Ba28lmUrPAAAEbo37A (envelope-from ) for ; Thu, 04 Jan 2024 14:11:57 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-95G001374101e2-69ce-40fc-b90f-0ddbe4830e00, E96084CFC6176DA275D818C0F1DD071750B22EF1) 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 v3 3/3] cups: use LOCALE_EXTRA_PATHS to split localized HTML templates X-Ovh-Tracer-Id: 13595522852447718523 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 21 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdegjedgiedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucffrghtvgcuihhnuchprghsthculddvuddmnecujfgurhepjgfkvffhfffusedttdertddttddtnecuhfhrohhmpedflfhonhgrthhhrghnucfifgfknffnqffvfdcuoehjohhnrghthhgrnhesjhhoghhgvggvrdhfrheqnecuggftrfgrthhtvghrnhepleduieejtedvveevtdfgheejhfdtheevheejhfejjeeggfehhfffgeethfdvueeknecukfhppeduvdejrddtrddtrddupdekgedrudegrddukeehrdefgedpfeejrdehledrudegvddrleehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeojhhonhgrthhhrghnsehjohhgghgvvgdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopehophgvnhgvmhgsvgguuggvugdqtghorhgvsehlihhsthhsrdhophgvnhgvmhgsvgguuggvugdrohhrghdpoffvtefjohhsthepmhhoheehtddpmhhouggvpehsmhhtphhouhht 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 ; Thu, 04 Jan 2024 14:12:02 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/193327 Localized HTML templates in /usr/share/cups/templates are now part of locale packages. Signed-off-by: Jonathan GUILLOT --- 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..d0b77823a9 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" +LOCALE_EXTRA_PATHS = "${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:'