1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-05-27 19:41:50 +02:00

image: Make 'find-image' non-monadic.

* gnu/system/image.scm (find-image): Make non-monadic.  Add 'target'
parameter.
* gnu/tests/install.scm (run-install): Update caller,
passing (%current-target-system).
* guix/scripts/system.scm (perform-action): Likewise.
This commit is contained in:
Jan (janneke) Nieuwenhuizen
2020-06-11 22:52:12 +02:00
committed by Jan Nieuwenhuizen
parent 3857aba7ab
commit 7ca533c723
3 changed files with 22 additions and 19 deletions
+13 -15
View File
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -556,20 +557,17 @@ image, depending on IMAGE format."
#:grub-mkrescue-environment
'(("MKRESCUE_SED_MODE" . "mbr_only")))))))
(define (find-image file-system-type)
"Find and return an image that could match the given FILE-SYSTEM-TYPE. This
is useful to adapt to interfaces written before the addition of the <image>
record."
(mlet %store-monad ((target (current-target-system)))
(mbegin %store-monad
(return
(match file-system-type
("iso9660" iso9660-image)
(_ (cond
((and target
(hurd-triplet? target))
hurd-disk-image)
(else
efi-disk-image))))))))
(define (find-image file-system-type target)
"Find and return an image built that could match the given FILE-SYSTEM-TYPE,
built for TARGET. This is useful to adapt to interfaces written before the
addition of the <image> record."
(match file-system-type
("iso9660" iso9660-image)
(_ (cond
((and target
(hurd-triplet? target))
hurd-disk-image)
(else
efi-disk-image)))))
;;; image.scm ends here