all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: paul via Guix-patches via <guix-patches@gnu.org>
To: Fabio Natali <me@fabionatali.com>, 72803@debbugs.gnu.org
Subject: [bug#72803] Add restic commands to the restic-guix package
Date: Thu, 5 Sep 2024 00:19:30 +0200	[thread overview]
Message-ID: <2d83c75b-b750-b80d-5d7c-b4a6c89b4434@autistici.org> (raw)
In-Reply-To: <8734mhfz6e.fsf@fabionatali.com>

Hi Fabio,

thank you very much for your detailed testing and review.

On 9/3/24 00:50, Fabio Natali wrote:
> Perhaps this should now read "...the current job restic invokation..."
> or "...the current restic invokation...", as the action is no longer
> limited to "backup"?

Definitely, good catch.

>>       (program-file
>> -     "restic-backup-job.scm"
>> +     (string-append "restic-" action "-" name "-program.scm")
> Should 'name' be slug-ified in any way here? E.g. to avoid spaces,
> capital letters, symbols that might be confusing when part of a file
> name, etc.
It should, right. I'll use the same approach used for the 
home-dotfiles-service-type (i.e. replacing illegal characters with "-").
>> +  (define action-table
>> +    (map
>> +     (lambda (action)
>> +       (list action
>> +             (map (lambda (job)
>> +                    (list (restic-backup-job-name job)
>> +                          (restic-action-program job action)))
>> +                  jobs)))
>> +     ;; run is an alias for backup
>> +     (filter (lambda (a) (not (string=? a "run"))) supported-actions)))
> Could this be (marginally) simpler if we used two nested association
> lists? That way, 'get-program' might simply use 'assoc-ref' (twice) and
> 'assoc-table' would be redundant?
I thought that as well, in fact my first implementation was with Guile's 
vhashes but it appears that neither alists nor vhashesh can be correctly 
ungexped, or at least I didn't find a way to do so. This is why I'm 
using plain lists and I need assoc-table. If you have some pointer where 
I could look how to lower alists it would be very helpful.
> It'd be nice to have a little test suite for this, but in case this can
> be part of a future patch.

There are already some tests Richard made at #71639 , once they get in 
I'll make sure to expand them for additional restic-guix subcommands.

Thank your for your review Fabio, I'm sending a patchset addressing your 
comments.

giacomo





  parent reply	other threads:[~2024-09-04 22:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-25 13:54 [bug#72803] Add restic commands to the restic-guix package paul via Guix-patches via
2024-08-25 13:56 ` [bug#72803] [PATCH] services: restic-backup: Add more " Giacomo Leidi via Guix-patches via
2024-09-02 22:50   ` [bug#72803] Add " Fabio Natali via Guix-patches via
2024-09-02 23:01     ` Fabio Natali via Guix-patches via
2024-09-04 22:19     ` paul via Guix-patches via [this message]
2024-09-04 22:29 ` [bug#72803] [PATCH v2] services: restic-backup: Add more " Giacomo Leidi via Guix-patches via
2024-10-20 22:58 ` [bug#72803] Add " paul via Guix-patches via
2024-10-20 22:58 ` [bug#72803] [PATCH v2] services: restic-backup: Add more " Giacomo Leidi via Guix-patches via

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=2d83c75b-b750-b80d-5d7c-b4a6c89b4434@autistici.org \
    --to=guix-patches@gnu.org \
    --cc=72803@debbugs.gnu.org \
    --cc=goodoldpaul@autistici.org \
    --cc=me@fabionatali.com \
    /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.