unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Brice Waegeneire <brice@waegenei.re>
To: 49610@debbugs.gnu.org
Subject: [bug#49610] [PATCH 1/2] services: guix: Use "match-record" in activation.
Date: Sat, 17 Jul 2021 23:04:23 +0200	[thread overview]
Message-ID: <20210717210424.1921-1-brice@waegenei.re> (raw)
In-Reply-To: <20210717205819.380-1-brice@waegenei.re>

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 <jsoo1@asu.edu>
 ;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2020 Florian Pelz <pelzflorian@pelzflorian.de>
-;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
+;;; Copyright © 2020, 2021 Brice Waegeneire <brice@waegenei.re>
 ;;; Copyright © 2021 qblade <qblade@protonmail.com>
 ;;; Copyright © 2021 Hui Lu <luhuins@163.com>
 ;;;
@@ -1700,21 +1700,21 @@ proxy of 'guix-daemon'...~%")
 
 (define (guix-activation config)
   "Return the activation gexp for CONFIG."
-  (match config
-    (($ <guix-configuration> 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-configuration>
+    (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





  reply	other threads:[~2021-07-17 21:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-17 20:58 [bug#49610] [PATCH 0/2] Add channels field to guix-configuration Brice Waegeneire
2021-07-17 21:04 ` Brice Waegeneire [this message]
2021-07-21 21:47   ` Ludovic Courtès
2021-08-04  4:42     ` Brice Waegeneire
2021-07-17 21:04 ` [bug#49610] [PATCH 2/2] services: guix: Add channels field Brice Waegeneire
2021-07-21 21:53   ` [bug#49610] [PATCH 0/2] Add channels field to guix-configuration Ludovic Courtès
2021-09-01 21:16     ` Ludovic Courtès
2021-12-21 21:00     ` [bug#49610] [PATCH v2] sevices: guix: Add channels field Brice Waegeneire
2022-01-03 11:32       ` Ludovic Courtès
2023-05-25 20:12 ` [bug#49610] [PATCH v3] services: " Antero Mejr via Guix-patches via
2023-05-26 10:40   ` Simon Tournier
2023-05-26 16:29     ` Antero Mejr via Guix-patches via
2023-05-26 16:26 ` [bug#49610] [PATCH v4 1/2] " Antero Mejr via Guix-patches via
2023-05-26 16:26   ` [bug#49610] [PATCH v4 2/2] doc: guix.texi: Clarify wording in Channels section Antero Mejr via Guix-patches via
2024-03-22 10:45     ` Ludovic Courtès
2024-03-22 10:44   ` [bug#49610] [PATCH v4 1/2] services: guix: Add channels field Ludovic Courtès
2024-03-24 10:24 ` [bug#49610] [PATCH 0/2] Add channels field to guix-configuration Franz Geffke
2024-04-04  8:03   ` Simon Tournier
2024-04-09  8:44     ` Franz Geffke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210717210424.1921-1-brice@waegenei.re \
    --to=brice@waegenei.re \
    --cc=49610@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).