[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
13/21: installer: Use call-with-temporary-output-file.
From: |
John Darrington |
Subject: |
13/21: installer: Use call-with-temporary-output-file. |
Date: |
Thu, 22 Dec 2016 19:58:40 +0000 (UTC) |
jmd pushed a commit to branch wip-installer
in repository guix.
commit 4db5f1958e778f4472f5c87c6c8e257cf9c3c801
Author: John Darrington <address@hidden>
Date: Wed Dec 21 16:28:09 2016 +0100
installer: Use call-with-temporary-output-file.
* gnu/system/installer/new.scm (base-page-key-handler): Use existing
call-with-temporary-output-file procedure instead of rolling our own.
---
gnu/system/installer/new.scm | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/gnu/system/installer/new.scm b/gnu/system/installer/new.scm
index a9acbfe..9b18251 100644
--- a/gnu/system/installer/new.scm
+++ b/gnu/system/installer/new.scm
@@ -34,6 +34,7 @@
(gnu system installer dialog)
(guix build utils)
+ (guix utils)
(ice-9 format)
(ice-9 match)
@@ -149,13 +150,14 @@
(define (base-page-key-handler page ch)
(cond
((eqv? ch (key-f 1))
- (endwin)
- (let* ((p (mkstemp! (string-copy "/tmp/installer.XXXXXX")))
- (file-name (port-filename p)))
- (format p "echo '~a'\n" (gettext "Type \"exit\" to return to the GuixSD
installer."))
- (close p)
- (system* "bash" "--rcfile" file-name)
- (delete-file file-name)))
+
+ (call-with-temporary-output-file
+ (lambda (file-name port)
+ (endwin)
+ (format port "echo '~a'\n"
+ (gettext "Type \"exit\" to return to the GuixSD installer."))
+ (close port)
+ (system* "bash" "--rcfile" file-name))))
((eqv? ch (key-f 9))
(setlocale LC_ALL "de_DE.UTF-8")
- 06/21: installer: use ice-9 format everywhere., (continued)
- 06/21: installer: use ice-9 format everywhere., John Darrington, 2016/12/22
- 03/21: installer: Remove obsolete procedures/variables, John Darrington, 2016/12/22
- 07/21: installer: Use ice-9 match., John Darrington, 2016/12/22
- 20/21: installer: Remove unused procedure., John Darrington, 2016/12/22
- 14/21: installer: Add alternate method of finding TZDIR., John Darrington, 2016/12/22
- 21/21: gnu: guix: Add dependency: guile-ncurses., John Darrington, 2016/12/22
- 17/21: installer: Add new procedure to get the list of volumes., John Darrington, 2016/12/22
- 18/21: installer: Add completion predicate for disk task., John Darrington, 2016/12/22
- 04/21: installer: Fix broken timezone menu., John Darrington, 2016/12/22
- 11/21: installer: Change "interfaces" from a variable to a procedure., John Darrington, 2016/12/22
- 13/21: installer: Use call-with-temporary-output-file.,
John Darrington <=
- 08/21: installer: Add IETF contraints for hostname in entry form., John Darrington, 2016/12/22
- 19/21: installer: Handle the 'back' action in the filesystems task., John Darrington, 2016/12/22
- 12/21: installer: Add gurses modules., John Darrington, 2016/12/22
- 10/21: installer: Perform a task's dependencies prior to the task itself., John Darrington, 2016/12/22
- 09/21: installer: Use a record instead of a list to contain tasks., John Darrington, 2016/12/22
- 16/21: installer: Use %default-subsitute-urls instead of our own variable., John Darrington, 2016/12/22
- 15/21: installer: Add procedures to replace car/cdr since these are frounded upon by Guile gurus., John Darrington, 2016/12/22
- 01/21: gnu: Add graphical installer, John Darrington, 2016/12/22