From ca6aecb94455c6e009d94bf6a0780a8f876bc85d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Date: Fri, 15 Dec 2017 22:38:41 +0800 Subject: [PATCH 2/2] profiles: info-dir-file: Don't consider unwanted manifest entries. * guix/profiles.scm (info-dir-file): Use 'eval-gexp' to filter out those manifest inputs that doesn't have info manuals. --- guix/profiles.scm | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/guix/profiles.scm b/guix/profiles.scm index cedf9faa8..14b6c4253 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -683,7 +683,22 @@ MANIFEST." (define gzip ;lazy reference (module-ref (resolve-interface '(gnu packages compression)) 'gzip)) - (define build + ;; We only need to build the 'dir' file for inputs that does containing info + ;; manuals. + ;; + ;; XXX: This breaks '--dry-run', all manifest inputs will be built before + ;; returning the profile derivation... + (define interested + (eval-gexp + #~(filter + (lambda (input) + (file-exists? (string-append input "/share/info"))) + '#$(manifest-inputs manifest)))) + + ;; XXX: We have to pass paths of inputs instead of paths of info files, + ;; because 'gexp-inputs' only adds inputs for strings which satisfies + ;; 'direct-store-path?'. + (define (build inputs) (with-imported-modules '((guix build utils)) #~(begin (use-modules (guix build utils) @@ -707,12 +722,12 @@ MANIFEST." (mkdir-p (string-append #$output "/share/info")) (exit (every install-info - (append-map info-files - '#$(manifest-inputs manifest))))))) + (append-map info-files '#$inputs)))))) - (gexp->derivation "info-dir" build - #:local-build? #t - #:substitutable? #f)) + (mlet* %store-monad ((inputs interested)) + (gexp->derivation "info-dir" (build inputs) + #:local-build? #t + #:substitutable? #f))) (define (ghc-package-cache-file manifest) "Return a derivation that builds the GHC 'package.cache' file for all the -- 2.13.3