Give a separate name to a commonly used expression.

* gnu/machine/ssh.scm (roll-back-managed-host): Factor out a
  subexpression into new variable parameters.

Change-Id: I8d70684142bea736042d6c9dc8276ea7bdb9c181
This commit is contained in:
Felix Lechner 2024-09-21 12:23:21 +02:00 committed by Ryan Schanzenbacher
parent b13726dd98
commit 8356f8c2ba
Signed by: ryan77627
GPG key ID: 81B0E222A3E2308E

View file

@ -582,31 +582,29 @@ (define target-generation
(define roll-back-failure (define roll-back-failure
(condition (&message (message (G_ "could not roll-back machine"))))) (condition (&message (message (G_ "could not roll-back machine")))))
(mlet* %store-monad ((boot-alternatives (machine->boot-alternatives machine)) (mlet* %store-monad
(_ -> (if (< (length boot-alternatives) 2) ((boot-alternatives (machine->boot-alternatives machine))
(raise roll-back-failure))) (_ -> (when (< (length boot-alternatives) 2)
(entries -> (map boot-parameters->menu-entry (raise roll-back-failure)))
(list (second boot-alternatives)))) (parameters (second boot-alternatives))
(locale -> (boot-parameters-locale (entries -> (list (boot-parameters->menu-entry parameters)))
(second boot-alternatives))) (locale -> (boot-parameters-locale parameters))
(crypto-dev -> (boot-parameters-store-crypto-devices (crypto-dev -> (boot-parameters-store-crypto-devices parameters))
(second boot-alternatives))) (store-dir -> (boot-parameters-store-directory-prefix parameters))
(store-dir -> (boot-parameters-store-directory-prefix (old-entries -> (map boot-parameters->menu-entry
(second boot-alternatives))) (drop boot-alternatives 2)))
(old-entries -> (map boot-parameters->menu-entry (bootloader -> (operating-system-bootloader
(drop boot-alternatives 2))) (machine-operating-system machine)))
(bootloader -> (operating-system-bootloader (bootcfg (lower-object
(machine-operating-system machine))) ((bootloader-configuration-file-generator
(bootcfg (lower-object (bootloader-configuration-bootloader
((bootloader-configuration-file-generator bootloader))
(bootloader-configuration-bootloader bootloader entries
bootloader)) #:locale locale
bootloader entries #:store-crypto-devices crypto-dev
#:locale locale #:store-directory-prefix store-dir
#:store-crypto-devices crypto-dev #:old-entries old-entries)))
#:store-directory-prefix store-dir (remote-result (machine-remote-eval machine remote-exp)))
#:old-entries old-entries)))
(remote-result (machine-remote-eval machine remote-exp)))
(when (eqv? 'error remote-result) (when (eqv? 'error remote-result)
(raise roll-back-failure)))) (raise roll-back-failure))))