Subject: [bug#66099] [PATCH gnome-team v7 2/5] services: udev: unify udev-rule and file->udev-rule.

From: Maxim Cournoyer <[email-masked]>
Date: Thu, 05 Oct 2023 09:33:33 -0400

Oops, I just noted something:

Vivien Kraus <[email-masked]> writes:

> * gnu/services/base.scm (udev-rule): Implements in terms of file->udev-rule.
> Use texinfo in docstring.
> ---
>  gnu/services/base.scm | 17 +++--------------
>  1 file changed, 3 insertions(+), 14 deletions(-)
>
> diff --git a/gnu/services/base.scm b/gnu/services/base.scm
> index b3f2d2e8b8..190803b780 100644
> --- a/gnu/services/base.scm
> +++ b/gnu/services/base.scm
> @@ -2211,20 +2211,9 @@ (define (udev-rules-union packages)
>    (computed-file "udev-rules" build))
>  
>  (define (udev-rule file-name contents)
> -  "Return a directory with a udev rule file FILE-NAME containing CONTENTS."
> -  (computed-file file-name
> -                 (with-imported-modules '((guix build utils))
> -                   #~(begin
> -                       (use-modules (guix build utils))
> -
> -                       (define rules.d
> -                         (string-append #$output "/lib/udev/rules.d"))
> -
> -                       (mkdir-p rules.d)
> -                       (call-with-output-file
> -                           (string-append rules.d "/" #$file-name)
> -                         (lambda (port)
> -                           (display #$contents port)))))))
> +  "Return a directory with a udev rule file @var{file-name} containing
> +@var{contents}."
> +  (file->udev-rule file-name (plain-file file-name contents)))

I'm not sure using Texinfo in plain docstrings provides much; there's no
tooling to render them and it's a convention to use FULL CAPS for
variable names in Guile doc strings, at least in the Guix code base.

I'd leave it as is.

-- 
Thanks,
Maxim