GNU bug report logs - #62298
[PATCH 0/8] Extensible define-configuration & mpd/mympd service fixes

Previous Next

Package: guix-patches;

Reported by: Bruno Victal <mirai <at> makinata.eu>

Date: Mon, 20 Mar 2023 16:47:01 UTC

Severity: normal

Tags: patch

Done: Liliana Marie Prikler <liliana.prikler <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #135 received at 62298 <at> debbugs.gnu.org (full text, mbox):

From: Bruno Victal <mirai <at> makinata.eu>
To: 62298 <at> debbugs.gnu.org
Cc: ludo <at> gnu.org, Bruno Victal <mirai <at> makinata.eu>, liliana.prikler <at> gmail.com,
 maxim.cournoyer <at> gmail.com
Subject: [PATCH v4 3/5] services: mpd: Fix unintentional API breakage for
 mixer-type field.
Date: Sun, 26 Mar 2023 19:41:31 +0100
* gnu/services/audio.scm (mpd-output)[mixer-type]: Use sanitizer to
accept both strings and symbols as values.
---
 gnu/services/audio.scm | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/gnu/services/audio.scm b/gnu/services/audio.scm
index c073b85a32..bc4aed71dc 100644
--- a/gnu/services/audio.scm
+++ b/gnu/services/audio.scm
@@ -140,6 +140,11 @@ (define (uglify-field-name field-name)
 (define list-of-symbol?
   (list-of symbol?))
 
+
+;;;
+;;; MPD
+;;;
+
 (define (mpd-serialize-field field-name value)
   (let ((field (if (string? field-name) field-name
                    (uglify-field-name field-name)))
@@ -294,7 +299,17 @@ (define-configuration mpd-output
 for this audio output: the @code{hardware} mixer, the @code{software}
 mixer, the @code{null} mixer (allows setting the volume, but with no
 effect; this can be used as a trick to implement an external mixer
-External Mixer) or no mixer (@code{none}).")
+External Mixer) or no mixer (@code{none})."
+   (sanitizer
+    (lambda (x)  ; TODO: deprecated, remove me later.
+      (cond
+       ((symbol? x)
+        (warning (G_ "symbol value for 'mixer-type' is deprecated, \
+use string instead~%"))
+        (symbol->string x))
+       ((string? x) x)
+       (else
+        (configuration-field-error #f 'mixer-type x))))))
 
   (replay-gain-handler
    maybe-string
-- 
2.39.1





This bug report was last modified 2 years and 51 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.