[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#63985] [PATCH RFC 0/5] Generic INI serializer & SRFI-171 for define
From: |
Bruno Victal |
Subject: |
[bug#63985] [PATCH RFC 0/5] Generic INI serializer & SRFI-171 for define-configuration |
Date: |
Fri, 9 Jun 2023 22:18:24 +0100 |
This RFC patch series (more like 3 patch series for the price of 1)
implements the following:
* Serializer Keyword arguments parameter in define-configuration.
Allows for serializing procedures to be specified as:
(define* (serialize-string field-name value #:key …)
…)
Examples in the unit tests.
* Express serialize-configuration with SRFI-171 transducers.
The ‘base-transducer’ can be used to craft more specialized
configuration record serializers.
* Generic INI serializer.
This procedure can be used for crafting INI files from a
record-type defined with define-configuration.
Example for generic-ini in action can be found in the unit test.
These changes are motivated in part by a (in progress) refactoring of
the NetworkManager service-type.
Notes:
* I've left Generic-INI and serializer-kwargs undocumented since this
is at its RFC stage.
* The (gnu services configuration generic-ini) module contains some trailing
notes that should be removed before merging in.
* jami-account->alist explicitly checks for the empty-string.
(which I consider to be a serialization “artifact” arising from define-maybe)
This is the only (relevant) test that failed and will need to be investigated.
Bruno Victal (5):
services: configuration: Simplify normalize-extra-args.
services: configuration: Use transducers within
serialize-configuration.
services: fstrim-service-type: Serialize with SRFI-171 transducers.
services: configuration: Add serializer-kwargs field.
services: configuration: New generic-ini module.
Makefile.am | 1 +
gnu/local.mk | 1 +
gnu/services/configuration.scm | 86 +++++++++----
gnu/services/configuration/generic-ini.scm | 129 +++++++++++++++++++
gnu/services/linux.scm | 11 +-
tests/services/configuration.scm | 38 +++++-
tests/services/configuration/generic-ini.scm | 106 +++++++++++++++
7 files changed, 333 insertions(+), 39 deletions(-)
create mode 100644 gnu/services/configuration/generic-ini.scm
create mode 100644 tests/services/configuration/generic-ini.scm
base-commit: c348b1be3891e6eb47bbdd9fc1587aba2b6ab0b7
--
2.39.2
- [bug#63985] [PATCH RFC 0/5] Generic INI serializer & SRFI-171 for define-configuration,
Bruno Victal <=
- [bug#63985] [PATCH RFC 1/5] services: configuration: Simplify normalize-extra-args., Bruno Victal, 2023/06/09
- [bug#63985] [PATCH RFC 2/5] services: configuration: Use transducers within serialize-configuration., Bruno Victal, 2023/06/09
- [bug#63985] [PATCH RFC 3/5] services: fstrim-service-type: Serialize with SRFI-171 transducers., Bruno Victal, 2023/06/09
- [bug#63985] [PATCH RFC 5/5] services: configuration: New generic-ini module., Bruno Victal, 2023/06/09
- [bug#63985] [PATCH RFC 4/5] services: configuration: Add serializer-kwargs field., Bruno Victal, 2023/06/09
- [bug#63985] [PATCH RFC v2 1/5] services: configuration: Simplify normalize-extra-args., Bruno Victal, 2023/06/10
- [bug#63985] [PATCH RFC v2 3/5] services: fstrim-service-type: Serialize with SRFI-171 transducers., Bruno Victal, 2023/06/10
- [bug#63985] [PATCH RFC v2 2/5] services: configuration: Use transducers within serialize-configuration., Bruno Victal, 2023/06/10
- [bug#63985] [PATCH RFC v2 4/5] services: configuration: Add serializer-options field., Bruno Victal, 2023/06/10
- [bug#63985] [PATCH RFC v2 5/5] services: configuration: New generic-ini module., Bruno Victal, 2023/06/10