aboutsummaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-10-19 16:10:18 +0200
committerLudovic Courtès <ludo@gnu.org>2017-11-21 23:09:16 +0100
commitde98b302a1794365ee88e2d78c5afff9296054b8 (patch)
treee6e4b607e212d809830ca82a2573e4a0e5e43804 /guix
parent59523429d61083f410d54ac8f8516c66459c1003 (diff)
downloadgnu-guix-de98b302a1794365ee88e2d78c5afff9296054b8.tar
gnu-guix-de98b302a1794365ee88e2d78c5afff9296054b8.tar.gz
gexp: 'directory-union' has a #:quiet? parameter.
* guix/gexp.scm (directory-union): Add #:quiet? and honor it.
Diffstat (limited to 'guix')
-rw-r--r--guix/gexp.scm11
1 files changed, 9 insertions, 2 deletions
diff --git a/guix/gexp.scm b/guix/gexp.scm
index e8ac3dcdc8..3781a1e6ee 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -1205,7 +1205,7 @@ This yields an 'etc' directory containing these two files."
files))))))
(define* (directory-union name things
- #:key (copy? #f))
+ #:key (copy? #f) (quiet? #f))
"Return a directory that is the union of THINGS, where THINGS is a list of
file-like objects denoting directories. For example:
@@ -1213,7 +1213,8 @@ file-like objects denoting directories. For example:
yields a directory that is the union of the 'guile' and 'emacs' packages.
-When COPY? is true, copy files instead of creating symlinks."
+When HARD-LINKS? is true, create hard links instead of symlinks. When QUIET?
+is true, the derivation will not print anything."
(define symlink
(if copy?
(gexp (lambda (old new)
@@ -1222,6 +1223,11 @@ When COPY? is true, copy files instead of creating symlinks."
(copy-file old new))))
(gexp symlink)))
+ (define log-port
+ (if quiet?
+ (gexp (%make-void-port "w"))
+ (gexp (current-error-port))))
+
(match things
((one)
;; Only one thing; return it.
@@ -1234,6 +1240,7 @@ When COPY? is true, copy files instead of creating symlinks."
(union-build (ungexp output)
'(ungexp things)
+ #:log-port (ungexp log-port)
#:symlink (ungexp symlink)))))))))