From patchwork Mon Apr 8 14:24:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 62849 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 65C6A27BBEA; Mon, 8 Apr 2024 15:26:43 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id C842727BBE2 for ; Mon, 8 Apr 2024 15:26:42 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rtpwp-0006lK-Hc; Mon, 08 Apr 2024 10:26:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtpwh-0006Ye-Tm for guix-patches@gnu.org; Mon, 08 Apr 2024 10:26:03 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rtpwb-0004iE-4L for guix-patches@gnu.org; Mon, 08 Apr 2024 10:25:59 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rtpwi-0000ud-GM for guix-patches@gnu.org; Mon, 08 Apr 2024 10:26:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70280] [PATCH 2/5] system: =?utf-8?q?=E2=80=98operating-system?= =?utf-8?q?-locale-definitions=E2=80=99?= includes the =?utf-8?b?T1PigJk=?= locale. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 08 Apr 2024 14:26:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70280 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70280@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 70280-submit@debbugs.gnu.org id=B70280.17125863083085 (code B ref 70280); Mon, 08 Apr 2024 14:26:04 +0000 Received: (at 70280) by debbugs.gnu.org; 8 Apr 2024 14:25:08 +0000 Received: from localhost ([127.0.0.1]:47332 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtpvn-0000nX-Er for submit@debbugs.gnu.org; Mon, 08 Apr 2024 10:25:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35976) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtpvh-0000lY-CC for 70280@debbugs.gnu.org; Mon, 08 Apr 2024 10:25:02 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtpvU-0004G5-JS; Mon, 08 Apr 2024 10:24:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=dNLoZne8UhuMwX71QqUqHTzRrS7ci50aViBq89NAu+g=; b=TVh8uvhg8pRevsrFFNs6 G+OsUy0cmlBV9LHEKT6qvnSzq0945eVaMmbGDqW9TDdFpCzqOrOPjfMjy3pRk/vmVC0hBQXfmLGbL s5/0JAN7GzUWrr/19CxzcxbioxXDCJC4NxZefoDgJBLMCSyyfz7ulfRAKjpsCukOPs4NzNo8rnREB sKJLhw+bsQ4jryoSS/fufaeKJHGUIy3kKACbggxc2ktc8z9NaLgB3msy3iPn/j4N1S0W2AQCjkTzd /AlaTNUsUDsAOrcvBvpOik4F1ulSChrczglRbFO4BEGCCwe2qcRzqS9/futUC+4/yTLXt2adP/jUu cip0ZUaRI9Nclg==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 8 Apr 2024 16:24:32 +0200 Message-ID: <184c38bf07d985a8831f60024a2ae94e2fd6804d.1712585810.git.ludo@gnu.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/system.scm ()[locale-definitions]: Mark as thunked. Default to (operating-system-default-locale-definitions os). (operating-system-default-locale-definitions): New procedure. (operating-system-locale-directory): Remove logic to add the OS ‘locale’, instead assuming (operating-system-locale-directory os) has everything. * doc/guix.texi (operating-system Reference): Adjust accordingly. Change-Id: I8798fa0de7421e0bfc07870cc3cae6b7f99fa47d --- doc/guix.texi | 3 ++- gnu/system.scm | 28 +++++++++++++++------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 5827e0de14..7ca06046ba 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -17502,7 +17502,8 @@ operating-system Reference The name of the default locale (@pxref{Locale Names,,, libc, The GNU C Library Reference Manual}). @xref{Locales}, for more information. -@item @code{locale-definitions} (default: @code{%default-locale-definitions}) +@item @code{locale-definitions} (default: @ + @code{(operating-system-default-locale-definitions os)}) The list of locale definitions to be compiled and that may be used at run time. @xref{Locales}. diff --git a/gnu/system.scm b/gnu/system.scm index aef81d8ccf..94d734b014 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -282,7 +282,9 @@ (define-record-type* operating-system (locale operating-system-locale ; string (default "en_US.utf8")) (locale-definitions operating-system-locale-definitions ; list of - (default %default-locale-definitions)) + (thunked) + (default (operating-system-default-locale-definitions + this-operating-system))) (locale-libcs operating-system-locale-libcs ; list of (default %default-locale-libcs)) (name-service-switch operating-system-name-service-switch ; @@ -1397,22 +1399,22 @@ (define (locale-name->definition* name) (raise (formatted-message (G_ "~a: invalid locale name") name))) (def def))) +(define (operating-system-default-locale-definitions os) + "Return the default locale definitions for OS, which includes that specified +in its 'locale' field." + (define name + (operating-system-locale os)) + + (if (member name (map locale-definition-name %default-locale-definitions)) + %default-locale-definitions + (cons (locale-name->definition* name) + %default-locale-definitions))) + (define (operating-system-locale-directory os) "Return the directory containing the locales compiled for the definitions listed in OS. The C library expects to find it under /run/current-system/locale." - (define name - (operating-system-locale os)) - - (define definitions - ;; While we're at it, check whether NAME is defined and add it if needed. - (if (member name (map locale-definition-name - (operating-system-locale-definitions os))) - (operating-system-locale-definitions os) - (cons (locale-name->definition* name) - (operating-system-locale-definitions os)))) - - (locale-directory definitions + (locale-directory (operating-system-locale-definitions os) #:libcs (operating-system-locale-libcs os))) (define* (kernel->boot-label kernel #:key hurd)