GNU bug report logs - #73518
[PATCH] services: configuration: Document multiple configurations per field.

Previous Next

Package: guix-patches;

Reported by: Herman Rimm <herman <at> rimm.ee>

Date: Fri, 27 Sep 2024 18:41:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 73518 in the body.
You can then email your comments to 73518 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to pelzflorian <at> pelzflorian.de, ludo <at> gnu.org, maxim.cournoyer <at> gmail.com, guix-patches <at> gnu.org:
bug#73518; Package guix-patches. (Fri, 27 Sep 2024 18:41:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Herman Rimm <herman <at> rimm.ee>:
New bug report received and forwarded. Copy sent to pelzflorian <at> pelzflorian.de, ludo <at> gnu.org, maxim.cournoyer <at> gmail.com, guix-patches <at> gnu.org. (Fri, 27 Sep 2024 18:41:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: guix-patches <at> gnu.org
Subject: [PATCH] services: configuration: Document multiple configurations per
 field.
Date: Fri, 27 Sep 2024 20:39:19 +0200
* gnu/serives/configuration.scm (generate-documentation): Filter for all
configurations associated with each field-name.
* doc/guix.texi (Complex Configurations): Describe use case for multiple
field-names.

Change-Id: I6d1e7b8858231aa05fda884b31a9bd0a48f07293
---
 doc/guix.texi                  | 4 +++-
 gnu/services/configuration.scm | 9 +++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 52e36e4354..877221239b 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -44685,7 +44685,9 @@ Complex Configurations
 @var{sub-documentation} is a @code{(@var{field-name}
 @var{configuration-name})} tuple.  @var{field-name} is the name of the
 field which takes another configuration record as its value, and
-@var{configuration-name} is the name of that configuration record.
+@var{configuration-name} is the name of that configuration record.  The
+same value may be used for multiple @var{field-name}s, in case a field
+accepts different types of configurations.
 
 @var{sub-documentation} is only needed if there are nested configuration
 records.  For example, the @code{getmail-configuration} record
diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm
index d2b1687496..e76ad5e8cb 100644
--- a/gnu/services/configuration.scm
+++ b/gnu/services/configuration.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2021 Andrew Tropin <andrew <at> trop.in>
 ;;; Copyright © 2022 Maxime Devos <maximedevos <at> telenet.be>
 ;;; Copyright © 2023 Bruno Victal <mirai <at> makinata.eu>
+;;; Copyright © 2024 Herman Rimm <herman <at> rimm.ee>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -460,8 +461,12 @@ (define (generate-documentation documentation documentation-name)
                            (para ,@field-docs)
                            ,@(append-map
                               generate
-                              (or (assq-ref sub-documentation field-name)
-                                  '())))))
+                              (filter-map
+                                (match-lambda
+                                  ((name config)
+                                   (and (eq? name field-name)
+                                        config)))
+                                sub-documentation)))))
                fields)))))))
   (stexi->texi `(*fragment* . ,(generate documentation-name))))
 

base-commit: 9a141b5bd633227ea31776b9ce7ca40928de2442
-- 
2.45.2





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Mon, 14 Oct 2024 11:10:02 GMT) Full text and rfc822 format available.

Notification sent to Herman Rimm <herman <at> rimm.ee>:
bug acknowledged by developer. (Mon, 14 Oct 2024 11:10:02 GMT) Full text and rfc822 format available.

Message #10 received at 73518-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Herman Rimm <herman <at> rimm.ee>
Cc: 73518-done <at> debbugs.gnu.org, Maxim Cournoyer <maxim.cournoyer <at> gmail.com>,
 Florian Pelz <pelzflorian <at> pelzflorian.de>
Subject: Re: [bug#73518] [PATCH] services: configuration: Document multiple
 configurations per field.
Date: Mon, 14 Oct 2024 13:08:51 +0200
Herman Rimm <herman <at> rimm.ee> skribis:

> * gnu/serives/configuration.scm (generate-documentation): Filter for all
> configurations associated with each field-name.
> * doc/guix.texi (Complex Configurations): Describe use case for multiple
> field-names.
>
> Change-Id: I6d1e7b8858231aa05fda884b31a9bd0a48f07293

Applied, thanks!




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 11 Nov 2024 12:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 219 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.