summaryrefslogtreecommitdiff
path: root/guix/gexp.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2018-09-09 17:40:35 +0200
committerMarius Bakke <mbakke@fastmail.com>2018-09-09 17:40:35 +0200
commit0aeb13485055975d71ec8283040f007c79599bba (patch)
treea06139136c809b00d166d6d66bdf757f20566704 /guix/gexp.scm
parentb03f270e3d5ab5315b50ef3ebac35735cc28d4a2 (diff)
parent0084744b3af0a6f8e125120143f57567902339a8 (diff)
downloadgnu-guix-0aeb13485055975d71ec8283040f007c79599bba.tar
gnu-guix-0aeb13485055975d71ec8283040f007c79599bba.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/gexp.scm')
-rw-r--r--guix/gexp.scm39
1 files changed, 22 insertions, 17 deletions
diff --git a/guix/gexp.scm b/guix/gexp.scm
index 3a600c3830..770b79e012 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -1417,26 +1417,31 @@ denoting the target file. Here's an example:
`((\"hosts\" ,(plain-file \"hosts\"
\"127.0.0.1 localhost\"))
(\"bashrc\" ,(plain-file \"bashrc\"
- \"alias ls='ls --color'\"))))
+ \"alias ls='ls --color'\"))
+ (\"libvirt/qemu.conf\" ,(plain-file \"qemu.conf\" \"\"))))
This yields an 'etc' directory containing these two files."
(computed-file name
- (gexp
- (begin
- (mkdir (ungexp output))
- (chdir (ungexp output))
- (ungexp-splicing
- (map (match-lambda
- ((target source)
- (gexp
- (begin
- ;; Stat the source to abort early if it does
- ;; not exist.
- (stat (ungexp source))
-
- (symlink (ungexp source)
- (ungexp target))))))
- files))))))
+ (with-imported-modules '((guix build utils))
+ (gexp
+ (begin
+ (use-modules (guix build utils))
+
+ (mkdir (ungexp output))
+ (chdir (ungexp output))
+ (ungexp-splicing
+ (map (match-lambda
+ ((target source)
+ (gexp
+ (begin
+ ;; Stat the source to abort early if it does
+ ;; not exist.
+ (stat (ungexp source))
+
+ (mkdir-p (dirname (ungexp target)))
+ (symlink (ungexp source)
+ (ungexp target))))))
+ files)))))))
(define* (directory-union name things
#:key (copy? #f) (quiet? #f)