diff options
author | Ludovic Courtès <ludo@gnu.org> | 2013-02-06 22:51:24 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2013-02-06 23:04:10 +0100 |
commit | 6211223021cdb477e93d7ba789d5a0119ffb4bd4 (patch) | |
tree | 7322568ef89680dafdd2a36feca89bd415f3748b /guix/build | |
parent | 44ce77ff52b0456e71ccaabbf3900e71d7a5841f (diff) | |
download | gnu-guix-6211223021cdb477e93d7ba789d5a0119ffb4bd4.tar gnu-guix-6211223021cdb477e93d7ba789d5a0119ffb4bd4.tar.gz |
union: Delete duplicates when passed the same input several times.
* 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.
Diffstat (limited to 'guix/build')
-rw-r--r-- | guix/build/union.scm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/guix/build/union.scm b/guix/build/union.scm index 234964dba5..a6a4450180 100644 --- a/guix/build/union.scm +++ b/guix/build/union.scm @@ -150,8 +150,9 @@ the DIRECTORIES." (mkdir output) (let loop ((tree (delete-duplicate-leaves - (tree-union (append-map (compose tree-leaves file-tree) - directories)) + (cons "." + (tree-union (append-map (compose tree-leaves file-tree) + directories))) leaf=? resolve-collision)) (dir '())) @@ -165,8 +166,9 @@ the DIRECTORIES." (symlink tree target))) (((? string? subdir) leaves ...) ;; A sub-directory: create it in OUTPUT, and iterate over LEAVES. - (let ((dir (string-join dir "/"))) - (mkdir (string-append output "/" dir "/" subdir))) + (unless (string=? subdir ".") + (let ((dir (string-join dir "/"))) + (mkdir (string-append output "/" dir "/" subdir)))) (for-each (cute loop <> `(,@dir ,subdir)) leaves)) ((leaves ...) |