diff options
author | Ludovic Courtès <ludo@gnu.org> | 2017-06-07 09:51:55 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2017-06-21 11:05:53 +0200 |
commit | a654dc4bcf7c8e205bdefa1a1d5f23444dd22778 (patch) | |
tree | e020f5cc14b3d30743cbf9e4a7069a8c5e1125ce /guix/ui.scm | |
parent | 81e3485c0d012e29d4e551107fc31c0da89b0006 (diff) | |
download | guix-patches-a654dc4bcf7c8e205bdefa1a1d5f23444dd22778.tar guix-patches-a654dc4bcf7c8e205bdefa1a1d5f23444dd22778.tar.gz |
profiles: Catch and report collisions in the profile.
* guix/profiles.scm (&profile-collision-error): New error condition.
(manifest-transitive-entries, manifest-entry-lookup, lower-manifest-entry)
(check-for-collisions): New procedures.
(profile-derivation): Add call to 'check-for-collisions'.
* guix/ui.scm (call-with-error-handling): Handle '&profile-collision-error'.
* tests/profiles.scm ("collision", "collision of propagated inputs")
("no collision"): New tests.
Diffstat (limited to 'guix/ui.scm')
-rw-r--r-- | guix/ui.scm | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/guix/ui.scm b/guix/ui.scm index 889c9d0228..c141880316 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -476,6 +476,33 @@ interpreted." (leave (G_ "generation ~a of profile '~a' does not exist~%") (missing-generation-error-generation c) (profile-error-profile c))) + ((profile-collision-error? c) + (let ((entry (profile-collision-error-entry c)) + (conflict (profile-collision-error-conflict c))) + (define (report-parent-entries entry) + (let ((parent (force (manifest-entry-parent entry)))) + (when (manifest-entry? parent) + (report-error (G_ " ... propagated from ~a@~a~%") + (manifest-entry-name parent) + (manifest-entry-version parent)) + (report-parent-entries parent)))) + + (report-error (G_ "profile contains conflicting entries for ~a:~a~%") + (manifest-entry-name entry) + (manifest-entry-output entry)) + (report-error (G_ " first entry: ~a@~a:~a ~a~%") + (manifest-entry-name entry) + (manifest-entry-version entry) + (manifest-entry-output entry) + (manifest-entry-item entry)) + (report-parent-entries entry) + (report-error (G_ " second entry: ~a@~a:~a ~a~%") + (manifest-entry-name conflict) + (manifest-entry-version conflict) + (manifest-entry-output conflict) + (manifest-entry-item conflict)) + (report-parent-entries conflict) + (exit 1))) ((nar-error? c) (let ((file (nar-error-file c)) (port (nar-error-port c))) |