GNU bug report logs - #69343
[PATCH 00/12] Simplify bootloader data structures and procedures

Previous Next

Package: guix-patches;

Reported by: Felix Lechner <felix.lechner <at> lease-up.com>

Date: Sat, 24 Feb 2024 01:09:02 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: Lilah Tascheter <lilah <at> lunabee.space>
To: 69343 <at> debbugs.gnu.org
Cc: Herman Rimm <herman <at> rimm.ee>, Felix Lechner <felix.lechner <at> lease-up.com>, Christopher Baines <guix <at> cbaines.net>, Josselin Poiret <dev <at> jpoiret.xyz>, Ludovic Court??s <ludo <at> gnu.org>, Mathieu Othacehe <othacehe <at> gnu.org>, Simon Tournier <zimon.toutoune <at> gmail.com>, Tobias Geerinckx-Rice <me <at> tobias.gr>
Subject: [bug#69343] [PATCH v4 09/11] Simplify profile->boot-alternatives.
Date: Thu, 19 Sep 2024 23:16:03 -0500
From: Felix Lechner <felix.lechner <at> lease-up.com>

* 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))
 
 
 ;;;
-- 
2.45.2





This bug report was last modified 267 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.