ui: Avoid "pkg:out" syntax when reporting collisions.
authorLudovic Courtès <ludo@gnu.org>
Tue, 28 Nov 2017 09:18:40 +0000 (10:18 +0100)
committerLudovic Courtès <ludo@gnu.org>
Tue, 28 Nov 2017 09:18:40 +0000 (10:18 +0100)
* guix/ui.scm (call-with-error-handling)[manifest-entry-output*]: New
procedure.  Use it when reporting collisions.

guix/ui.scm

index ae727eb..b657024 100644 (file)
@@ -550,19 +550,24 @@ interpreted."
                                    (manifest-entry-version parent))
                      (report-parent-entries parent))))
 
+               (define (manifest-entry-output* entry)
+                 (match (manifest-entry-output entry)
+                   ("out"   "")
+                   (output (string-append ":" output))))
+
                (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~%")
+               (report-error (G_ "  first entry: ~a@~a~a ~a~%")
                              (manifest-entry-name entry)
                              (manifest-entry-version entry)
-                             (manifest-entry-output entry)
+                             (manifest-entry-output* entry)
                              (manifest-entry-item entry))
                (report-parent-entries entry)
-               (report-error (G_ "  second entry: ~a@~a:~a ~a~%")
+               (report-error (G_ "  second entry: ~a@~a~a ~a~%")
                              (manifest-entry-name conflict)
                              (manifest-entry-version conflict)
-                             (manifest-entry-output conflict)
+                             (manifest-entry-output* conflict)
                              (manifest-entry-item conflict))
                (report-parent-entries conflict)
                (exit 1)))