summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-10-30 21:43:37 +0100
committerLudovic Courtès <ludo@gnu.org>2013-10-30 22:09:32 +0100
commitc065c443a03960b6d535783ac68f9cff3236d262 (patch)
tree31c91537cb527209c81cadafdf5e1e07b179321e
parentd0dc4907d6dac82ba482472845e83d7411c74ed5 (diff)
union: Make the log port a parameter.
* guix/build/union.scm (union-build): Add 'log-port' keyword parameter; use it.
-rw-r--r--guix/build/union.scm8
1 files changed, 5 insertions, 3 deletions
diff --git a/guix/build/union.scm b/guix/build/union.scm
index 077b7fe530..0f8c87e171 100644
--- a/guix/build/union.scm
+++ b/guix/build/union.scm
@@ -100,7 +100,8 @@ single leaf."
,@(map loop dirs))))
(leaf leaf))))
-(define* (union-build output directories)
+(define* (union-build output directories
+ #:key (log-port (current-error-port)))
"Build in the OUTPUT directory a symlink tree that is the union of all
the DIRECTORIES."
(define (file-tree dir)
@@ -174,6 +175,8 @@ the DIRECTORIES."
(setvbuf (current-output-port) _IOLBF)
(setvbuf (current-error-port) _IOLBF)
+ (when (file-port? log-port)
+ (setvbuf log-port _IOLBF))
(mkdir output)
(let loop ((tree (delete-duplicate-leaves
@@ -189,8 +192,7 @@ the DIRECTORIES."
;; A leaf: create a symlink.
(let* ((dir (string-join dir "/"))
(target (string-append output "/" dir "/" (basename tree))))
- (format (current-error-port) "`~a' ~~> `~a'~%"
- tree target)
+ (format log-port "`~a' ~~> `~a'~%" tree target)
(symlink tree target)))
(((? string? subdir) leaves ...)
;; A sub-directory: create it in OUTPUT, and iterate over LEAVES.