Subject: Re: [bug#42634] [PATCH 2/3] system: image: Add image-type support.

From: Ludovic Courtès <[email-masked]>
Date: Thu, 24 Sep 2020 17:37:53 +0200

Mathieu Othacehe <[email-masked]> skribis:

> * gnu/system/image.scm (image-with-os): New macro. Rename the old
> "image-with-os" procedure to ...
> (image-with-os*): ... this new procedure,
> (system-image): adapt according,
> (raw-image-type, iso-image-type, uncompressed-iso-image-type
> %image-types): new variables,
> (lookup-image-type-by-name): new procedure.
> (find-image): remove it.
> * gnu/system/images/hurd.scm (hurd-image-type): New variable,
> use it to define ...
> (hurd-disk-image): ... this variable, using "os->image" procedure.
> * gnu/tests/install.scm (run-install): Rename
> installation-disk-image-file-system-type parameter to installation-image-type,
> use os->config instead of find-image to compute the image passed to system-image,
> (%test-iso-image-installer) adapt accordingly,
> (guided-installation-test): ditto.

[...]

> +(define (lookup-image-type-by-name name)
> +  "Return the image type called NAME."
> +  (or (srfi-1:find (lambda (image-type)
> +                     (string=? name (image-type-name image-type)))
> +                   (force %image-types))
> +      (leave (G_ "~a: no such image type.~%") name)))

I’d raise a ‘&formatted-message’ condition instead.  That allows you to
remove (guix ui) from the loop.

You can also remove the period from the message here sine it’s not a
sentence.

Otherwise LGTM!

Ludo’.