From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 2BWZGQNG82DYAgEAgWs5BA (envelope-from ) for ; Sat, 17 Jul 2021 23:05:07 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id OPlKFQNG82DbNAAAB5/wlQ (envelope-from ) for ; Sat, 17 Jul 2021 21:05:07 +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 24D531FD58 for ; Sat, 17 Jul 2021 23:05:07 +0200 (CEST) Received: from localhost ([::1]:33792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4rUg-0001ai-7L for larch@yhetil.org; Sat, 17 Jul 2021 17:05:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47920) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4rUc-0001aR-Cz for guix-patches@gnu.org; Sat, 17 Jul 2021 17:05:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43142) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m4rUc-00030O-4c for guix-patches@gnu.org; Sat, 17 Jul 2021 17:05:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m4rUb-0007tn-M6 for guix-patches@gnu.org; Sat, 17 Jul 2021 17:05:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49610] [PATCH 1/2] services: guix: Use "match-record" in activation. Resent-From: Brice Waegeneire Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 17 Jul 2021 21:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49610 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49610@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.162655588130327 (code B ref -1); Sat, 17 Jul 2021 21:05:01 +0000 Received: (at submit) by debbugs.gnu.org; 17 Jul 2021 21:04:41 +0000 Received: from localhost ([127.0.0.1]:54685 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m4rUC-0007st-91 for submit@debbugs.gnu.org; Sat, 17 Jul 2021 17:04:41 -0400 Received: from lists.gnu.org ([209.51.188.17]:49522) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m4rU9-0007sk-Ax for submit@debbugs.gnu.org; Sat, 17 Jul 2021 17:04:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4rU9-0001We-5c for guix-patches@gnu.org; Sat, 17 Jul 2021 17:04:33 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:60935) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4rU7-0002eD-99 for guix-patches@gnu.org; Sat, 17 Jul 2021 17:04:32 -0400 Received: (Authenticated sender: brice@waegenei.re) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id A948D20002 for ; Sat, 17 Jul 2021 21:04:26 +0000 (UTC) From: Brice Waegeneire Date: Sat, 17 Jul 2021 23:04:23 +0200 Message-Id: <20210717210424.1921-1-brice@waegenei.re> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210717205819.380-1-brice@waegenei.re> References: <20210717205819.380-1-brice@waegenei.re> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=217.70.183.200; envelope-from=brice@waegenei.re; helo=relay7-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1626555907; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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; bh=36BseXlAvs48tOtsgkaWU1s2YXuYXrZ/ozho3BuTInY=; b=IdN2+dp4pMZThUuCM9K+psNOxID0lsc/u0BDuLLTTvqD+l7v+/4jTF974Fu1oKVoZxQm5Q 4foErmXF3G50aVFEKJNhujvpyd+voTUd14/tIVFhmdcw0LYEntU1+CU4GNNg1ndwBVS+GF /NzWD12IaHlIKNjXcLePavFTW15x40ZF6VVYzKwC6BzQhbAKdr/zjYYh2gP++J5atIPPJR UqAworDa1XouynQeTQmmCNj1l9SsFqnrCvbG3TyjFpXVmFagiIXFyPqSj2G9X1PwCQ7bBk 3E4e1ovXIy3kZDslCYaCitDfpAd+pvYsZ/ZA5H2M2YYYsysc0va56mWICreyJw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1626555907; a=rsa-sha256; cv=none; b=Ewx+NG2A+kXlnlqzpmiMITkWCS5hE+wNbLW0Dzi4nTlUNTxeD9IwtIJP47rHiQsvVvtCCn GcTic73K77DXdajg9K1Zyf16M0c2Gk6cMdTorSlAuEsVGjFE6GAHNx0dB16C3JoYL0GpZF evZQIsIepuMS2CUPOfzUQ9KEFuvJjUQPsmtU+c3oKnCaIwI4mgDa5h8eeRpH4X5Ejgt8YG /LYLCyqhKYzbN8Q5aVNiNgUWej8GvHPoPciajO9DNryetjoejyc5A1GrxFIqPFR68M52RI TxwARE5KozFNlLTcmRKskA1yL4ez9Vh7hn25fkEKKQDyV5H621I2fUj6TW7E2Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; 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-Spam-Score: -1.41 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; 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: 24D531FD58 X-Spam-Score: -1.41 X-Migadu-Scanner: scn0.migadu.com X-TUID: RdQFDfyJO/n7 It's more explicit to specify used fields instead of depending on their position. * gnu/services/base.scm (guix-activation): Replace "match" with "match-record". --- gnu/services/base.scm | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index ab3e441a7b..e206bea5f0 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -12,7 +12,7 @@ ;;; Copyright © 2019 John Soo ;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2020 Florian Pelz -;;; Copyright © 2020 Brice Waegeneire +;;; Copyright © 2020, 2021 Brice Waegeneire ;;; Copyright © 2021 qblade ;;; Copyright © 2021 Hui Lu ;;; @@ -1700,21 +1700,21 @@ proxy of 'guix-daemon'...~%") (define (guix-activation config) "Return the activation gexp for CONFIG." - (match config - (($ guix build-group build-accounts authorize-key? keys) - ;; Assume that the store has BUILD-GROUP as its group. We could - ;; otherwise call 'chown' here, but the problem is that on a COW overlayfs, - ;; chown leads to an entire copy of the tree, which is a bad idea. + (match-record config + (guix authorize-key? authorized-keys) + #~(begin + ;; Assume that the store has BUILD-GROUP as its group. We could + ;; otherwise call 'chown' here, but the problem is that on a COW overlayfs, + ;; chown leads to an entire copy of the tree, which is a bad idea. - ;; Generate a key pair and optionally authorize substitute server keys. - #~(begin - (unless (file-exists? "/etc/guix/signing-key.pub") - (system* #$(file-append guix "/bin/guix") "archive" - "--generate-key")) + ;; Generate a key pair and optionally authorize substitute server keys. + (unless (file-exists? "/etc/guix/signing-key.pub") + (system* #$(file-append guix "/bin/guix") "archive" + "--generate-key")) - #$(if authorize-key? - (substitute-key-authorization keys guix) - #~#f))))) + #$(if authorize-key? + (substitute-key-authorization authorized-keys guix) + #~#f)))) (define* (references-file item #:optional (name "references")) "Return a file that contains the list of references of ITEM." -- 2.32.0