From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id UCqGIqP+E2Zm+wAA62LTzQ:P1 (envelope-from ) for ; Mon, 08 Apr 2024 16:26:43 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id UCqGIqP+E2Zm+wAA62LTzQ (envelope-from ) for ; Mon, 08 Apr 2024 16:26:43 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=TVh8uvhg; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1712586403; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=dNLoZne8UhuMwX71QqUqHTzRrS7ci50aViBq89NAu+g=; b=EPxtdNo2QKbjFSUVCOJO5ANdS40sM7hjfgt6QWcqgDByJtHCs3ozV/RcXdJqeFbpKb/Y6g 7aUkH5tmNKCanMNASoGdrKnUDrOB3Gj3FC8/t2SzZleL4rNcQ7M8UUDRLnpUISFjd9BPFJ zNw7QfWlBi8MEUCsg5/LAnbuu/zzVCyE2WRljXR40Jau+BVjPES69kqMLj66WEXlPs7qR2 RIy2XdhVt76pXSnoC3uZWB3g0pcn3rQhm34HM7j0vY1zg/XwLMJzbG8Ul28AilXs6DFMvF iZZoINxMeu1ejgvix+7ei8qU67LMRy+NIv0UhuNAD+vffT6nx4ZfGjHlfINHNg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1712586403; a=rsa-sha256; cv=none; b=S2E8Nojq9XnW0RK/RHsFUFoZOky1rpv7bXtB8qFWYEQIUZxaZYxoIaZyNJ7mkk0Lo6AEFa QW0XajgWXx2EyySkS9oMgjgcWT8GNCycxuW//0xH5wL8XkbS4F33vkOKQd51GRgMies1K7 zyXykSn/mY3M69lBh28wlJ/fwtARCo/A/VYy0B+J+OYr+A6KuqGijqAGWBzj114eMZ8AoN Ki5yklK6KI4Q6ZVoF/VlyumfjW/oIRsbsVIOCcWEnvKyPHy2fVJiE3lgg/XVjNZBAS634W 8WQdBiE0SIO2mJIbGxpLbT1xLCffTItlCF0adcyJRFD3ap94iDgtQipRRUSWxQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=TVh8uvhg; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 75CA521A7E for ; Mon, 8 Apr 2024 16:26:43 +0200 (CEST) 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-locale-definitions=E2=80=99?= includes the =?UTF-8?Q?OS=E2=80=99?= 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.07 X-Spam-Score: -6.07 X-Migadu-Queue-Id: 75CA521A7E X-Migadu-Scanner: mx12.migadu.com X-TUID: 0CiLqvQYr7CI * 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) -- 2.41.0