GNU bug report logs -
#72803
Add restic commands to the restic-guix package
Previous Next
Reported by: paul <goodoldpaul <at> autistici.org>
Date: Sun, 25 Aug 2024 13:57:02 UTC
Severity: normal
Done: paul <goodoldpaul <at> autistici.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
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
This bug report was last modified today.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.