Nikita Karetnikov <nik...@karetnikov.org> skribis:

>> I’d prefer clearer case analysis as shown above.
>
> OK, what do you think about this diff?  If everything is fine, I’ll make
> it output generations in the recutils format.

Cool.  The diff looks great...  but it lacks tests.

What you could do is add the test cases you already have to
tests/profile.scm, say (or tests/ui.scm for ‘string->duration’, and then
put that one in (guix ui)?), along with a simple test in
tests/guix-package.sh.

WDYT?

> (Is it necessary to mention that ‘maybe-comma-separated-integers’ accepts
> something like ‘1,2,3,’ or ‘1,,,2’.  Or should I change the function?)

That’s OK.

> I don’t know if the code works with non-default profiles because my
> store is broken.  When I try to install or build a new package (with or
> without substitutes), I get the following message:
>
> guix package: error: build failed: getting attributes of path 
> `/nix/store/fcwh19ljibqjfx0c3cwnwcc7p31aq227-glibc-2.17-locales': No such 
> file or directory

Arf, what have you dooooone?

Maybe you can try ‘nix-store --verify’ (and port that option to Guix
while you’re at it ;-)).

Minor things:

> +(define (string->generations str)
> +  "Return a list of generations matching a pattern in STR.  This function

Return *the* list of...

> +(define* (available-generations str #:optional (profile %current-profile))

Perhaps ‘matching-generations’?

Thank you!

Ludo’.

Reply via email to