GNU bug report logs - #26075
[PATCH -v3 1/2] build: union: Add create-all-directories? parameter to union-build

Previous Next

Package: guix-patches;

Reported by: Huang Ying <huang.ying.caritas <at> gmail.com>

Date: Sun, 12 Mar 2017 18:15:02 UTC

Severity: normal

Tags: patch

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: tracker <at> debbugs.gnu.org
Subject: bug#26075: closed ([PATCH -v3 1/2] build: union: Add
 create-all-directories? parameter to union-build)
Date: Sun, 26 Mar 2017 10:56:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sun, 26 Mar 2017 12:55:22 +0200
with message-id <87wpbcs3xh.fsf <at> gnu.org>
and subject line Re: bug#26075: [PATCH -v3 1/2] build: union: Add create-all-directories? parameter to union-build
has caused the debbugs.gnu.org bug report #26075,
regarding [PATCH -v3 1/2] build: union: Add create-all-directories? parameter to union-build
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
26075: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=26075
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Huang Ying <huang.ying.caritas <at> gmail.com>
To: guix-devel <at> gnu.org
Cc: Huang Ying <huang.ying.caritas <at> gmail.com>, guix-patches <at> gnu.org
Subject: [PATCH -v3 1/2] build: union: Add create-all-directories? parameter
 to union-build
Date: Sun, 12 Mar 2017 19:53:58 +0800
* guix/build/union.scm (union-build): Add create-all-directories? keyword
  parameter.
---
 guix/build/union.scm | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/guix/build/union.scm b/guix/build/union.scm
index 6640b5652..b852bc66e 100644
--- a/guix/build/union.scm
+++ b/guix/build/union.scm
@@ -73,9 +73,12 @@ identical, #f otherwise."
                                   (loop)))))))))))))
 
 (define* (union-build output inputs
-                      #:key (log-port (current-error-port)))
-  "Build in the OUTPUT directory a symlink tree that is the union of all
-the INPUTS."
+                      #: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.  As a special case, if CREATE-ALL-DIRECTORIES?, creates the
+subdirectories in the output directory to make sure the caller can modify them
+later."
 
   (define (symlink* input output)
     (format log-port "`~a' ~~> `~a'~%" input output)
@@ -104,8 +107,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




[Message part 3 (message/rfc822, inline)]
From: ludo <at> gnu.org (Ludovic Courtès)
To: "Huang\, Ying" <huang_ying_caritas <at> 163.com>
Cc: guix-devel <at> gnu.org, 26075-done <at> debbugs.gnu.org,
 Huang Ying <huang.ying.caritas <at> gmail.com>
Subject: Re: bug#26075: [PATCH -v3 1/2] build: union: Add
 create-all-directories? parameter to union-build
Date: Sun, 26 Mar 2017 12:55:22 +0200
Hi!

I’ve pushed it with a copyright line for you, and with a unit test for
‘union-build’ with #:create-all-directories? #t:

  https://git.savannah.gnu.org/cgit/guix.git/commit/?id=addce19e2d38a197f5ea10eefb5f3cd25c3a52e7
  https://git.savannah.gnu.org/cgit/guix.git/commit/?id=0a5ce0d1df3befa2c4e018e84da3bd66c9eac48d

Thank you!

Ludo’.


This bug report was last modified 8 years and 62 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.