guix-commits
[Top][All Lists]
Advanced

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

01/09: guix package: Do not list environment variables that need to be s


From: guix-commits
Subject: 01/09: guix package: Do not list environment variables that need to be set.
Date: Wed, 5 Jun 2019 17:11:21 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit bcb7c900cc9d01603fb8fa47bc52caa8e7ebd480
Author: Ludovic Court├Ęs <address@hidden>
Date:   Wed Jun 5 17:33:37 2019 +0200

    guix package: Do not list environment variables that need to be set.
    
    Fixes <https://bugs.gnu.org/35942>.
    
    * guix/scripts/package.scm (display-search-paths): Rename to...
    (display-search-path-hint): ... this.  Adjust callers.
    Remove #:kind parameter.  Replace the list of environment variables with
    an invitation to source $GUIX_PROFILE/etc/profile or run 'guix package
    --search-paths'.
---
 guix/scripts/package.scm | 30 +++++++++++++++++-------------
 1 file changed, 17 insertions(+), 13 deletions(-)

diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 06e4cf5..5751123 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -57,7 +57,6 @@
   #:export (build-and-use-profile
             delete-generations
             delete-matching-generations
-            display-search-paths
             guix-package
 
             (%options . %package-options)
@@ -169,8 +168,7 @@ hooks\" run when building the profile."
                               "~a packages in profile~%"
                               count)
                        count)
-               (display-search-paths entries (list profile)
-                                     #:kind 'prefix)))
+               (display-search-path-hint entries profile)))
 
         (warn-about-disk-space profile))))))
 
@@ -289,17 +287,23 @@ symlinks like 'canonicalize-path' would do."
       file
       (string-append (getcwd) "/" file)))
 
-(define* (display-search-paths entries profiles
-                               #:key (kind 'exact))
-  "Display the search path environment variables that may need to be set for
-ENTRIES, a list of manifest entries, in the context of PROFILE."
-  (let* ((profiles (map (compose user-friendly-profile absolutize)
-                        profiles))
-         (settings (search-path-environment-variables entries profiles
-                                                      #:kind kind)))
+(define (display-search-path-hint entries profile)
+  "Display a hint on how to set environment variables to use ENTRIES, a list
+of manifest entries, in the context of PROFILE."
+  (let* ((profile  (user-friendly-profile (absolutize profile)))
+         (settings (search-path-environment-variables entries (list profile)
+                                                      #:kind 'prefix)))
     (unless (null? settings)
-      (format #t (G_ "The following environment variable definitions may be 
needed:~%"))
-      (format #t "~{   ~a~%~}" settings))))
+      (display-hint (format #f (G_ "Consider setting the necessary environment
+variables by running:
+
address@hidden
+GUIX_PROFILE=\"~a\"
+. \"$GUIX_PROFILE/etc/profile\"
address@hidden example
+
+Alternately, see @command{guix package --search-paths -p ~s}.")
+                            profile profile)))))
 
 
 ;;;



reply via email to

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