From: Ricardo Wurmus <rekado@elephly.net>
To: "Jakob L. Kreuze" <zerodaysfordays@sdf.lonestar.org>
Cc: 36952@debbugs.gnu.org
Subject: [bug#36952] [PATCH v2] machine: Implement 'roll-back-machine'.
Date: Thu, 08 Aug 2019 12:50:58 +0200 [thread overview]
Message-ID: <87v9v8vskt.fsf@elephly.net> (raw)
In-Reply-To: <87v9v8k82l.fsf_-_@sdf.lonestar.org>
Hi Jakob,
> +(define (roll-back-managed-host machine)
> + "Internal implementation of 'roll-back-machine' for MACHINE instances with
> +an environment type of 'managed-host."
> + (define remote-exp
> + (with-extensions (list guile-gcrypt)
> + (with-imported-modules (source-module-closure '((guix config)
> + (guix profiles)))
> + #~(begin
> + (use-modules (guix config)
> + (guix profiles))
> +
> + (define %system-profile
> + (string-append %state-directory "/profiles/system"))
> +
> + (define target-generation
> + (relative-generation-spec->number %system-profile "-1"))
Can we use “relative-generation” or “previous-generation-number” here?
I think the stringified “-1” is kinda ugly, and the “*-spec” procedure
only exists to handle user input, which is provided as a string.
> + (mlet* %store-monad ((boot-parameters (machine-boot-parameters machine))
> + (_ -> (if (< (length boot-parameters) 2)
> + (raise roll-back-failure)))
> + (entries -> (map boot-parameters->menu-entry
> + (list (second boot-parameters))))
> + (old-entries -> (map boot-parameters->menu-entry
> + (drop boot-parameters 2)))
> + (bootloader -> (operating-system-bootloader
> + (machine-operating-system machine)))
> + (bootcfg (lower-object
> + ((bootloader-configuration-file-generator
> + (bootloader-configuration-bootloader
> + bootloader))
> + bootloader entries
> + #:old-entries old-entries)))
> + (eval -> (cut machine-remote-eval machine <>))
> + (remote-result (machine-remote-eval machine
> +
> remote-exp)))
Is it on purpose that you aren’t using the previously defined “eval”
here?
--
Ricardo
next prev parent reply other threads:[~2019-08-08 10:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-07 12:42 [bug#36952] [PATCH] machine: Implement 'roll-back-machine' Jakob L. Kreuze
2019-08-07 20:11 ` Christopher Lemmer Webber
2019-08-07 20:57 ` [bug#36952] [PATCH v2] " Jakob L. Kreuze
2019-08-07 22:33 ` Christopher Lemmer Webber
2019-08-08 10:50 ` Ricardo Wurmus [this message]
2019-08-08 20:16 ` Jakob L. Kreuze
2019-08-08 20:17 ` [bug#36952] [PATCH v3] " Jakob L. Kreuze
2019-08-14 20:49 ` [bug#36952] [PATCH] " Christopher Lemmer Webber
2019-08-15 11:45 ` bug#36952: " Christopher Lemmer Webber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87v9v8vskt.fsf@elephly.net \
--to=rekado@elephly.net \
--cc=36952@debbugs.gnu.org \
--cc=zerodaysfordays@sdf.lonestar.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.