[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
37/197: install: Define new procedure pipe-cmd and use it to implement w
From: |
Danny Milosavljevic |
Subject: |
37/197: install: Define new procedure pipe-cmd and use it to implement window-pipe. |
Date: |
Mon, 3 Jul 2017 20:36:56 -0400 (EDT) |
dannym pushed a commit to branch wip-installer-2
in repository guix.
commit 7eea11231df8596f187b2391316cf06106a2c826
Author: John Darrington <address@hidden>
Date: Mon Dec 26 15:22:12 2016 +0100
install: Define new procedure pipe-cmd and use it to implement window-pipe.
* gnu/system/installer/utils.scm (pipe-cmd): New procedure. (window-pipe)
reimplement.
---
gnu/system/installer/utils.scm | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/gnu/system/installer/utils.scm b/gnu/system/installer/utils.scm
index 5ea4964..b8e257d 100644
--- a/gnu/system/installer/utils.scm
+++ b/gnu/system/installer/utils.scm
@@ -39,6 +39,7 @@
find-mount-device
window-pipe
+ pipe-cmd
N_
@@ -68,11 +69,17 @@
(define* (window-pipe win cmd #:rest args)
"Run CMD ARGS ... sending stdout and stderr to WIN. Returns the exit status
of CMD."
- (let* ((windowp (make-window-port win))
+ (let* ((windowp (make-window-port win)))
+ (clear win)
+ (apply pipe-cmd windowp cmd args)
+ (close-port windowp)))
+
+(define* (pipe-cmd ipipe cmd #:rest args)
+ "Run CMD ARGS ... sending stdout and stderr to IPIPE. Returns the exit
status of CMD."
+ (let* (
(pipep (pipe))
(pid (primitive-fork)))
- (clear win)
(if (zero? pid)
(begin
(redirect-port (cdr pipep) (current-output-port))
@@ -81,11 +88,10 @@
(begin
(close (cdr pipep))
(let loop ((c (read-char (car pipep))))
- (if (not (eof-object? c))
- (begin
- (display c windowp)
- (force-output windowp)
- (loop (read-char (car pipep))))))))
+ (unless (eof-object? c)
+ (display c ipipe)
+ (force-output ipipe)
+ (loop (read-char (car pipep)))))))
(cdr (waitpid pid))))
- 25/197: installer: Connect ethernet interfaces on selection., (continued)
- 25/197: installer: Connect ethernet interfaces on selection., Danny Milosavljevic, 2017/07/03
- 03/197: installer: Remove obsolete procedures/variables, Danny Milosavljevic, 2017/07/03
- 10/197: installer: Perform a task's dependencies prior to the task itself., Danny Milosavljevic, 2017/07/03
- 22/197: installer: Make "interfaces" return an alist., Danny Milosavljevic, 2017/07/03
- 26/197: installer: Let the kernel know about (possibly) changed partitions., Danny Milosavljevic, 2017/07/03
- 27/197: installer: Deal with partition tables which are (partially) corrupt., Danny Milosavljevic, 2017/07/03
- 28/197: installer: Add a variable to represent the minimum recommended store size., Danny Milosavljevic, 2017/07/03
- 32/197: installer: Remove ad-hoc completed predicate and use standard one., Danny Milosavljevic, 2017/07/03
- 34/197: installer: Replace some instances of "car"., Danny Milosavljevic, 2017/07/03
- 40/197: installer: Turn off kernel ring messages to console., Danny Milosavljevic, 2017/07/03
- 37/197: install: Define new procedure pipe-cmd and use it to implement window-pipe.,
Danny Milosavljevic <=
- 41/197: installer: Enable scrolling in the installation window., Danny Milosavljevic, 2017/07/03
- 38/197: installer: Correct bugs generating the configuration., Danny Milosavljevic, 2017/07/03
- 45/197: installer: Fix bug where window-pipe did not return the proper exit status., Danny Milosavljevic, 2017/07/03
- 43/197: installer: Rename module "new" to "guixsd-installer"., Danny Milosavljevic, 2017/07/03
- 42/197: installer: Wrap installer in (catch #t ...), Danny Milosavljevic, 2017/07/03
- 48/197: installer: Close unused ports in pipe-cmd., Danny Milosavljevic, 2017/07/03
- 47/197: installer: Improve install page., Danny Milosavljevic, 2017/07/03
- 29/197: installer: Add a task to actually call guix system init., Danny Milosavljevic, 2017/07/03
- 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