From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: bug#27284: [PATCH 7/8] gexp: 'directory-union' has a #:quiet? parameter. Date: Fri, 20 Oct 2017 18:05:56 +0200 Message-ID: <20171020160557.27096-8-ludo@gnu.org> References: <87poamv2i7.fsf@gnu.org> <20171020160557.27096-1-ludo@gnu.org> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5ZpC-0003ed-Jq for bug-guix@gnu.org; Fri, 20 Oct 2017 12:07:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5ZpB-0007bQ-GR for bug-guix@gnu.org; Fri, 20 Oct 2017 12:07:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:43924) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e5ZpB-0007bG-Cc for bug-guix@gnu.org; Fri, 20 Oct 2017 12:07:05 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <20171020160557.27096-1-ludo@gnu.org> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 27284@debbugs.gnu.org * guix/gexp.scm (directory-union): Add #:quiet? and honor it. --- guix/gexp.scm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/guix/gexp.scm b/guix/gexp.scm index e8ac3dcdc..3781a1e6e 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))))))))) -- 2.14.2