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.
* guix/build/union.scm (union-build): Prepend "." to the result of
`union-tree', to match the expectations of `delete-duplicate-leaves'.
Don't do mkdir when SUBDIR is ".".
* tests/union.scm ("union-build"): Keep duplicates in %BOOTSTRAP-INPUTS.
* guix/build/union.scm (delete-duplicate-leaves): New procedure.
(union-build)[leaf=?, resolve-collision]: New procedures.
Use `delete-duplicate-leaves' on the result of `tree-union'.
* tests/union.scm ("delete-duplicate-leaves, default",
"delete-duplicate-leaves, file names"): New tests.