From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id CMg4JOUxA2BvXQAA0tVLHw (envelope-from ) for ; Sat, 16 Jan 2021 18:35:17 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id MB4KIOUxA2BtewAA1q6Kng (envelope-from ) for ; Sat, 16 Jan 2021 18:35:17 +0000 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 461F99402B1 for ; Sat, 16 Jan 2021 18:35:17 +0000 (UTC) Received: from localhost ([::1]:40052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0qPs-0004LY-6D for larch@yhetil.org; Sat, 16 Jan 2021 13:35:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0qPf-0004IZ-MR for guix-patches@gnu.org; Sat, 16 Jan 2021 13:35:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60731) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l0qPf-0006O5-Es for guix-patches@gnu.org; Sat, 16 Jan 2021 13:35:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l0qPf-0002XB-Cz for guix-patches@gnu.org; Sat, 16 Jan 2021 13:35:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45919] [PATCH 5/8] channels: Add the channel name to channel sexps. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 16 Jan 2021 18:35:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45919 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 45919@debbugs.gnu.org Received: via spool by 45919-submit@debbugs.gnu.org id=B45919.16108220719653 (code B ref 45919); Sat, 16 Jan 2021 18:35:03 +0000 Received: (at 45919) by debbugs.gnu.org; 16 Jan 2021 18:34:31 +0000 Received: from localhost ([127.0.0.1]:44034 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l0qP9-0002VS-Bq for submit@debbugs.gnu.org; Sat, 16 Jan 2021 13:34:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l0qP5-0002UI-Qg for 45919@debbugs.gnu.org; Sat, 16 Jan 2021 13:34:28 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:57163) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0qP0-0006Bl-Kj; Sat, 16 Jan 2021 13:34:22 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36420 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1l0qP0-0000li-0B; Sat, 16 Jan 2021 13:34:22 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Sat, 16 Jan 2021 19:34:06 +0100 Message-Id: <20210116183409.31229-5-ludo@gnu.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210116183409.31229-1-ludo@gnu.org> References: <20210116183409.31229-1-ludo@gnu.org> MIME-Version: 1.0 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" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: 2.15 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 461F99402B1 X-Spam-Score: 2.15 X-Migadu-Scanner: scn0.migadu.com X-TUID: xc27lxzYLN3Y * guix/channels.scm (channel-instance->sexp): Add 'name'. (sexp->channel): Extract the name from SEXP, using the optional argument as a fallback. --- guix/channels.scm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/guix/channels.scm b/guix/channels.scm index 65a0d849ec..6449221c3f 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -812,6 +812,7 @@ derivation." (url ,(channel-url channel)) (branch ,(channel-branch channel)) (commit ,commit) + (name ,(channel-name channel)) ,@(if intro `((introduction (channel-introduction @@ -907,16 +908,22 @@ to 'latest-channel-instances'." (channel-instances->derivation instances))) (define* (sexp->channel sexp #:optional (name 'channel)) - "Read SEXP, a provenance sexp as created by 'channel-instance->sexp', -and return a channel called NAME. Return #f if the sexp does not have the -expected structure." + "Read SEXP, a provenance sexp as created by 'channel-instance->sexp'; use +NAME as the channel name if SEXP does not specify it. Return #f if the sexp +does not have the expected structure." (match sexp (('repository ('version 0) ('url url) ('branch branch) ('commit commit) rest ...) - (channel (name name) + ;; Historically channel sexps did not include the channel name. It's OK + ;; for channels created by 'channel-instances->manifest' because the + ;; entry name is the channel name, but it was missing for entries created + ;; by 'manifest-entry-with-provenance'. + (channel (name (match (assq 'name rest) + (#f name) + (('name name) name))) (url url) (commit commit) (introduction -- 2.30.0