emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#71735: closed ([PATCH] services: mpd: fix log to file)


From: GNU bug Tracking System
Subject: bug#71735: closed ([PATCH] services: mpd: fix log to file)
Date: Mon, 24 Jun 2024 01:47:03 +0000

Your message dated Sun, 23 Jun 2024 21:45:23 -0400
with message-id <87v81z9kr0.fsf@gmail.com>
and subject line Re: [bug#71735] [PATCH] services: mpd: fix log to file
has caused the debbugs.gnu.org bug report #71735,
regarding [PATCH] services: mpd: fix log to file
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
71735: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71735
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: [PATCH] services: mpd: fix log to file Date: Sun, 23 Jun 2024 16:15:58 +0200
(match value (%unset-value ...)) is equivalent here to
(match value (_ ...)). Even if you set 'log-file to some path, it's always
"syslog" in the configuration file.

* gnu/services/audio.scm (mpd): fix buggy 'match'.
---
 gnu/services/audio.scm | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/gnu/services/audio.scm b/gnu/services/audio.scm
index ae991ced4d..2c8af138e7 100644
--- a/gnu/services/audio.scm
+++ b/gnu/services/audio.scm
@@ -251,16 +251,12 @@ (define (mpd-group-sanitizer value)
          (configuration-field-error #f 'group value))))
 
 (define (mpd-log-file-sanitizer value)
-  (match value
-    (%unset-value
-     ;; XXX: While leaving the 'sys_log' option out of the mpd.conf file is
-     ;; supposed to cause logging to happen via systemd (elogind provides a
-     ;; compatible interface), this doesn't work (nothing gets logged); use
-     ;; syslog instead.
-     "syslog")
-    ((? string?)
-     value)
-    (_ (configuration-field-error #f 'log-file value))))
+  ;; XXX: While leaving the 'sys_log' option out of the mpd.conf file is
+  ;; supposed to cause logging to happen via systemd (elogind provides a
+  ;; compatible interface), this doesn't work (nothing gets logged); use
+  ;; syslog instead.
+  (let ((value (maybe-value value "syslog")))
+    (if (string? value) value (configuration-field-error #f 'log-file value))))
 
 ;;;
 
-- 
2.45.1






--- End Message ---
--- Begin Message --- Subject: Re: [bug#71735] [PATCH] services: mpd: fix log to file Date: Sun, 23 Jun 2024 21:45:23 -0400 User-agent: Gnus/5.13 (Gnus v5.13)
Hi Yarl,

Yarl Baudig <yarl-baudig@mailoo.org> writes:

> (match value (%unset-value ...)) is equivalent here to
> (match value (_ ...)). Even if you set 'log-file to some path, it's always
> "syslog" in the configuration file.

Interesting!  It seems like using a variable in the pattern doesn't work
as I had expected...  Thanks for the fix.

> * gnu/services/audio.scm (mpd): fix buggy 'match'.
> ---
>  gnu/services/audio.scm | 16 ++++++----------
>  1 file changed, 6 insertions(+), 10 deletions(-)
>
> diff --git a/gnu/services/audio.scm b/gnu/services/audio.scm
> index ae991ced4d..2c8af138e7 100644
> --- a/gnu/services/audio.scm
> +++ b/gnu/services/audio.scm
> @@ -251,16 +251,12 @@ (define (mpd-group-sanitizer value)
>           (configuration-field-error #f 'group value))))
>  
>  (define (mpd-log-file-sanitizer value)
> -  (match value
> -    (%unset-value
> -     ;; XXX: While leaving the 'sys_log' option out of the mpd.conf file is
> -     ;; supposed to cause logging to happen via systemd (elogind provides a
> -     ;; compatible interface), this doesn't work (nothing gets logged); use
> -     ;; syslog instead.
> -     "syslog")
> -    ((? string?)
> -     value)
> -    (_ (configuration-field-error #f 'log-file value))))
> +  ;; XXX: While leaving the 'sys_log' option out of the mpd.conf file is
> +  ;; supposed to cause logging to happen via systemd (elogind provides a
> +  ;; compatible interface), this doesn't work (nothing gets logged); use
> +  ;; syslog instead.
> +  (let ((value (maybe-value value "syslog")))
> +    (if (string? value) value (configuration-field-error #f 'log-file 
> value))))

Applied, closing!

-- 
Thanks,
Maxim


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]