unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Bruno Victal <mirai@makinata.eu>
To: 62298@debbugs.gnu.org
Cc: ludo@gnu.org, Bruno Victal <mirai@makinata.eu>,
	liliana.prikler@gmail.com, maxim.cournoyer@gmail.com
Subject: [bug#62298] [PATCH v2 3/8] services: audio: remove redundant list-of-string? predicate.
Date: Thu, 23 Mar 2023 15:02:13 +0000	[thread overview]
Message-ID: <b3da894d2b2428c1d52ce77065179949f241c43a.1679583701.git.mirai@makinata.eu> (raw)
In-Reply-To: <e251c56b622dd0324bb4fd38cf65d0a04c8f12fa.1679583701.git.mirai@makinata.eu>

Use list-of-strings? predicate defined in (gnu services configuration).

* gnu/services/audio.scm (list-of-string?): Remove predicate.
(mpd-serialize-list-of-string): Rename procedure to ...
(mpd-serialize-list-of-strings): ... this.
(mpd-configuration)[environment-variables]: Switch to list-of-strings.
[endpoints]: Switch to maybe-list-of-strings.
(mympd-ip-acl)[allow, deny]: Switch to list-of-strings.
(mympd-serialize-configuration): Rename serialize-list-of-string to serialize-list-of-strings.
* doc/guix.texi (Audio Services): Update it.
---
 doc/guix.texi          |  8 ++++----
 gnu/services/audio.scm | 25 +++++++++++--------------
 2 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 1609e508ef..2b62605b51 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -33501,7 +33501,7 @@ Audio Services
 This is a list of symbols naming Shepherd services that this service
 will depend on.
 
-@item @code{environment-variables} (default: @code{()}) (type: list-of-string)
+@item @code{environment-variables} (default: @code{()}) (type: list-of-strings)
 A list of strings specifying environment variables.
 
 @item @code{log-file} (default: @code{"/var/log/mpd/log"}) (type: maybe-string)
@@ -33532,7 +33532,7 @@ Audio Services
 @item @code{default-port} (default: @code{6600}) (type: maybe-integer)
 The default port to run mpd on.
 
-@item @code{endpoints} (type: maybe-list-of-string)
+@item @code{endpoints} (type: maybe-list-of-strings)
 The addresses that mpd will bind to.  A port different from @var{default-port}
 may be specified, e.g. @code{localhost:6602} and IPv6 addresses must be
 enclosed in square brackets when a different port is used.
@@ -33808,10 +33808,10 @@ Audio Services
 Available @code{mympd-ip-acl} fields are:
 
 @table @asis
-@item @code{allow} (default: @code{()}) (type: list-of-string)
+@item @code{allow} (default: @code{()}) (type: list-of-strings)
 Allowed IP addresses.
 
-@item @code{deny} (default: @code{()}) (type: list-of-string)
+@item @code{deny} (default: @code{()}) (type: list-of-strings)
 Disallowed IP addresses.
 
 @end table
diff --git a/gnu/services/audio.scm b/gnu/services/audio.scm
index 5f341fac0f..e9ecccd614 100644
--- a/gnu/services/audio.scm
+++ b/gnu/services/audio.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2017 Peter Mikkelsen <petermikkelsen10@gmail.com>
 ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2020 Ludovic Courtès <ludo@gnu.org>
-;;; Copyright © 2022 Bruno Victal <mirai@makinata.eu>
+;;; Copyright © 2022⁠–⁠2023 Bruno Victal <mirai@makinata.eu>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -137,9 +137,6 @@ (define (uglify-field-name field-name)
                                    str)
                                #\-) "_")))
 
-(define list-of-string?
-  (list-of string?))
-
 (define list-of-symbol?
   (list-of symbol?))
 
@@ -159,11 +156,11 @@ (define (mpd-serialize-alist field-name value)
 (define mpd-serialize-string mpd-serialize-field)
 (define mpd-serialize-boolean mpd-serialize-field)
 
-(define (mpd-serialize-list-of-string field-name value)
+(define (mpd-serialize-list-of-strings field-name value)
   #~(string-append #$@(map (cut mpd-serialize-string field-name <>) value)))
 
 (define-maybe string (prefix mpd-))
-(define-maybe list-of-string (prefix mpd-))
+(define-maybe list-of-strings (prefix mpd-))
 (define-maybe boolean (prefix mpd-))
 
 ;;; TODO: Procedures for deprecated fields, to be removed.
@@ -349,7 +346,7 @@ (define-configuration mpd-configuration
    empty-serializer)
 
   (environment-variables
-   (list-of-string '())
+   (list-of-strings '())
    "A list of strings specifying environment variables."
    empty-serializer)
 
@@ -400,7 +397,7 @@ (define-configuration mpd-configuration
    "The default port to run mpd on.")
 
   (endpoints
-   maybe-list-of-string
+   maybe-list-of-strings
    "The addresses that mpd will bind to. A port different from
 @var{default-port} may be specified, e.g. @code{localhost:6602} and
 IPv6 addresses must be enclosed in square brackets when a different
@@ -409,7 +406,7 @@ (define-configuration mpd-configuration
 can be specified here."
    (serializer (lambda (_ endpoints)
                  (if (maybe-value-set? endpoints)
-                     (mpd-serialize-list-of-string "bind_to_address" endpoints)
+                     (mpd-serialize-list-of-strings "bind_to_address" endpoints)
                      ""))))
 
   (address ; TODO: deprecated, remove later
@@ -581,11 +578,11 @@ (define (string-or-symbol? x)
 
 (define-configuration/no-serialization mympd-ip-acl
   (allow
-   (list-of-string '())
+   (list-of-strings '())
    "Allowed IP addresses.")
 
   (deny
-   (list-of-string '())
+   (list-of-strings '())
    "Disallowed IP addresses."))
 
 (define-maybe/no-serialization integer)
@@ -707,12 +704,12 @@ (define (mympd-serialize-configuration config)
       ((? string? val) val)))
 
   (define (ip-acl-serialize-configuration config)
-    (define (serialize-list-of-string prefix lst)
+    (define (serialize-list-of-strings prefix lst)
       (map (cut format #f "~a~a" prefix <>) lst))
     (string-join
      (append
-      (serialize-list-of-string "+" (mympd-ip-acl-allow config))
-      (serialize-list-of-string "-" (mympd-ip-acl-deny config))) ","))
+      (serialize-list-of-strings "+" (mympd-ip-acl-allow config))
+      (serialize-list-of-strings "-" (mympd-ip-acl-deny config))) ","))
 
   ;; myMPD configuration fields are serialized as individual files under
   ;; <work-directory>/config/.
-- 
2.39.1





  parent reply	other threads:[~2023-03-23 15:05 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-20 16:45 [bug#62298] [PATCH 0/8] Extensible define-configuration & mpd/mympd service fixes Bruno Victal
2023-03-20 17:07 ` [bug#62298] [PATCH 1/8] services: configuration: Add user-defined sanitizer support Bruno Victal
2023-03-20 19:43   ` Liliana Marie Prikler
2023-03-20 17:07 ` [bug#62298] [PATCH 2/8] services: replace bare serializers with (serializer ...) Bruno Victal
2023-03-20 17:07 ` [bug#62298] [PATCH 3/8] services: audio: remove redundant list-of-string? predicate Bruno Victal
2023-03-20 17:07 ` [bug#62298] [PATCH 4/8] services: mympd: Require 'syslog service when configured to log to syslog Bruno Victal
2023-03-20 17:07 ` [bug#62298] [PATCH 5/8] services: mpd: Fix unintentional API breakage for mixer-type field Bruno Victal
2023-03-20 17:07 ` [bug#62298] [PATCH 6/8] services: mpd: Set PulseAudio related variables as default value for environment-variables field Bruno Victal
2023-03-20 17:07 ` [bug#62298] [PATCH 7/8] services: mpd: Use user-account (resp. user-group) for user (resp. group) fields Bruno Victal
2023-03-20 19:33   ` Liliana Marie Prikler
2023-03-21  2:10     ` Bruno Victal
2023-03-21  5:30       ` Liliana Marie Prikler
2023-03-20 17:07 ` [bug#62298] [PATCH 8/8] services: mympd: " Bruno Victal
2023-03-20 19:33   ` Liliana Marie Prikler
2023-03-23 15:02 ` [bug#62298] [PATCH v2 1/8] services: configuration: Add user-defined sanitizer support Bruno Victal
2023-03-23 15:02   ` [bug#62298] [PATCH v2 2/8] services: replace bare serializers with (serializer ...) Bruno Victal
2023-03-24 14:28     ` Maxim Cournoyer
2023-03-23 15:02   ` Bruno Victal [this message]
2023-03-23 15:02   ` [bug#62298] [PATCH v2 4/8] services: mympd: Require 'syslog service when configured to log to syslog Bruno Victal
2023-03-24 14:32     ` Maxim Cournoyer
2023-03-23 15:02   ` [bug#62298] [PATCH v2 5/8] services: mpd: Fix unintentional API breakage for mixer-type field Bruno Victal
2023-03-23 15:02   ` [bug#62298] [PATCH v2 6/8] services: mpd: Set PulseAudio related variables as default value for environment-variables field Bruno Victal
2023-03-24 18:10     ` bug#62298: " Maxim Cournoyer
2023-03-23 15:02   ` [bug#62298] [PATCH v2 7/8] services: mpd: Use user-account (resp. user-group) for user (resp. group) fields Bruno Victal
2023-03-23 18:03     ` Liliana Marie Prikler
2023-03-24 15:31     ` Maxim Cournoyer
2023-03-23 15:02   ` [bug#62298] [PATCH v2 8/8] services: mympd: " Bruno Victal
2023-03-23 19:19     ` Liliana Marie Prikler
2023-03-25  0:39       ` Bruno Victal
2023-03-24 16:03     ` Maxim Cournoyer
2023-03-25  0:33       ` Bruno Victal
2023-03-25  5:21         ` Liliana Marie Prikler
2023-03-23 19:47   ` [bug#62298] [PATCH v2 1/8] services: configuration: Add user-defined sanitizer support Liliana Marie Prikler
2023-03-24 14:25   ` Maxim Cournoyer
2023-03-24 18:03     ` Liliana Marie Prikler
2023-03-26  2:01       ` Maxim Cournoyer
2023-03-25  0:46 ` [bug#62298] [PATCH v3 1/5] " Bruno Victal
2023-03-25  0:46   ` [bug#62298] [PATCH v3 2/5] services: replace bare serializers with (serializer ...) Bruno Victal
2023-03-25  0:46   ` [bug#62298] [PATCH v3 3/5] services: mpd: Fix unintentional API breakage for mixer-type field Bruno Victal
2023-03-25  0:46   ` [bug#62298] [PATCH v3 4/5] services: mpd: Use user-account (resp. user-group) for user (resp. group) fields Bruno Victal
2023-03-25  0:46   ` [bug#62298] [PATCH v3 5/5] services: mympd: " Bruno Victal
2023-03-26 18:41 ` [bug#62298] [PATCH v4 1/5] services: configuration: Add user-defined sanitizer support Bruno Victal
2023-03-26 18:41   ` [bug#62298] [PATCH v4 2/5] services: replace bare serializers with (serializer ...) Bruno Victal
2023-03-26 18:41   ` [bug#62298] [PATCH v4 3/5] services: mpd: Fix unintentional API breakage for mixer-type field Bruno Victal
2023-03-26 18:41   ` [bug#62298] [PATCH v4 4/5] services: mpd: Use user-account (resp. user-group) for user (resp. group) fields Bruno Victal
2023-03-26 18:41   ` [bug#62298] [PATCH v4 5/5] services: mympd: " Bruno Victal
2023-04-02 10:46   ` bug#62298: [PATCH v4 1/5] services: configuration: Add user-defined sanitizer support Liliana Marie Prikler

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=b3da894d2b2428c1d52ce77065179949f241c43a.1679583701.git.mirai@makinata.eu \
    --to=mirai@makinata.eu \
    --cc=62298@debbugs.gnu.org \
    --cc=liliana.prikler@gmail.com \
    --cc=ludo@gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    /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).