[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
10/21: installer: Replace "%temporary-configuration-file-port" with "con
From: |
John Darrington |
Subject: |
10/21: installer: Replace "%temporary-configuration-file-port" with "config-file". |
Date: |
Sat, 31 Dec 2016 14:54:18 +0000 (UTC) |
jmd pushed a commit to branch wip-installer
in repository guix.
commit 0a82d35a8558af6f73a1a760725e6513396481b3
Author: John Darrington <address@hidden>
Date: Wed Dec 28 12:42:09 2016 +0100
installer: Replace "%temporary-configuration-file-port" with "config-file".
* gnu/system/installer/guixsd-installer.scm,
gnu/system/installer/install.scm,
gnu/system/installer/misc.scm, gnu/system/installer/configure.scm: Replace
%temporary-configuration-file-port with config-file.
---
gnu/system/installer/configure.scm | 10 ++++++----
gnu/system/installer/guixsd-installer.scm | 7 +++----
gnu/system/installer/install.scm | 3 +--
gnu/system/installer/misc.scm | 6 +++---
4 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/gnu/system/installer/configure.scm
b/gnu/system/installer/configure.scm
index 20b766b..a7cf3bf 100644
--- a/gnu/system/installer/configure.scm
+++ b/gnu/system/installer/configure.scm
@@ -79,10 +79,12 @@
((buttons-key-matches-symbol? nav ch 'save)
- ;; Write the configuration
- (truncate-file %temporary-configuration-file-port 0)
- (generate-guix-config %temporary-configuration-file-port)
- (force-output %temporary-configuration-file-port)
+
+ ;; Write the configuration and set the file name
+ (let ((cfg-port (mkstemp! (string-copy "/tmp/guix-config-XXXXXX"))))
+ (generate-guix-config cfg-port)
+ (set! config-file (port-filename cfg-port))
+ (close-port cfg-port))
;; Close the menu and return
(delwin (outer (page-wwin page)))
diff --git a/gnu/system/installer/guixsd-installer.scm
b/gnu/system/installer/guixsd-installer.scm
index 9ce144b..a69a715 100644
--- a/gnu/system/installer/guixsd-installer.scm
+++ b/gnu/system/installer/guixsd-installer.scm
@@ -114,10 +114,9 @@
(generate . , (make-task generate-menu-title
'(filesystems timezone hostname)
(lambda ()
- (let ((filename
- (port-filename
%temporary-configuration-file-port)))
- (and (file-exists? filename)
- (positive? (stat:size (stat
filename))))))
+ (and config-file
+ (file-exists? config-file)
+ (positive? (stat:size (stat
config-file)))))
(lambda (page)
(make-configure-page
diff --git a/gnu/system/installer/install.scm b/gnu/system/installer/install.scm
index 8521b30..44da10c 100644
--- a/gnu/system/installer/install.scm
+++ b/gnu/system/installer/install.scm
@@ -75,7 +75,6 @@
((buttons-key-matches-symbol? nav ch 'continue)
(let ((target "/target")
- (tmp-config (port-filename %temporary-configuration-file-port))
(window-port (make-window-port config-window))
(root-device (find-mount-device "/" mount-points)))
@@ -94,7 +93,7 @@
(zero? (pipe-cmd window-port "mount"
"mount" "-t" "ext4" root-device target))
(mkdir-p (string-append target "/etc"))
- (or (copy-file tmp-config
+ (or (copy-file config-file
(string-append target "/etc/config.scm"))
#t)
diff --git a/gnu/system/installer/misc.scm b/gnu/system/installer/misc.scm
index 291974e..e9e9083 100644
--- a/gnu/system/installer/misc.scm
+++ b/gnu/system/installer/misc.scm
@@ -22,7 +22,7 @@
#:export (livery-title)
#:export (time-zone)
#:export (host-name)
- #:export (%temporary-configuration-file-port)
+ #:export (config-file)
#:export (mount-points))
(define livery-title 1)
@@ -33,5 +33,5 @@
(define host-name "")
-(define %temporary-configuration-file-port
- (mkstemp! (string-copy "/tmp/guix-config-XXXXXX")))
+(define config-file #f)
+
- 04/21: installer: Turn off kernel ring messages to console., (continued)
- 04/21: installer: Turn off kernel ring messages to console., John Darrington, 2016/12/31
- 01/21: installer: Add wireless-tools bin directory to PATH., John Darrington, 2016/12/31
- 02/21: installer: Replace an instance of cdr with match., John Darrington, 2016/12/31
- 12/21: installer: Close unused ports in pipe-cmd., John Darrington, 2016/12/31
- 08/21: installer: Use consistent window heights., John Darrington, 2016/12/31
- 20/21: installer: Do not use /tmp for holding the configuration., John Darrington, 2016/12/31
- 14/21: installer: Issue message to user on failure of filesystems task., John Darrington, 2016/12/31
- 07/21: installer: Rename module "new" to "guixsd-installer"., John Darrington, 2016/12/31
- 13/21: installer: Replace spawned mount command with the mount syscall., John Darrington, 2016/12/31
- 11/21: installer: Improve install page., John Darrington, 2016/12/31
- 10/21: installer: Replace "%temporary-configuration-file-port" with "config-file".,
John Darrington <=
- 19/21: installer: Use global variable instead of string literal for "/gnu"., John Darrington, 2016/12/31
- 17/21: installer: Change N_ from a procedure to a macro., John Darrington, 2016/12/31
- 18/21: installer: Change the order of the filesystem task conditions., John Darrington, 2016/12/31
- 15/21: installer: Allow users to remove mount points during configuration., John Darrington, 2016/12/31
- 21/21: installer: Add a console-keymap service., John Darrington, 2016/12/31
- 09/21: installer: Fix bug where window-pipe did not return the proper exit status., John Darrington, 2016/12/31