[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
13/80: installer: Use call-with-temporary-output-file.
From: |
John Darrington |
Subject: |
13/80: installer: Use call-with-temporary-output-file. |
Date: |
Tue, 3 Jan 2017 15:49:41 +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")
- 09/80: installer: Use a record instead of a list to contain tasks., (continued)
- 09/80: installer: Use a record instead of a list to contain tasks., John Darrington, 2017/01/03
- 29/80: installer: Deal with partition tables which are (partially) corrupt., John Darrington, 2017/01/03
- 37/80: installer: Improve dependencies on the final task., John Darrington, 2017/01/03
- 31/80: gnu: Add service to start the installer in installation-os., John Darrington, 2017/01/03
- 36/80: installer: Remove ad-hoc completed predicate and use standard one., John Darrington, 2017/01/03
- 35/80: installer: Make minumum-store-size variable global., John Darrington, 2017/01/03
- 34/80: installer: Add path to mount/umount commands in installer service., John Darrington, 2017/01/03
- 58/80: installer: Allow users to remove mount points during configuration., John Darrington, 2017/01/03
- 11/80: installer: Change "interfaces" from a variable to a procedure., John Darrington, 2017/01/03
- 14/80: installer: Add alternate method of finding TZDIR., John Darrington, 2017/01/03
- 13/80: installer: Use call-with-temporary-output-file.,
John Darrington <=
- 22/80: installer: Return slurped lines in their correct order., John Darrington, 2017/01/03
- 16/80: installer: Use %default-subsitute-urls instead of our own variable., John Darrington, 2017/01/03
- 10/80: installer: Perform a task's dependencies prior to the task itself., John Darrington, 2017/01/03
- 18/80: installer: Add completion predicate for disk task., John Darrington, 2017/01/03
- 20/80: installer: Remove unused procedure., John Darrington, 2017/01/03
- 30/80: installer: Add a variable to represent the minimum recommended store size., John Darrington, 2017/01/03
- 44/80: installer: Add wireless-tools bin directory to PATH., John Darrington, 2017/01/03
- 41/80: install: Define new procedure pipe-cmd and use it to implement window-pipe., John Darrington, 2017/01/03
- 40/80: installer: Ensure that all mount-points have a file system., John Darrington, 2017/01/03
- 42/80: installer: Correct bugs generating the configuration., John Darrington, 2017/01/03