From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37669) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIVOM-0007sl-1P for guix-patches@gnu.org; Tue, 15 May 2018 04:33:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fIVOI-0000iY-3j for guix-patches@gnu.org; Tue, 15 May 2018 04:33:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:55277) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fIVOI-0000iG-05 for guix-patches@gnu.org; Tue, 15 May 2018 04:33:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fIVOH-0007VQ-R0 for guix-patches@gnu.org; Tue, 15 May 2018 04:33:01 -0400 Subject: [bug#31458] [PATCH] union: Do not warn about harmless collissions. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37346) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIVN9-0007Ra-Mj for guix-patches@gnu.org; Tue, 15 May 2018 04:32:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fIVN3-0008Jo-UT for guix-patches@gnu.org; Tue, 15 May 2018 04:31:51 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Tue, 15 May 2018 10:31:19 +0200 Message-Id: <20180515083119.12788-1-ludo@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 31458@debbugs.gnu.org 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 24b366af4..fff795c4d 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 -- 2.17.0