From addce19e2d38a197f5ea10eefb5f3cd25c3a52e7 Mon Sep 17 00:00:00 2001 From: Huang Ying Date: Sun, 12 Mar 2017 19:53:58 +0800 Subject: union: Add create-all-directories? parameter to 'union-build'. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/build/union.scm (union-build): Add create-all-directories? keyword parameter. * tests/union.scm ("union-build #:create-all-directories? #t"): New test. Co-authored-by: Ludovic Courtès --- tests/union.scm | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/union.scm b/tests/union.scm index cccf397181..b63edc757b 100644 --- a/tests/union.scm +++ b/tests/union.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès +;;; Copyright © 2012, 2013, 2014, 2015, 2017 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -124,4 +124,24 @@ (define %store ;; new 'bin' sub-directory in the profile. (eq? 'directory (stat:type (lstat "bin")))))))) +(test-assert "union-build #:create-all-directories? #t" + (let* ((build `(begin + (use-modules (guix build union)) + (union-build (assoc-ref %outputs "out") + (map cdr %build-inputs) + #:create-all-directories? #t))) + (input (package-derivation %store %bootstrap-guile)) + (drv (build-expression->derivation %store "union-test-all-dirs" + build + #:modules '((guix build union)) + #:inputs `(("g" ,input))))) + (and (build-derivations %store (list drv)) + (with-directory-excursion (derivation->output-path drv) + ;; Even though there's only one input to the union, + ;; #:create-all-directories? #t must have created bin/ rather than + ;; making it a symlink to Guile's bin/. + (and (file-exists? "bin/guile") + (file-is-directory? "bin") + (eq? 'symlink (stat:type (lstat "bin/guile")))))))) + (test-end) -- cgit v1.2.3