From patchwork Fri Sep 20 04:16:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lilah Tascheter X-Patchwork-Id: 68156 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 29CD927BBEA; Fri, 20 Sep 2024 05:18:52 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,PDS_OTHER_BAD_TLD, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9EF9D27BBE2 for ; Fri, 20 Sep 2024 05:18:51 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1srV5l-0008Gn-EN; Fri, 20 Sep 2024 00:18:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1srV5Z-0008BX-Fa for guix-patches@gnu.org; Fri, 20 Sep 2024 00:17:49 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1srV5Z-0006GT-6o for guix-patches@gnu.org; Fri, 20 Sep 2024 00:17:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=mJb8zogLkciBCSKtTzIaU7yL8M3u+6r2DO6mrNaoYOk=; b=b9aF5/nD7nFgu+tXSn7/8WhzuwFe649wmag2fNG+lCMTb8yiTATwhS19DJTyFok81M6X7vCPMntcai8S6cs9byDDVyGMdfqS2PVHHkOC8tVlIuVrmMTB1TZubuTdSop12t4XSQYMY5QIrz0paX0O6ie4/nFqJinO6YzVGqzF6qeLG2SIic6PAHpE4UuwRB24EIDTPmx0k8h9EO4EcYjF3bTCtCA3gekKjwz/XQWSXsSbvUKXsIk88PxwxhXdAP2ZrlCmnQYbTPWwabQ6GRIP/QksPYBnCpnnW2cSXQkk8E8Fn9Pam62NGgjVgWddwPqi6a3RL83sbikQ/ck3mQGOBA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1srV5r-0005Uq-GE for guix-patches@gnu.org; Fri, 20 Sep 2024 00:18:07 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69343] [PATCH v4 08/11] Give a separate name to a commonly used expression. Resent-From: Lilah Tascheter Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 20 Sep 2024 04:18:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69343 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69343@debbugs.gnu.org Cc: Herman Rimm , Felix Lechner Received: via spool by 69343-submit@debbugs.gnu.org id=B69343.172680588421062 (code B ref 69343); Fri, 20 Sep 2024 04:18:07 +0000 Received: (at 69343) by debbugs.gnu.org; 20 Sep 2024 04:18:04 +0000 Received: from localhost ([127.0.0.1]:33777 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srV5n-0005TT-Lx for submit@debbugs.gnu.org; Fri, 20 Sep 2024 00:18:04 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:45866) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srV5g-0005Rm-Ns for 69343@debbugs.gnu.org; Fri, 20 Sep 2024 00:17:57 -0400 DKIM-Signature: a=rsa-sha256; b=n7Dc9fsCHGIqmT8CxI+iNHoZLp1ykUQRibyYyj2WwNd77X7q4pgZ6xCiMJm0noQjei06SWyLB6MqKaRa6yafZGmnWz5dOk7LzRWuFp9Hp/ADVyENGPTZRGI0UBSg7f0A/xXq0cBmNxQjrVtOfz+wTKTyie/hFCJfcM+eci4oN7Grl0bJrwb+ElXHYSj6h2nc6IaDh9rkIZ/jnYZqaufSZ4lgYr85Q1mi4EmErMmyUTJ4dLLfIGnnFpGn8xFTDE/w5+LkDwoYVAxGSe15yw61NBLA9MiFf/JFKPXuRcwxDNA2aappiwOuve8RX9YWTC5RW03q3mk2mB2Ji11XYvqrTQ==; s=purelymail3; d=lunabee.space; v=1; bh=tUvD0ZLiDclvWKVBcWJbB0D6FAVkMJQpUX9BbzR++hc=; h=Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=uzb+BWicjSXZXDruVLtzb8B05JHGjR7yxe+/ldYuN2F23qvetEKzZWzSmLMfUaDvhQkVF1fVuE6mXu6PjMtR/GsLYU0fBPWONuOBxMU3eFMs/LWdDY/gWy6m0KCjihyDq6uGOQ09Ez/gRGYpD1ZVq9E0/LLGsNZCW8yX4bcsXl9X/vszAnttsTMWZB+F7yE2jg1jMRkkcNwHuBRbv9O+l758doTM5rqT1b0vCuJQAXxfeQHUm8nOxp8hqhCWA2ycoITwnque3dfS+gznDjPGNTX+BKQvV30yXZBkd5HfYwIEtxAjTak36uCDQ/A0P2OBlOEj0MkwXOb/Hhn8N+5tCA==; s=purelymail3; d=purelymail.com; v=1; bh=tUvD0ZLiDclvWKVBcWJbB0D6FAVkMJQpUX9BbzR++hc=; h=Feedback-ID:Received:From:To:Subject:Date; Feedback-ID: 8937:2070:null:purelymail X-Pm-Original-To: 69343@debbugs.gnu.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -100958845; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Fri, 20 Sep 2024 04:17:18 +0000 (UTC) Date: Thu, 19 Sep 2024 23:16:02 -0500 Message-ID: <6e4fc53df2ff12590bfa557c38f4ea03446f5749.1726805765.git.lilah@lunabee.space> In-Reply-To: References: MIME-Version: 1.0 X-MIME-Autoconverted: from 8bit to quoted-printable by Purelymail X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Lilah Tascheter via Guix-patches From: Lilah Tascheter Reply-To: Lilah Tascheter Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: Felix Lechner * gnu/machine/ssh.scm (roll-back-managed-host): Factor out a subexpression into new variable parameters. Change-Id: I8d70684142bea736042d6c9dc8276ea7bdb9c181 --- gnu/machine/ssh.scm | 47 +++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm index a96ca68f47..37806a2e1b 100644 --- a/gnu/machine/ssh.scm +++ b/gnu/machine/ssh.scm @@ -580,31 +580,28 @@ (define (roll-back-managed-host machine) (define roll-back-failure (condition (&message (message (G_ "could not roll-back machine"))))) - (mlet* %store-monad ((boot-alternatives (machine->boot-alternatives machine)) - (_ -> (if (< (length boot-alternatives) 2) - (raise roll-back-failure))) - (entries -> (map boot-parameters->menu-entry - (list (second boot-alternatives)))) - (locale -> (boot-parameters-locale - (second boot-alternatives))) - (crypto-dev -> (boot-parameters-store-crypto-devices - (second boot-alternatives))) - (store-dir -> (boot-parameters-store-directory-prefix - (second boot-alternatives))) - (old-entries -> (map boot-parameters->menu-entry - (drop boot-alternatives 2))) - (bootloader -> (operating-system-bootloader - (machine-operating-system machine))) - (bootcfg (lower-object - ((bootloader-configuration-file-generator - (bootloader-configuration-bootloader - bootloader)) - bootloader entries - #:locale locale - #:store-crypto-devices crypto-dev - #:store-directory-prefix store-dir - #:old-entries old-entries))) - (remote-result (machine-remote-eval machine remote-exp))) + (mlet* %store-monad + ((boot-alternatives (machine->boot-alternatives machine)) + (_ -> (if (< (length boot-alternatives) 2) (raise roll-back-failure))) + (parameters (second boot-alternatives)) + (entries -> (list (boot-parameters->menu-entry parameters))) + (locale -> (boot-parameters-locale parameters)) + (crypto-dev -> (boot-parameters-store-crypto-devices parameters)) + (store-dir -> (boot-parameters-store-directory-prefix parameters)) + (old-entries -> (map boot-parameters->menu-entry + (drop boot-alternatives 2))) + (bootloader -> (operating-system-bootloader + (machine-operating-system machine))) + (bootcfg (lower-object + ((bootloader-configuration-file-generator + (bootloader-configuration-bootloader + bootloader)) + bootloader entries + #:locale locale + #:store-crypto-devices crypto-dev + #:store-directory-prefix store-dir + #:old-entries old-entries))) + (remote-result (machine-remote-eval machine remote-exp))) (when (eqv? 'error remote-result) (raise roll-back-failure))))