From patchwork Fri Sep 20 04:16:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lilah Tascheter X-Patchwork-Id: 68149 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 AC04427BBEA; Fri, 20 Sep 2024 05:18:14 +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=unavailable 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 6DCE027BBE2 for ; Fri, 20 Sep 2024 05:18:14 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1srV5f-0008DO-4m; Fri, 20 Sep 2024 00:17:55 -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 1srV5a-0008Ck-Lt for guix-patches@gnu.org; Fri, 20 Sep 2024 00:17:50 -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 1srV5a-0006Go-CF; Fri, 20 Sep 2024 00:17:50 -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=3vJs6hPqNL85y9eyKAWNH9jAawLjkkIzXe+vUd+liNM=; b=Jb+rP136NbRbEt5vBVaJD/X5xEL+kWxZ5v+rlStGp5VK8rCMqgroYxp7a9Zx6kyVzWCnY60w8NPP15zlk3eO9Q0bM/9unt564aEsYoymnLIXIzZouct0r18vpC6a+vyjaZKC7zTSQLUPeTMu37Nuokt9X65z7JEu9EhrsmWv8NKnL0JJWUFpZyT/35fnLusEpfFCZbbg+0s7CK8/9xYGajVexo/0G0o4gK/P1NikigS8V9HVoGf5Fuz9L8QMD5K6vM+WEMxTnBb4rNCKcG4ZuFj0QWSftD6gaKLVZrbOQHan6mSFgdHHDhT89UgoJ6DlIS42b2v98vRxGJsgnYiMEQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1srV5r-0005Ug-0T; Fri, 20 Sep 2024 00:18:07 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69343] [PATCH v4 09/11] Simplify profile->boot-alternatives. Resent-From: Lilah Tascheter Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Fri, 20 Sep 2024 04:18:06 +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 , Christopher Baines , Josselin Poiret , Ludovic Court??s , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic Court??s , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 69343-submit@debbugs.gnu.org id=B69343.172680587820989 (code B ref 69343); Fri, 20 Sep 2024 04:18:06 +0000 Received: (at 69343) by debbugs.gnu.org; 20 Sep 2024 04:17:58 +0000 Received: from localhost ([127.0.0.1]:33761 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srV5h-0005SM-Vj for submit@debbugs.gnu.org; Fri, 20 Sep 2024 00:17:58 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:49290) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srV5f-0005Ri-TA for 69343@debbugs.gnu.org; Fri, 20 Sep 2024 00:17:56 -0400 DKIM-Signature: a=rsa-sha256; b=Z7gGcFRH42ouJUBrC0jepZS1ktTdpjQhORxFfBFBLpWlncOMnbP8Rz04cfhh45Eiurg8iJmPA+dKZAvogpbMiKuXWoXUbkxuss+YVqejdPGsw92v052pT/T/knsXrzFJ4xqS/68JujQXjpCdI6dMIrUAajq+JV0dAIgI15W9yr3xJpjJkIPqkF3UQmm5DD1rNEQekbTDk8D7gkK+hXSUUR1zwOxq5Dr017hEeBryVGyZl0SrB6xHKYs0W7cFcsFjbhBe0523PL3NCduxLXyYu08aevVmSFQdzy7c/VheittESOV7QRHqYMcypPs5rzfHO5GuTtS25cmWcbHFkBpcyw==; s=purelymail3; d=lunabee.space; v=1; bh=NWG6NUH0mK7gkG+sq9A+xR0W0wwVR7O7WawedBxVieU=; h=Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=XqSx6r2ltKsSS4M22PWdusyBYhIN86heZBGfEsSRrAoIXK1MPzDFg4RIkyzTQ8Oc1iTKKMiBatLD880f5PiFXntZxjS1JQ3aPugLYOoC5/rBm4J5EsezitYfcMsHp6ICaklJTUXvZsm9kwaF5tooHyIvGzN17W9AHWnkQg+PBoaMyL9am9yKcXYwjIREW0RBMB8Fjbp7mid7ogPk4iPzCFkoQNON2hXJnYTYalXOVi4Y+0oNsiypQgryPYM6j2CygsAke0/ZkHW+/c+7B+uu79E9+eV7lk1JQQv8TG6sOZbPwXJLMlTEEECP3a/t9S8LcvOdvGoXMeFvlpK1h/61/g==; s=purelymail3; d=purelymail.com; v=1; bh=NWG6NUH0mK7gkG+sq9A+xR0W0wwVR7O7WawedBxVieU=; 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:19 +0000 (UTC) Date: Thu, 19 Sep 2024 23:16:03 -0500 Message-ID: <5cfea442dfbae70e44123556783d4df9e69113be.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 * guix/scripts/system.scm (profile->boot-alternatives)[system->boot-parameters]: Rename to generation->boot-parameters and factor out processing from... (profile->boot-alternatives): ...here. Change-Id: If31eeb4cef4f5a107a0ee5ad3f117bf38629ac38 --- guix/scripts/system.scm | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index cdd78a7849..a4dd7a8054 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -334,20 +334,16 @@ (define* (profile->boot-alternatives #:optional (profile %system-profile) "Return a list of 'boot-parameters' for the generations of PROFILE specified by NUMBERS, which is a list of generation numbers. The list is ordered from the most recent to the oldest profiles." - (define (system->boot-parameters system number epoch) + (define (generation->boot-parameters number) (unless-file-not-found - (let* ((params (read-boot-parameters-file system)) + (let* ((system (generation-file-name profile number)) + (params (read-boot-parameters-file system)) + (epoch (stat:mtime (lstat system))) (text (boot-parameters-label params))) (boot-parameters (inherit params) (label (decorated-boot-label text number epoch)))))) - (let* ((systems (map (cut generation-file-name profile <>) - numbers)) - (times (map (lambda (system) - (unless-file-not-found - (stat:mtime (lstat system)))) - systems))) - (filter-map system->boot-parameters systems numbers times))) + (filter-map generation->boot-parameters numbers)) ;;;