guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/03: union: Do not warn about harmless collisions.


From: Ludovic Courtès
Subject: 01/03: union: Do not warn about harmless collisions.
Date: Thu, 17 May 2018 09:37:23 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 827c56515e06d21aaa23d60ed05b0c45d1d49901
Author: Ludovic Courtès <address@hidden>
Date:   Tue May 15 09:40:23 2018 +0200

    union: Do not warn about harmless collisions.
    
    Until now we'd get pointless messages like:
    
      warning: collision encountered:
        /gnu/store/…-gtk-icon-themes/share/icons/hicolor/icon-theme.cache
        /gnu/store/…-inkscape-0.92.3/share/icons/hicolor/icon-theme.cache
      warning: choosing 
/gnu/store/…-gtk-icon-themes/share/icons/hicolor/icon-theme.cache
    
    * guix/build/union.scm (%harmless-collisions): New variable.
    (warn-about-collision): Honor it.
---
 guix/build/union.scm | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/guix/build/union.scm b/guix/build/union.scm
index 24b366a..fff795c 100644
--- a/guix/build/union.scm
+++ b/guix/build/union.scm
@@ -81,14 +81,23 @@ identical, #f otherwise."
                                    (or (eof-object? n1)
                                        (loop))))))))))))))
 
+(define %harmless-collisions
+  ;; This is a list of files that are known to collide, but for which emitting
+  ;; a warning doesn't make sense.  For example, "icon-theme.cache" is
+  ;; regenerated by a profile hook which shadows the file provided by
+  ;; individual packages, and "gschemas.compiled" is made available to
+  ;; applications via 'glib-or-gtk-build-system'.
+  '("icon-theme.cache" "gschemas.compiled"))
+
 (define (warn-about-collision files)
   "Handle the collision among FILES by emitting a warning and choosing the
 first one of THEM."
-  (format (current-error-port)
-          "~%warning: collision encountered:~%~{  ~a~%~}"
-          files)
   (let ((file (first files)))
-    (format (current-error-port) "warning: choosing ~a~%" file)
+    (unless (member (basename file) %harmless-collisions)
+      (format (current-error-port)
+              "~%warning: collision encountered:~%~{  ~a~%~}"
+              files)
+      (format (current-error-port) "warning: choosing ~a~%" file))
     file))
 
 (define* (union-build output inputs



reply via email to

[Prev in Thread] Current Thread [Next in Thread]