all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bruno Victal <mirai@makinata.eu>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 64471@debbugs.gnu.org
Subject: [bug#64471] [PATCH 1/2] services: Add 'file-database' service.
Date: Thu, 13 Jul 2023 19:00:46 +0100	[thread overview]
Message-ID: <f8137c18-9f4e-1eb3-2926-691b9ffd3957@makinata.eu> (raw)
In-Reply-To: <fbf1fdda8cf716739bc47446f8a3948ececcced3.1688550926.git.ludo@gnu.org>

Hi Ludo’,

On 2023-07-05 11:16, Ludovic Courtès wrote:
> +(define-record-type* <file-database-configuration>
> +  file-database-configuration make-file-database-configuration
> +  file-database-configuration?
> +  (package              file-database-configuration-package
> +                        (default
> +                          (let-system (system target)
> +                            ;; Unless we're cross-compiling, avoid pulling a
> +                            ;; second copy of findutils.
> +                            (if target
> +                                findutils
> +                                (canonical-package findutils)))))
> +  (schedule             file-database-configuration-schedule
> +                        (default %default-file-database-update-schedule))
> +  (excluded-directories file-database-configuration-excluded-directories
> +                        (default %default-file-database-excluded-directories)))

How about using define-configuration instead to have the documentation neatly
in sync with the fields?

> +
> +(define (file-database-mcron-jobs configuration)
> +  (match-record configuration <file-database-configuration>
> +    (package schedule excluded-directories)
> +    (let ((updatedb (program-file
> +                     "updatedb"
> +                     #~(execl #$(file-append package "/bin/updatedb")
> +                              "updatedb"
> +                              #$(string-append "--prunepaths="
> +                                               (string-join
> +                                                excluded-directories))))))
> +      (list #~(job #$schedule #$updatedb)))))

I'm afraid #$schedule might be insufficient if this is a _mcron_ time-spec.
There's an elaborate dance done by fstrim-service-type to handle the more exotic
mcron time expressions, perhaps you can reuse it here?


-- 
Furthermore, I consider that nonfree software must be eradicated.

Cheers,
Bruno.





  reply	other threads:[~2023-07-13 18:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-05  9:59 [bug#64471] [PATCH 0/2] File database update services Ludovic Courtès
2023-07-05 10:16 ` [bug#64471] [PATCH 1/2] services: Add 'file-database' service Ludovic Courtès
2023-07-13 18:00   ` Bruno Victal [this message]
2023-07-17 20:22     ` [bug#64471] [PATCH 0/2] File database update services Ludovic Courtès
2023-07-20 21:22       ` [bug#64471] [PATCH v2 1/2] services: Add 'file-database' service Ludovic Courtès
2023-07-26 13:28         ` Bruno Victal
2023-07-20 21:22       ` [bug#64471] [PATCH v2 2/2] services: Add 'package-database' service Ludovic Courtès
2023-07-26 13:22       ` [bug#64471] [PATCH 0/2] File database update services Bruno Victal
2023-07-05 10:16 ` [bug#64471] [PATCH 2/2] services: Add 'package-database' service Ludovic Courtès
2023-08-07 14:39 ` bug#64471: [PATCH 0/2] File database update services Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f8137c18-9f4e-1eb3-2926-691b9ffd3957@makinata.eu \
    --to=mirai@makinata.eu \
    --cc=64471@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.