From b01b8d2a46a6a04cb8f09d74c06cbbc82878f070 Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Thu, 11 Jun 2020 22:52:12 +0200 Subject: [PATCH v2 1/2] image: Make 'find-image' non-monadic. * gnu/system/image.scm (find-image): Make non-monadic. * gnu/tests/install.scm (run-install): Update caller. * guix/scripts/system.scm (perform-action): Likewise. --- gnu/system/image.scm | 21 ++++++++++----------- gnu/tests/install.scm | 5 +++-- guix/scripts/system.scm | 3 ++- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/gnu/system/image.scm b/gnu/system/image.scm index a0e6bf31f1..66a9f6b335 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020 Mathieu Othacehe +;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -551,16 +552,14 @@ image, depending on IMAGE format." "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 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)))))))) + (let ((target (%current-target-system))) + (match file-system-type + ("iso9660" iso9660-image) + (_ (cond + ((and target + (hurd-triplet? target)) + hurd-disk-image) + (else + efi-disk-image)))))) ;;; image.scm ends here diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm index 6bd8c7d3d2..d18e33179f 100644 --- a/gnu/tests/install.scm +++ b/gnu/tests/install.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2017, 2019 Tobias Geerinckx-Rice ;;; Copyright © 2020 Mathieu Othacehe ;;; Copyright © 2020 Danny Milosavljevic +;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -228,8 +229,8 @@ packages defined in installation-os." (mlet* %store-monad ((_ (set-grafting #f)) (system (current-system)) (target (operating-system-derivation target-os)) - (base-image (find-image - installation-disk-image-file-system-type)) + (base-image -> (find-image + installation-disk-image-file-system-type)) ;; Since the installation system has no network access, ;; we cheat a little bit by adding TARGET to its GC diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 3d7aa77cb7..fc92b9f07b 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -5,6 +5,7 @@ ;;; Copyright © 2017, 2019 Mathieu Othacehe ;;; Copyright © 2018 Ricardo Wurmus ;;; Copyright © 2019 Christopher Baines +;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -801,7 +802,7 @@ static checks." (check-initrd-modules os))) (mlet* %store-monad - ((image (find-image file-system-type)) + ((image -> (find-image file-system-type)) (sys (system-derivation-for-action os image action #:file-system-type file-system-type #:image-size image-size -- Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com