aboutsummaryrefslogtreecommitdiff
path: root/tests/union.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-09-02 23:03:03 +0200
committerLudovic Courtès <ludo@gnu.org>2013-09-02 23:04:25 +0200
commit43dd92024ab54921fbf85285d04344cb2c6e77cc (patch)
tree802ce4e8c2eab83358c0f1cd95373bd49ec76440 /tests/union.scm
parent165fd9d5e628120a8355aec2d03f0b6f497d3db2 (diff)
downloadpatches-43dd92024ab54921fbf85285d04344cb2c6e77cc.tar
patches-43dd92024ab54921fbf85285d04344cb2c6e77cc.tar.gz
union: Don't traverse sub-directories only found in one element of the union.
This significantly reduces I/O when building profiles, especially with lots of package-specific sub-directories (such as 'share/emacs/24.3', 'texmf', etc.) * guix/build/union.scm (union-build)[file-tree](others-have-it?): New procedure. Use it in the 'enter?' parameter of 'file-system-fold'; change 'skip' parameter accordingly. * tests/union.scm ("union-build"): Ensure that 'include' is a symlink and 'bin' is a directory.
Diffstat (limited to 'tests/union.scm')
-rw-r--r--tests/union.scm12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/union.scm b/tests/union.scm
index 9816882101..6287cffc38 100644
--- a/tests/union.scm
+++ b/tests/union.scm
@@ -114,7 +114,17 @@
(file-exists? "bin/ld")
(file-exists? "lib/libc.so")
(directory-exists? "lib/gcc")
- (file-exists? "include/unistd.h"))))))
+ (file-exists? "include/unistd.h")
+
+ ;; The 'include' sub-directory is only found in
+ ;; glibc-bootstrap, so it should be unified in a
+ ;; straightforward way, without traversing it.
+ (eq? 'symlink (stat:type (lstat "include")))
+
+ ;; Conversely, several inputs have a 'bin' sub-directory, so
+ ;; unifying it requires traversing them all, and creating a
+ ;; new 'bin' sub-directory in the profile.
+ (eq? 'directory (stat:type (lstat "bin"))))))))
(test-end)