Just log duplicates once, to avoid the duplicate logging
This commit is contained in:
parent
de476a8b40
commit
1f9626d058
1 changed files with 20 additions and 14 deletions
|
|
@ -659,8 +659,9 @@
|
|||
store
|
||||
proc))
|
||||
|
||||
(define (sort-and-deduplicate-inferior-packages packages
|
||||
pkg-to-replacement-hash-table)
|
||||
(define* (sort-and-deduplicate-inferior-packages packages
|
||||
pkg-to-replacement-hash-table
|
||||
#:key log-duplicates?)
|
||||
(let ((sorted-packages
|
||||
(sort packages
|
||||
(lambda (a b)
|
||||
|
|
@ -727,21 +728,23 @@
|
|||
(and (eq? #f a-replacement)
|
||||
(eq? #f b-replacement))))
|
||||
(begin
|
||||
(simple-format (current-error-port)
|
||||
"warning: ignoring duplicate package: ~A@~A (replacement: ~A, location: ~A)\n"
|
||||
a-name
|
||||
a-version
|
||||
a-replacement
|
||||
(location-line a-location))
|
||||
(print-packages-matching-name-and-version
|
||||
a-name
|
||||
a-version)
|
||||
(when log-duplicates?
|
||||
(simple-format (current-error-port)
|
||||
"warning: ignoring duplicate package: ~A@~A (replacement: ~A, location: ~A)\n"
|
||||
a-name
|
||||
a-version
|
||||
a-replacement
|
||||
(location-line a-location))
|
||||
(print-packages-matching-name-and-version
|
||||
a-name
|
||||
a-version))
|
||||
result)
|
||||
(cons a result)))))
|
||||
'()
|
||||
sorted-packages)))
|
||||
|
||||
(define (inferior-packages-plus-replacements inf)
|
||||
(define* (inferior-packages-plus-replacements inf
|
||||
#:key log-duplicates?)
|
||||
(let* ((packages
|
||||
;; The use of force in (guix inferior) introduces a continuation
|
||||
;; barrier
|
||||
|
|
@ -800,7 +803,8 @@
|
|||
;; TODO Sort introduces a continuation barrier
|
||||
(sort-and-deduplicate-inferior-packages
|
||||
(append! packages non-exported-replacements)
|
||||
pkg-to-replacement-hash-table)))))
|
||||
pkg-to-replacement-hash-table
|
||||
#:log-duplicates? log-duplicates?)))))
|
||||
|
||||
(deduplicated-packages-length
|
||||
(length deduplicated-packages)))
|
||||
|
|
@ -2099,7 +2103,9 @@ SELECT store_path FROM derivation_source_files WHERE id = $1"
|
|||
(with-time-logging "getting all inferior package data"
|
||||
(let ((packages
|
||||
pkg-to-replacement-hash-table
|
||||
(inferior-packages-plus-replacements inferior)))
|
||||
(inferior-packages-plus-replacements
|
||||
inferior
|
||||
#:log-duplicates? #t)))
|
||||
(all-inferior-packages-data
|
||||
inferior
|
||||
packages
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue