From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZbPQ-0006Rv-8u for guix-patches@gnu.org; Wed, 19 Dec 2018 07:57:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZbPM-0007Xc-BS for guix-patches@gnu.org; Wed, 19 Dec 2018 07:57:08 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:49785) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gZbPK-0007WY-7v for guix-patches@gnu.org; Wed, 19 Dec 2018 07:57:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gZbPK-0001wG-3y for guix-patches@gnu.org; Wed, 19 Dec 2018 07:57:02 -0500 Subject: [bug#33802] [PATCH] ui: Report profile hooks separately. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34133) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZbOy-0006Js-PS for guix-patches@gnu.org; Wed, 19 Dec 2018 07:56:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZbOv-0007Gb-HK for guix-patches@gnu.org; Wed, 19 Dec 2018 07:56:40 -0500 Received: from venus.bbbm.mdc-berlin.de ([141.80.25.30]:33214) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gZbOv-0007FS-1J for guix-patches@gnu.org; Wed, 19 Dec 2018 07:56:37 -0500 Received: from localhost (localhost [127.0.0.1]) by venus.bbbm.mdc-berlin.de (Postfix) with ESMTP id 00C5D380738 for ; Wed, 19 Dec 2018 13:56:35 +0100 (CET) Received: from venus.bbbm.mdc-berlin.de ([127.0.0.1]) by localhost (venus.bbbm.mdc-berlin.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qsUQ2uVs2njJ for ; Wed, 19 Dec 2018 13:56:34 +0100 (CET) Received: from SW-IT-P-CAS3.mdc-berlin.net (puck.citx.mdc-berlin.de [141.80.36.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by venus.bbbm.mdc-berlin.de (Postfix) with ESMTPS for ; Wed, 19 Dec 2018 13:56:34 +0100 (CET) From: Ricardo Wurmus Date: Wed, 19 Dec 2018 13:56:32 +0100 Message-ID: <20181219125632.17532-1-ricardo.wurmus@mdc-berlin.de> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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: 33802@debbugs.gnu.org Cc: Ricardo Wurmus * guix/ui.scm (profile-hook-derivation?): New procedure. (show-what-to-build): Distinguish among BUILD derivations that match 'profile-hook-derivation?'. Report them separately. * guix/status.scm (print-build-event): Display profile hooks with readabl= e hook name. * guix/profiles.scm (info-dir-file, ghc-package-cache-file, ca-certificate-bundle, glib-schemas, gtk-icon-themes, gtk-im-modules, xdg-desktop-database, xdg-mime-database, fonts-dir-file, manual-database)= : Augment derivation with "type" and "hook" properties. --- guix/profiles.scm | 52 +++++++++++++++++++++++++++++++++++++---------- guix/status.scm | 4 ++++ guix/ui.scm | 46 +++++++++++++++++++++++++++++++++++------ 3 files changed, 85 insertions(+), 17 deletions(-) diff --git a/guix/profiles.scm b/guix/profiles.scm index ba4446bc2..4739d28a9 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -4,7 +4,7 @@ ;;; Copyright =C2=A9 2014, 2016 Alex Kost ;;; Copyright =C2=A9 2015 Mark H Weaver ;;; Copyright =C2=A9 2015 Sou Bunnbu -;;; Copyright =C2=A9 2016 Ricardo Wurmus +;;; Copyright =C2=A9 2016, 2018 Ricardo Wurmus ;;; Copyright =C2=A9 2016 Chris Marusich ;;; Copyright =C2=A9 2017 Huang Ying ;;; Copyright =C2=A9 2017 Maxim Cournoyer @@ -788,7 +788,10 @@ MANIFEST." =20 (gexp->derivation "info-dir" build #:local-build? #t - #:substitutable? #f)) + #:substitutable? #f + #:properties + `((type . profile-hook) + (hook . "info manuals directory")))) =20 (define (ghc-package-cache-file manifest) "Return a derivation that builds the GHC 'package.cache' file for all = the @@ -842,7 +845,10 @@ entries of MANIFEST, or #f if MANIFEST does not have= any GHC packages." (map manifest-entry-name (manifest-entries manifest))) (gexp->derivation "ghc-package-cache" build #:local-build? #t - #:substitutable? #f) + #:substitutable? #f + #:properties + `((type . profile-hook) + (hook . "GHC package cache"))) (return #f)))) =20 (define (ca-certificate-bundle manifest) @@ -910,7 +916,10 @@ MANIFEST. Single-file bundles are required by progr= ams such as Git and Lynx." =20 (gexp->derivation "ca-certificate-bundle" build #:local-build? #t - #:substitutable? #f)) + #:substitutable? #f + #:properties + `((type . profile-hook) + (hook . "CA certificate bundle")))) =20 (define (glib-schemas manifest) "Return a derivation that unions all schemas from manifest entries and @@ -960,7 +969,10 @@ creates the Glib 'gschemas.compiled' file." (if %glib (gexp->derivation "glib-schemas" build #:local-build? #t - #:substitutable? #f) + #:substitutable? #f + #:properties + `((type . profile-hook) + (hook . "Glib schemas"))) (return #f)))) =20 (define (gtk-icon-themes manifest) @@ -1016,7 +1028,10 @@ creates the GTK+ 'icon-theme.cache' file for each = theme." (if %gtk+ (gexp->derivation "gtk-icon-themes" build #:local-build? #t - #:substitutable? #f) + #:substitutable? #f + #:properties + `((type . profile-hook) + (hook . "GTK icon themes"))) (return #f)))) =20 (define (gtk-im-modules manifest) @@ -1088,7 +1103,10 @@ for both major versions of GTK+." (if (or gtk+ gtk+-2) (gexp->derivation "gtk-im-modules" gexp #:local-build? #t - #:substitutable? #f) + #:substitutable? #f + #:properties + `((type . profile-hook) + (hook . "GTK inputs method modules"))) (return #f))))) =20 (define (xdg-desktop-database manifest) @@ -1126,7 +1144,10 @@ MIME type." (if glib (gexp->derivation "xdg-desktop-database" build #:local-build? #t - #:substitutable? #f) + #:substitutable? #f + #:properties + `((type . profile-hook) + (hook . "XDG desktop database"))) (return #f)))) =20 (define (xdg-mime-database manifest) @@ -1165,7 +1186,10 @@ entries. It's used to query the MIME type of a gi= ven file." (if glib (gexp->derivation "xdg-mime-database" build #:local-build? #t - #:substitutable? #f) + #:substitutable? #f + #:properties + `((type . profile-hook) + (hook . "XDG MIME database"))) (return #f)))) =20 ;; Several font packages may install font files into same directory, so @@ -1236,7 +1260,10 @@ files for the fonts of the @var{manifest} entries.= " (guix build union) (srfi srfi-26)) #:local-build? #t - #:substitutable? #f)) + #:substitutable? #f + #:properties + `((type . profile-hook) + (hook . "fonts directory")))) =20 (define (manual-database manifest) "Return a derivation that builds the manual page database (\"mandb\") = for @@ -1306,7 +1333,10 @@ the entries in MANIFEST." ;; . #:env-vars `(("MALLOC_PERTURB_" . "1")) =20 - #:local-build? #t)) + #:local-build? #t + #:properties + `((type . profile-hook) + (hook . "manual page database")))) =20 (define %default-profile-hooks ;; This is the list of derivation-returning procedures that are called= by diff --git a/guix/status.scm b/guix/status.scm index 868bfdca2..070c1d132 100644 --- a/guix/status.scm +++ b/guix/status.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2017, 2018 Ludovic Court=C3=A8s +;;; Copyright =C2=A9 2018 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. ;;; @@ -336,6 +337,9 @@ addition to build events." "applying ~a grafts for ~a..." count)) count drv))) + ('profile-hook + (format port (info (G_ "building profile hook for ~a...")) + (assq-ref properties 'hook))) (_ (format port (info (G_ "building ~a...")) drv)))) (newline port)) diff --git a/guix/ui.scm b/guix/ui.scm index 60636edac..bf70fc134 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -822,6 +822,12 @@ warning." ('graft #t) (_ #f))) =20 +(define (profile-hook-derivation? drv) + "Return true if DRV is definitely a profile hook derivation, false oth= erwise." + (match (assq-ref (derivation-properties drv) 'type) + ('profile-hook #t) + (_ #f))) + (define* (show-what-to-build store drv #:key dry-run? (use-substitutes? #t) (mode (build-mode normal))) @@ -872,10 +878,28 @@ report what is prerequisites are available for down= load." substitutable-references download)))) download)) - ((graft build) - (partition (compose graft-derivation? - read-derivation-from-file) - build))) + ((graft hook build) + (match (fold (lambda (file acc) + (let ((drv (read-derivation-from-file fi= le))) + (match acc + ((#:graft graft #:hook hook #:build = build) + (cond + ((graft-derivation? drv) + `(#:graft ,(cons file graft) + #:hook ,hook + #:build ,build)) + ((profile-hook-derivation? drv) + `(#:graft ,graft + #:hook ,(cons file hook) + #:build ,build)) + (else + `(#:graft ,graft + #:hook ,hook + #:build ,(cons file build))))))= )) + '(#:graft () #:hook () #:build ()) + build) + ((#:graft graft #:hook hook #:build build) + (values graft hook build))))) (define installed-size (reduce + 0 (map substitutable-nar-size download))) =20 @@ -913,7 +937,12 @@ report what is prerequisites are available for downl= oad." (N_ "~:[The following graft would be made:~%~{ ~a~%~= }~;~]" "~:[The following grafts would be made:~%~{ ~a~%= ~}~;~]" (length graft)) - (null? graft) graft)) + (null? graft) graft) + (format (current-error-port) + (N_ "~:[The following profile hook would be built:~%~{= ~a~%~}~;~]" + "~:[The following profile hooks would be built:~%~= { ~a~%~}~;~]" + (length hook)) + (null? hook) hook)) (begin (format (current-error-port) (N_ "~:[The following derivation will be built:~%~{ = ~a~%~}~;~]" @@ -938,7 +967,12 @@ report what is prerequisites are available for downl= oad." (N_ "~:[The following graft will be made:~%~{ ~a~%~}= ~;~]" "~:[The following grafts will be made:~%~{ ~a~%~= }~;~]" (length graft)) - (null? graft) graft))) + (null? graft) graft) + (format (current-error-port) + (N_ "~:[The following profile hook will be built:~%~{ = ~a~%~}~;~]" + "~:[The following profile hooks will be built:~%~{= ~a~%~}~;~]" + (length hook)) + (null? hook) hook))) =20 (check-available-space installed-size) =20 --=20 2.19.1