GNU bug report logs -
#71735
[PATCH] services: mpd: fix log to file
Previous Next
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.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#71735: [PATCH] services: mpd: fix log to file
which was filed against the guix-patches package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 71735 <at> debbugs.gnu.org.
--
71735: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71735
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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
[Message part 3 (message/rfc822, inline)]
(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
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.