unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH -v2 1/2] build: union: Add create-all-directories? parameter to union-build
@ 2017-03-07 11:07 Huang Ying
  2017-03-07 11:07 ` [PATCH -v2 2/2] guix: profiles: create fonts.dir/scale for all fonts directories Huang Ying
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Huang Ying @ 2017-03-07 11:07 UTC (permalink / raw)
  To: guix-devel

* guix/build/union.scm (union-build): Add create-all-directories? keyword
  parameter.  To add/remove some files from the directory.
---
 guix/build/union.scm | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/guix/build/union.scm b/guix/build/union.scm
index 6640b5652..6a2a0f546 100644
--- a/guix/build/union.scm
+++ b/guix/build/union.scm
@@ -73,7 +73,8 @@ identical, #f otherwise."
                                   (loop)))))))))))))
 
 (define* (union-build output inputs
-                      #:key (log-port (current-error-port)))
+                      #:key (log-port (current-error-port))
+                      (create-all-directories? #f))
   "Build in the OUTPUT directory a symlink tree that is the union of all
 the INPUTS."
 
@@ -104,8 +105,11 @@ the INPUTS."
   (define (union output inputs)
     (match inputs
       ((input)
-       ;; There's only one input, so just make a link.
-       (symlink* input output))
+       ;; There's only one input, so just make a link unless
+       ;; create-all-directories?.
+       (if (and create-all-directories? (file-is-directory? input))
+           (union-of-directories output inputs)
+           (symlink* input output)))
       (_
        (call-with-values (lambda () (partition file-is-directory? inputs))
          (match-lambda*
-- 
2.12.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-03-09 11:43 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-07 11:07 [PATCH -v2 1/2] build: union: Add create-all-directories? parameter to union-build Huang Ying
2017-03-07 11:07 ` [PATCH -v2 2/2] guix: profiles: create fonts.dir/scale for all fonts directories Huang Ying
2017-03-07 20:24   ` Danny Milosavljevic
2017-03-08  7:44     ` huang ying
2017-03-08 17:18       ` Ludovic Courtès
2017-03-09 11:42         ` Huang, Ying
2017-03-08 17:24   ` Ludovic Courtès
2017-03-09 11:41     ` Huang, Ying
2017-03-07 20:35 ` [PATCH -v2 1/2] build: union: Add create-all-directories? parameter to union-build Danny Milosavljevic
2017-03-07 20:54   ` Danny Milosavljevic
2017-03-08  7:43   ` huang ying
2017-03-08 17:16 ` Ludovic Courtès
2017-03-09 11:43   ` Huang, Ying

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).