[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/13: gexp: 'directory-union' has a #:resolve-collision parameter.
From: |
Ludovic Courtès |
Subject: |
04/13: gexp: 'directory-union' has a #:resolve-collision parameter. |
Date: |
Sun, 8 Apr 2018 12:04:15 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit b244ae25f9d5d09ef62f59249c794601b1433886
Author: Ludovic Courtès <address@hidden>
Date: Sun Apr 8 16:22:25 2018 +0200
gexp: 'directory-union' has a #:resolve-collision parameter.
* guix/gexp.scm (directory-union): Add #:resolve-collision and honor it.
---
guix/gexp.scm | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/guix/gexp.scm b/guix/gexp.scm
index b47965d..448eeed 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -1250,7 +1250,8 @@ This yields an 'etc' directory containing these two
files."
files))))))
(define* (directory-union name things
- #:key (copy? #f) (quiet? #f))
+ #:key (copy? #f) (quiet? #f)
+ (resolve-collision 'warn-about-collision))
"Return a directory that is the union of THINGS, where THINGS is a list of
file-like objects denoting directories. For example:
@@ -1258,6 +1259,10 @@ file-like objects denoting directories. For example:
yields a directory that is the union of the 'guile' and 'emacs' packages.
+Call RESOLVE-COLLISION when several files collide, passing it the list of
+colliding files. RESOLVE-COLLISION must return the chosen file or #f, in
+which case the colliding entry is skipped altogether.
+
When HARD-LINKS? is true, create hard links instead of symlinks. When QUIET?
is true, the derivation will not print anything."
(define symlink
@@ -1281,12 +1286,16 @@ is true, the derivation will not print anything."
(computed-file name
(with-imported-modules '((guix build union))
(gexp (begin
- (use-modules (guix build union))
+ (use-modules (guix build union)
+ (srfi srfi-1)) ;for 'first' and
'last'
+
(union-build (ungexp output)
'(ungexp things)
#:log-port (ungexp log-port)
- #:symlink (ungexp symlink)))))))))
+ #:symlink (ungexp symlink)
+ #:resolve-collision
+ (ungexp resolve-collision)))))))))
;;;
- branch master updated (8f3448f -> f6dfb8b), Ludovic Courtès, 2018/04/08
- 11/13: cuirass: Add job specs for the modular Guix., Ludovic Courtès, 2018/04/08
- 04/13: gexp: 'directory-union' has a #:resolve-collision parameter.,
Ludovic Courtès <=
- 13/13: hydra: Clear '%load-compiled-path' for gnu-system.scm., Ludovic Courtès, 2018/04/08
- 02/13: modules: Report the search path in &missing-dependency-error., Ludovic Courtès, 2018/04/08
- 07/13: build-self: Use (guix self)., Ludovic Courtès, 2018/04/08
- 10/13: cuirass: Factorize hydra-to-cuirass CI job translation., Ludovic Courtès, 2018/04/08
- 08/13: build: Add 'as-derivation' target., Ludovic Courtès, 2018/04/08
- 06/13: Add (guix self)., Ludovic Courtès, 2018/04/08
- 03/13: union: Allow callers to choose the collision resolution policy., Ludovic Courtès, 2018/04/08
- 09/13: discovery: Remove dependency on (guix ui)., Ludovic Courtès, 2018/04/08
- 01/13: tests: Skip 'pivot-root' test on Ubuntu's 4.4 kernels., Ludovic Courtès, 2018/04/08
- 12/13: hydra: 'guix-modular' jobs use the new 'build-self'., Ludovic Courtès, 2018/04/08