GNU bug report logs - #71735
[PATCH] services: mpd: fix log to file

Previous Next

Package: guix-patches;

Reported by: Yarl Baudig <yarl-baudig <at> mailoo.org>

Date: Sun, 23 Jun 2024 14:18:01 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 71735 in the body.
You can then email your comments to 71735 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#71735; Package guix-patches. (Sun, 23 Jun 2024 14:18:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Yarl Baudig <yarl-baudig <at> mailoo.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sun, 23 Jun 2024 14:18:01 GMT) Full text and rfc822 format available.

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

From: Yarl Baudig <yarl-baudig <at> mailoo.org>
To: guix-patches <at> gnu.org
Cc: Yarl Baudig <yarl-baudig <at> mailoo.org>
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







Reply sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
You have taken responsibility. (Mon, 24 Jun 2024 01:47:03 GMT) Full text and rfc822 format available.

Notification sent to Yarl Baudig <yarl-baudig <at> mailoo.org>:
bug acknowledged by developer. (Mon, 24 Jun 2024 01:47:03 GMT) Full text and rfc822 format available.

Message #10 received at 71735-done <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Yarl Baudig <yarl-baudig <at> mailoo.org>
Cc: 71735-done <at> debbugs.gnu.org
Subject: Re: [bug#71735] [PATCH] services: mpd: fix log to file
Date: Sun, 23 Jun 2024 21:45:23 -0400
Hi Yarl,

Yarl Baudig <yarl-baudig <at> 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




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 22 Jul 2024 11:24:14 GMT) Full text and rfc822 format available.

This bug report was last modified 329 days ago.

Previous Next


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