summaryrefslogtreecommitdiff
path: root/guix/gexp.scm
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2018-04-10 00:42:22 -0400
committerMark H Weaver <mhw@netris.org>2018-04-10 00:42:22 -0400
commitf89aa1521af69b0e1a1350c2380579788b0f8945 (patch)
tree5009cca687ac669ef846920877cbfb6fffdd9893 /guix/gexp.scm
parent169c658f7f286efae397fa3eda55b1c56fa92a01 (diff)
parent60e1de6d95bd32b4996c199708541781b8f828fd (diff)
downloadgnu-guix-f89aa1521af69b0e1a1350c2380579788b0f8945.tar
gnu-guix-f89aa1521af69b0e1a1350c2380579788b0f8945.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/gexp.scm')
-rw-r--r--guix/gexp.scm15
1 files changed, 12 insertions, 3 deletions
diff --git a/guix/gexp.scm b/guix/gexp.scm
index 2deec253ff..bedb387edb 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -1258,7 +1258,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:
@@ -1266,6 +1267,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
@@ -1289,12 +1294,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)))))))))
;;;