mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 15:36:20 -05:00
union: Don't warn when colliding leaves point to the same file.
* guix/build/union.scm (union-build)[resolve-collision]: Pass LEAVES through `delete-duplicates'; warn iff the result contains more than one item.
This commit is contained in:
parent
6211223021
commit
1be77eac08
1 changed files with 13 additions and 6 deletions
|
@ -137,13 +137,20 @@ (define (leaf=? a b)
|
|||
|
||||
(define (resolve-collision leaves)
|
||||
;; LEAVES all have the same basename, so choose one of them.
|
||||
(format (current-error-port) "warning: collision encountered: ~{~a ~}~%"
|
||||
leaves)
|
||||
(match (delete-duplicates leaves string=?)
|
||||
((one-and-the-same)
|
||||
;; LEAVES all actually point to the same file, so nothing to worry
|
||||
;; about.
|
||||
one-and-the-same)
|
||||
((and lst (head _ ...))
|
||||
;; A real collision.
|
||||
(format (current-error-port) "warning: collision encountered: ~{~a ~}~%"
|
||||
lst)
|
||||
|
||||
;; TODO: Implement smarter strategies.
|
||||
(format (current-error-port) "warning: arbitrarily choosing ~a~%"
|
||||
(car leaves))
|
||||
(car leaves))
|
||||
;; TODO: Implement smarter strategies.
|
||||
(format (current-error-port) "warning: arbitrarily choosing ~a~%"
|
||||
head)
|
||||
head)))
|
||||
|
||||
(setvbuf (current-output-port) _IOLBF)
|
||||
(setvbuf (current-error-port) _IOLBF)
|
||||
|
|
Loading…
Reference in a new issue