[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
10/12: installer: Do not perform tasks more than once.
From: |
John Darrington |
Subject: |
10/12: installer: Do not perform tasks more than once. |
Date: |
Sun, 15 Jan 2017 15:45:40 +0000 (UTC) |
jmd pushed a commit to branch wip-installer
in repository guix.
commit decf49baf16c7f5c2bceffcc01ec69c330ea2e3a
Author: John Darrington <address@hidden>
Date: Sun Jan 15 13:31:19 2017 +0100
installer: Do not perform tasks more than once.
* gnu/system/installer/guixsd-installer.scm (uniquify): New procedure.
(main-page-key-handler): Use it to remove duplicates from the page stack.
---
gnu/system/installer/guixsd-installer.scm | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/gnu/system/installer/guixsd-installer.scm
b/gnu/system/installer/guixsd-installer.scm
index 7c79d14..348e073 100644
--- a/gnu/system/installer/guixsd-installer.scm
+++ b/gnu/system/installer/guixsd-installer.scm
@@ -197,6 +197,19 @@
(do-task task-name page))))
task-name-list))
+
+(define (uniquify in)
+ "Remove duplicates from the list IN. Keep the items which are closest to the
+tail of the list."
+ (let loop ((l (reverse in))
+ (acc '()))
+ (if (null? l)
+ acc
+ (loop (cdr l)
+ (if (member (car l) (cdr l))
+ acc
+ (cons (car l) acc))))))
+
(define (main-page-key-handler page ch)
(let ((main-menu (page-datum page 'menu)))
(std-menu-key-handler main-menu ch)
@@ -204,6 +217,7 @@
((eq? ch #\newline)
(let ((item (menu-get-current-item main-menu)))
(do-task (car item) page)
+ (set! page-stack (uniquify page-stack))
((page-refresh (car page-stack)) (car page-stack)))))))
(define (main-page-init page)
- branch wip-installer updated (3673cd8 -> ac6599d), John Darrington, 2017/01/15
- 08/12: installer: Correct bug detecting a wireless interface., John Darrington, 2017/01/15
- 01/12: installer: Add callback parameter for forms., John Darrington, 2017/01/15
- 04/12: installer: Add the notion of uuids to prospective filesystems., John Darrington, 2017/01/15
- 05/12: installer: Add a predicate to ensure the partitions have been formatted., John Darrington, 2017/01/15
- 09/12: installer: Exit the format page after all partitions are successfully formatted., John Darrington, 2017/01/15
- 11/12: installer: Replace one usage of car with match., John Darrington, 2017/01/15
- 10/12: installer: Do not perform tasks more than once.,
John Darrington <=
- 12/12: installer: Correct bug where the timezone page returned to the wrong page., John Darrington, 2017/01/15
- 02/12: installer: Remove mkfs capability from mount points page., John Darrington, 2017/01/15
- 06/12: installer: Changed N_ to M_ since N_ is used for another purpose in guix/ui.scm, John Darrington, 2017/01/15
- 07/12: installer: Whitespace changes only, John Darrington, 2017/01/15
- 03/12: installer: Add a dedicated make to format filesystems., John Darrington, 2017/01/15