From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: 58855@debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Subject: [bug#58855] [PATCH 1/5] services: configuration: Re-order generated record fields.
Date: Sat, 29 Oct 2022 00:16:45 -0400 [thread overview]
Message-ID: <20221029041649.12144-1-maxim.cournoyer@gmail.com> (raw)
In-Reply-To: <20221029034716.11125-1-maxim.cournoyer@gmail.com>
This is so that the first field of the generated record matches the first one
declared, which makes 'define-configuration' record API compatible with
define-record-type* ones.
* gnu/services/configuration.scm (define-configuration-helper): Move the
%location field below the ones declared by the user.
* gnu/services/monitoring.scm (zabbix-front-end-config): Adjust match pattern
accordingly.
---
gnu/services/configuration.scm | 10 +++++-----
gnu/services/monitoring.scm | 4 ++--
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm
index 636c49ccba..dacfc52ba9 100644
--- a/gnu/services/configuration.scm
+++ b/gnu/services/configuration.scm
@@ -242,17 +242,17 @@ (define-record-type* #,(id #'stem #'< #'stem #'>)
stem
#,(id #'stem #'make- #'stem)
#,(id #'stem #'stem #'?)
- (%location #,(id #'stem #'stem #'-location)
- (default (and=> (current-source-location)
- source-properties->location))
- (innate))
#,@(map (lambda (name getter def)
#`(#,name #,getter (default #,def)
(sanitize
#,(id #'stem #'validate- #'stem #'- name))))
#'(field ...)
#'(field-getter ...)
- #'(field-default ...)))
+ #'(field-default ...))
+ (%location #,(id #'stem #'stem #'-location)
+ (default (and=> (current-source-location)
+ source-properties->location))
+ (innate)))
(define #,(id #'stem #'stem #'-fields)
(list (configuration-field
diff --git a/gnu/services/monitoring.scm b/gnu/services/monitoring.scm
index 9c8704092c..b19c6c9f18 100644
--- a/gnu/services/monitoring.scm
+++ b/gnu/services/monitoring.scm
@@ -622,8 +622,8 @@ (define-configuration zabbix-front-end-configuration
(define (zabbix-front-end-config config)
(match-record config <zabbix-front-end-configuration>
- (%location db-host db-port db-name db-user db-password db-secret-file
- zabbix-host zabbix-port)
+ (db-host db-port db-name db-user db-password db-secret-file
+ zabbix-host zabbix-port %location)
(mixed-text-file "zabbix.conf.php"
"\
<?php
--
2.37.3
next prev parent reply other threads:[~2022-10-29 5:39 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-29 3:47 [bug#58855] [PATCH 0/5] Update mcron to latest commit Maxim Cournoyer
2022-10-29 4:16 ` Maxim Cournoyer [this message]
2022-10-29 4:16 ` [bug#58855] [PATCH 2/5] services: mcron: Add log? and log-format fields to mcron-configuration Maxim Cournoyer
2022-10-29 4:16 ` [bug#58855] [PATCH 3/5] gnu: mcron: Use gexps and strip trailing #t Maxim Cournoyer
2022-10-29 4:16 ` [bug#58855] [PATCH 4/5] gnu: Remove guile2.2-mcron Maxim Cournoyer
2022-10-29 4:16 ` [bug#58855] [PATCH 5/5] gnu: mcron: Update to 1.2.1-0.5fd0ccd Maxim Cournoyer
2022-11-17 22:37 ` Layout of ‘define-configuration’ records Ludovic Courtès
2022-11-18 16:44 ` Maxim Cournoyer
2022-11-19 21:25 ` Katherine Cox-Buday
2022-11-20 13:47 ` Maxim Cournoyer
2022-11-21 10:26 ` Ludovic Courtès
2022-11-21 20:08 ` Maxim Cournoyer
2022-11-21 16:49 ` Katherine Cox-Buday
2022-11-21 21:00 ` Maxim Cournoyer
2022-11-22 14:52 ` zimoun
2022-11-25 15:18 ` Maxim Cournoyer
2022-11-21 10:22 ` Ludovic Courtès
2022-11-21 21:16 ` Maxim Cournoyer
2022-11-23 21:56 ` Ludovic Courtès
2022-11-25 15:15 ` Maxim Cournoyer
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221029041649.12144-1-maxim.cournoyer@gmail.com \
--to=maxim.cournoyer@gmail.com \
--cc=58855@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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.