unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: Attila Lendvai <attila@lendvai.name>, 54674@debbugs.gnu.org
Subject: [bug#54674] [PATCH v4 1/2] services: configuration: Support (field1 maybe-number "") format.
Date: Sat, 23 Apr 2022 16:55:31 +0200	[thread overview]
Message-ID: <813b73d348bd7de3e19573f5e4261da2120711c0.camel@telenet.be> (raw)
In-Reply-To: <20220420091553.26732-1-attila@lendvai.name>

[-- Attachment #1: Type: text/plain, Size: 2116 bytes --]

I didn't look into the code in detail, but for this kind of thing,
if it compiles, it probably works.  For completeness, you might want to
run a few system tests (‘make check-system’ IIRC).

However, ...

Attila Lendvai schreef op wo 20-04-2022 om 11:15 [+0200]:
> As opposed to explicitly using 'disabled as value, or using the
> (field1 (maybe-number) "") format.
> 
> It's mostly the work of Maxime Devos shared under #54674, with some
> modifications by Attila Lendvai.
> 
> * gnu/services/configuration.scm (normalize-field-type+def): New function.
> (define-configuration-helper) (define-configuration): Support new field
> format.
> * tests/services/configuration.scm (config-with-maybe-number->string): New
> function.
> ("maybe value serialization of the instance"): New test.
> ("maybe value serialization of the instance, unspecified"): New test.

... 'define-configuration' and 'disabled' is documented in the manual
(guix)Complex Configurations:

     When defining a “maybe type”, the corresponding serializer for the
     regular type will be used by default.  For example, a field of
     type ‘maybe-string’ will be serialized using the
     ‘serialize-string’ procedure by default, you can of course change
     this by specifying a custom serializer procedure.  Likewise, the
     type of the value would have to be a string, unless it is set to
     the ‘disabled’ symbol.

It also appears in other locations in the documentation:

     ‘daytime-brightness’ (default: ‘disabled’) (type: maybe-inexact-number)
          Daytime screen brightness, between 0.1 and 1.0.

   The available configuration parameters follow.  Each parameter
definition is preceded by its type; for example, ‘string-list foo’
indicates that the ‘foo’ parameter should be specified as a list of
strings.  Types starting with ‘maybe-’ denote parameters that won’t show
up in ‘prosody.cfg.lua’ when their value is ‘'disabled’.

     [...]

So the documentation appears to be needed to be changed as well.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

  parent reply	other threads:[~2022-04-23 14:56 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-01 19:19 [bug#54674] [PATCH] services: configuration: Use *unspecified* instead of 'disabled Attila Lendvai
2022-04-01 19:46 ` Maxime Devos
2022-04-01 19:56 ` Maxime Devos
2022-04-01 19:58 ` Maxime Devos
2022-04-04  7:46   ` Attila Lendvai
2022-04-04 11:25     ` Maxime Devos
2022-04-18  9:26       ` Attila Lendvai
2022-04-07 13:52 ` [bug#54674] [PATCH v2 1/2] services: configuration: Support (field1 maybe-number "") format Attila Lendvai
2022-04-07 13:52   ` [bug#54674] [PATCH v2 2/2] services: configuration: Use *unspecified* instead of 'disabled Attila Lendvai
2022-04-07 15:01 ` [bug#54674] [PATCH v3 1/2] services: configuration: Support (field1 maybe-number "") format Attila Lendvai
2022-04-07 15:01   ` [bug#54674] [PATCH v3 2/2] services: configuration: Use *unspecified* instead of 'disabled Attila Lendvai
2022-04-20  9:15 ` [bug#54674] [PATCH v4 1/2] services: configuration: Support (field1 maybe-number "") format Attila Lendvai
2022-04-20  9:15   ` [bug#54674] [PATCH v4 2/2] services: configuration: Use *unspecified* instead of 'disabled Attila Lendvai
2022-04-23 14:55   ` Maxime Devos [this message]
2022-05-17 11:38     ` [bug#54674] [PATCH v4 1/2] services: configuration: Support (field1 maybe-number "") format Attila Lendvai
2022-05-17 16:15       ` Maxime Devos
2022-05-19 14:21         ` Attila Lendvai
2022-05-19 20:41           ` Attila Lendvai
2022-04-24 22:41 ` [bug#54674] [PATCH] doc: Follow the 'disabled -> *unspecified* configuration refactor Attila Lendvai
2022-05-17 11:39 ` [bug#54674] [PATCH v5 1/3] services: configuration: Support (field1 maybe-number "") format Attila Lendvai
2022-05-17 11:39   ` [bug#54674] [PATCH v5 2/3] services: configuration: Use *unspecified* instead of 'disabled Attila Lendvai
2022-05-17 11:39   ` [bug#54674] [PATCH v5 3/3] doc: Follow the 'disabled -> *unspecified* configuration refactor Attila Lendvai
2022-06-14 22:31     ` bug#54674: [PATCH] services: configuration: Use *unspecified* instead of 'disabled Ludovic Courtès

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=813b73d348bd7de3e19573f5e4261da2120711c0.camel@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=54674@debbugs.gnu.org \
    --cc=attila@lendvai.name \
    /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).