[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#69343] [PATCH v2 10/12] Simplify profile->boot-alternatives.
From: |
Lilah Tascheter |
Subject: |
[bug#69343] [PATCH v2 10/12] Simplify profile->boot-alternatives. |
Date: |
Fri, 8 Mar 2024 02:12:06 -0600 |
From: Felix Lechner <felix.lechner@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 fd9f0727ee..3df37e5510 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -329,20 +329,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.41.0
- [bug#69343] [PATCH v2 00/12] Simplify bootloader data structures and procedures, Lilah Tascheter, 2024/03/08
- [bug#69343] [PATCH v2 01/12] Fix bug where the extra menu entries for a bootloader were shown twice., Lilah Tascheter, 2024/03/08
- [bug#69343] [PATCH v2 09/12] Give a separate name to a commonly used expression., Lilah Tascheter, 2024/03/08
- [bug#69343] [PATCH v2 06/12] Offer a uniform decorated-boot-label and use it., Lilah Tascheter, 2024/03/08
- [bug#69343] [PATCH v2 05/12] Move epoch->date-string to gnu/system/boot.scm and use it elsewhere., Lilah Tascheter, 2024/03/08
- [bug#69343] [PATCH v2 03/12] Also move boot-parameters->menu-entry., Lilah Tascheter, 2024/03/08
- [bug#69343] [PATCH v2 08/12] Rename two remote variables confusingly named 'generations'., Lilah Tascheter, 2024/03/08
- [bug#69343] [PATCH v2 02/12] Move <boot-parameters> record to a separate file., Lilah Tascheter, 2024/03/08
- [bug#69343] [PATCH v2 10/12] Simplify profile->boot-alternatives.,
Lilah Tascheter <=
- [bug#69343] [PATCH v2 04/12] Rename seconds->string procedure to epoch->date-string., Lilah Tascheter, 2024/03/08
- [bug#69343] [PATCH v2 12/12] Encapsulate <boot-parameters> to retain generation, system-path and epoch., Lilah Tascheter, 2024/03/08
- [bug#69343] [PATCH v2 11/12] Split generation->boot-parameters out of profile->boot-alternatives., Lilah Tascheter, 2024/03/08
- [bug#69343] [PATCH v2 07/12] Rename boot-parameters to boot-alternatives when appropriate., Lilah Tascheter, 2024/03/08
- [bug#69343] Simplify bootloader data structures and procedures, Felix Lechner, 2024/03/08