[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
41/80: install: Define new procedure pipe-cmd and use it to implement wi
From: |
John Darrington |
Subject: |
41/80: install: Define new procedure pipe-cmd and use it to implement window-pipe. |
Date: |
Tue, 3 Jan 2017 15:49:43 +0000 (UTC) |
jmd pushed a commit to branch wip-installer
in repository guix.
commit e5ce40657b4dfae60bbe301edb1df3e4a0ec9624
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))))
- 11/80: installer: Change "interfaces" from a variable to a procedure., (continued)
- 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, 2017/01/03
- 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 <=
- 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
- 47/80: installer: Turn off kernel ring messages to console., John Darrington, 2017/01/03
- 39/80: installer: New predicate valid-hostname?, John Darrington, 2017/01/03
- 48/80: installer: Enable scrolling in the installation window., John Darrington, 2017/01/03
- 46/80: installer: Add inetutils bin directory to PATH., John Darrington, 2017/01/03
- 33/80: installer: Write the configuration to a temporary file., John Darrington, 2017/01/03
- 61/80: installer: Change the order of the filesystem task conditions., John Darrington, 2017/01/03
- 43/80: gnu: Add guix to the path environment for the guix-installer service., John Darrington, 2017/01/03
- 45/80: installer: Replace an instance of cdr with match., John Darrington, 2017/01/03