[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
100/197: installer: Do not perform tasks more than once.
From: |
Danny Milosavljevic |
Subject: |
100/197: installer: Do not perform tasks more than once. |
Date: |
Mon, 3 Jul 2017 20:37:07 -0400 (EDT) |
dannym pushed a commit to branch wip-installer-2
in repository guix.
commit 3fd85d74aff69364c8488fc330cead209a251081
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)
- 194/197: guix system: Remove outdated (gnu system grub) import., (continued)
- 194/197: guix system: Remove outdated (gnu system grub) import., Danny Milosavljevic, 2017/07/03
- 197/197: installer: Use "G_" instead of "_"., Danny Milosavljevic, 2017/07/03
- 188/197: installer: Go back to main menu after "cancel", Danny Milosavljevic, 2017/07/03
- 184/197: installer: Create dedicated module to maintainer the page stack., Danny Milosavljevic, 2017/07/03
- 126/197: installer: mount-points page: Enlarge the forms window., Danny Milosavljevic, 2017/07/03
- 96/197: installer: Changed N_ to M_ since N_ is used for another purpose in guix/ui.scm, Danny Milosavljevic, 2017/07/03
- 142/197: gurses: xchar->char: New procedure., Danny Milosavljevic, 2017/07/03
- 85/197: installer: Use "lspci -mm" instead of "lspci -m"., Danny Milosavljevic, 2017/07/03
- 88/197: installer: Use a cleaner method of detecting wireless capability for ethernet interfaces., Danny Milosavljevic, 2017/07/03
- 93/197: installer: Add a dedicated make to format filesystems., Danny Milosavljevic, 2017/07/03
- 100/197: installer: Do not perform tasks more than once.,
Danny Milosavljevic <=
- 106/197: installer: Properly handle swap partitions when generating the configuration., Danny Milosavljevic, 2017/07/03
- 114/197: installer: Check that swap spaces have not been assigned mount points, Danny Milosavljevic, 2017/07/03
- 112/197: gurses: form: Use match instead of car, cdr etc., Danny Milosavljevic, 2017/07/03
- 125/197: installer: Do not assume the root file system is of type "ext4"., Danny Milosavljevic, 2017/07/03
- 130/197: installer: Delete unused procedure "justify"., Danny Milosavljevic, 2017/07/03
- 134/197: installer: Tolerate an undefined system role in config generation., Danny Milosavljevic, 2017/07/03
- 137/197: installer: Prepare for new wireless network features., Danny Milosavljevic, 2017/07/03
- 140/197: installer: Fix the key map option., Danny Milosavljevic, 2017/07/03
- 132/197: installer: Add new procedure to check file system specifications., Danny Milosavljevic, 2017/07/03
- 145/197: gurses: Avoid yet another use of car and cdr., Danny Milosavljevic, 2017/07/03