From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id mJtKLMpqHGTEfwAASxT56A (envelope-from ) for ; Thu, 23 Mar 2023 16:05:46 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id qKs/K8pqHGQoMgAAG6o9tA (envelope-from ) for ; Thu, 23 Mar 2023 16:05:46 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 232452EB0 for ; Thu, 23 Mar 2023 16:05:46 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1679583946; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=17+4w+6/3Cu4MLbTJ6Dlmk3HBbj4uKNeNNrUVh/yUtk=; b=jXBVgHxo49+3aUl5L5+U6Ds5ahRwqcgP5qs+YGpI5f85HLSkKms5hQ+z7hzod3LBV2S+AY lgwoPcKfNFjHWv6ydJ1KV2V8Y+IQTAV4mORxbeCqdkf5RsHPxiEbOcWFdBTj+N/zEQo1YA cYfIyHnH/9RjaF6OtaFBVhOAPjKc+U0xRKkXEcrUFDU9SBKEFZjX0lcdpU3AVM8iyfac1T e+75lJtXDODytQaDPhCnoiPk9Pa5AHxvQz9SduSdm4RNtv3YjqcEfzISjdFvotDpl+c837 t4Vrxgg5tvFV44oY4rYxpcdpDzqBMxAwAd2HcSc+MHNLTTehrzz7uziZ9j4BzQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1679583946; a=rsa-sha256; cv=none; b=Gg26TIqnLxlMgBW3WvHEdCfJgnh6FjIXldZl5Ger0RzTTFQVDuMcUj7rSAl6JApq/Cb5P6 CEalduT2tKG+6hWtIp6bvSNs/nhe+6/NFNEWHqyedBBfzR05L0knV8jaDK3LcT4W38VwnM EyzyudjZv+5YAB3C5WATBeBqIliemlC+B04ksO2bYR8wuCZtmVj4x3ffia9qrpLA7AEPtf elrG5+lBhRC2vAjXcg0wyV9TX3xRaGhRkLRFBLDFy/CdoRIFRaysSLuANETIlGK1MJsDmI fpRxRXOfdBq5grCrOQSFSg9ANr0xx/aIfM5qAcPFBGVGSUxp31Q7XDDS4QlctQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pfMV3-0003ef-0c; Thu, 23 Mar 2023 11:05:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pfMUz-0003dJ-2J for guix-patches@gnu.org; Thu, 23 Mar 2023 11:05:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pfMUy-0001yd-P5 for guix-patches@gnu.org; Thu, 23 Mar 2023 11:05:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pfMUx-0001iD-Ef for guix-patches@gnu.org; Thu, 23 Mar 2023 11:05:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62298] [PATCH v2 3/8] services: audio: remove redundant list-of-string? predicate. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 23 Mar 2023 15:05:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62298 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62298@debbugs.gnu.org Cc: ludo@gnu.org, Bruno Victal , liliana.prikler@gmail.com, maxim.cournoyer@gmail.com Received: via spool by 62298-submit@debbugs.gnu.org id=B62298.16795838626487 (code B ref 62298); Thu, 23 Mar 2023 15:05:03 +0000 Received: (at 62298) by debbugs.gnu.org; 23 Mar 2023 15:04:22 +0000 Received: from localhost ([127.0.0.1]:39108 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pfMUI-0001gX-5e for submit@debbugs.gnu.org; Thu, 23 Mar 2023 11:04:22 -0400 Received: from smtpmciv4.myservices.hosting ([185.26.107.240]:35874) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pfMU6-0001fe-CJ for 62298@debbugs.gnu.org; Thu, 23 Mar 2023 11:04:16 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv4.myservices.hosting (Postfix) with ESMTP id 38F2720BEF; Thu, 23 Mar 2023 16:04:09 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id D8735800AB; Thu, 23 Mar 2023 16:04:08 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id MAuhfZRb5ihg; Thu, 23 Mar 2023 16:04:06 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 5689A800AC; Thu, 23 Mar 2023 16:04:06 +0100 (CET) From: Bruno Victal Date: Thu, 23 Mar 2023 15:02:13 +0000 Message-Id: X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: X-Migadu-Queue-Id: 232452EB0 X-Spam-Score: -0.85 X-Migadu-Spam-Score: -0.85 X-Migadu-Scanner: scn0.migadu.com List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-TUID: lOzaNmMpJ6GH 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 ;;; Copyright © 2019 Ricardo Wurmus ;;; Copyright © 2020 Ludovic Courtès -;;; Copyright © 2022 Bruno Victal +;;; Copyright © 2022⁠–⁠2023 Bruno Victal ;;; ;;; 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 ;; /config/. -- 2.39.1