From dedb17ad010ee9ef67f3f4f3997dd17f226c8090 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 2 May 2015 23:55:24 +0200 Subject: profiles: Store search paths in manifests. Discussed in . * guix/packages.scm (sexp->search-path-specification): New variable. * guix/profiles.scm ()[search-paths]: New field. (package->manifest-entry): Initialize it. (manifest->gexp): Match it. Wrap #$deps in (propagated-inputs ...). Emit (search-paths ...). Increment version. (find-package): New procedure. (sexp->manifest)[infer-search-paths]: New procedure. Use it to initialize the 'search-paths' field for versions 0 and 1. Add case for version 2. * guix/scripts/package.scm (search-path-environment-variables)[manifest-entry->package]: Remove. Use 'manifest-entry-search-paths' instead of 'manifest-entry->package' plus 'package-native-search-paths'. * tests/profiles.scm ("profile-manifest, search-paths"): New test. --- guix/scripts/package.scm | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'guix/scripts/package.scm') diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 1e724b4e19..fca70f566d 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -384,22 +384,6 @@ current settings and report only settings not already effective." %user-profile-directory profile))) - ;; The search path info is not stored in the manifest. Thus, we infer the - ;; search paths from same-named packages found in the distro. - - (define manifest-entry->package - (match-lambda - (($ name version) - ;; Use 'find-best-packages-by-name' and not 'find-packages-by-name'; - ;; the former traverses the module tree only once and then allows for - ;; efficient access via a vhash. - (match (find-best-packages-by-name name version) - ((p _ ...) p) - (_ - (match (find-best-packages-by-name name #f) - ((p _ ...) p) - (_ #f))))))) - (define search-path-definition (match-lambda (($ variable files separator @@ -426,10 +410,8 @@ current settings and report only settings not already effective." variable (string-join path separator))))))) - (let* ((packages (filter-map manifest-entry->package entries)) - (search-paths (delete-duplicates - (append-map package-native-search-paths - packages)))) + (let ((search-paths (delete-duplicates + (append-map manifest-entry-search-paths entries)))) (filter-map search-path-definition search-paths)))) (define (display-search-paths entries profile) -- cgit v1.2.3