[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
46/197: installer: Replace "%temporary-configuration-file-port" with "co
From: |
Danny Milosavljevic |
Subject: |
46/197: installer: Replace "%temporary-configuration-file-port" with "config-file". |
Date: |
Mon, 3 Jul 2017 20:36:58 -0400 (EDT) |
dannym pushed a commit to branch wip-installer-2
in repository guix.
commit 0a2d72b4c19ac628f865b0a226d3b9dcf147209a
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)
+
- 53/197: installer: Change N_ from a procedure to a macro., (continued)
- 53/197: installer: Change N_ from a procedure to a macro., Danny Milosavljevic, 2017/07/03
- 50/197: installer: Issue message to user on failure of filesystems task., Danny Milosavljevic, 2017/07/03
- 61/197: installer: Indicate which wireless access points are encrypted., Danny Milosavljevic, 2017/07/03
- 59/197: installer: Format configuration to fix width of window., Danny Milosavljevic, 2017/07/03
- 65/197: installer: Ensure that all mount points are absolute paths., Danny Milosavljevic, 2017/07/03
- 09/197: installer: Use a record instead of a list to contain tasks., Danny Milosavljevic, 2017/07/03
- 23/197: installer: Use a cleaner way of generating the lspci information., Danny Milosavljevic, 2017/07/03
- 35/197: installer: New predicate valid-hostname?, Danny Milosavljevic, 2017/07/03
- 36/197: installer: Ensure that all mount-points have a file system., Danny Milosavljevic, 2017/07/03
- 39/197: installer: Replace an instance of cdr with match., Danny Milosavljevic, 2017/07/03
- 46/197: installer: Replace "%temporary-configuration-file-port" with "config-file".,
Danny Milosavljevic <=
- 30/197: installer: Write the configuration to a temporary file., Danny Milosavljevic, 2017/07/03
- 24/197: installer: Add a new menu to configure wireless interfaces., Danny Milosavljevic, 2017/07/03
- 49/197: installer: Replace spawned mount command with the mount syscall., Danny Milosavljevic, 2017/07/03
- 44/197: installer: Use consistent window heights., Danny Milosavljevic, 2017/07/03
- 52/197: installer: Prevent the user specifying the same mount point twice., Danny Milosavljevic, 2017/07/03
- 51/197: installer: Allow users to remove mount points during configuration., Danny Milosavljevic, 2017/07/03
- 14/197: installer: Add procedures to replace car/cdr since these are frounded upon by Guile gurus., Danny Milosavljevic, 2017/07/03
- 55/197: installer: Use global variable instead of string literal for "/gnu"., Danny Milosavljevic, 2017/07/03
- 54/197: installer: Change the order of the filesystem task conditions., Danny Milosavljevic, 2017/07/03
- 60/197: installer: Do not allow forms to set the cursor visibility., Danny Milosavljevic, 2017/07/03