guix-commits
[Top][All Lists]
Advanced

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

03/05: search-paths: Define the 'PATH' environment variable.


From: Ludovic Courtès
Subject: 03/05: search-paths: Define the 'PATH' environment variable.
Date: Tue, 05 May 2015 13:14:14 +0000

civodul pushed a commit to branch master
in repository guix.

commit fdfa753c69acb00e4d79ee82f8772bde3e1a6cd6
Author: Ludovic Courtès <address@hidden>
Date:   Tue May 5 13:57:59 2015 +0200

    search-paths: Define the 'PATH' environment variable.
    
    * guix/search-paths.scm ($PATH): New variable.
    * guix/scripts/environment.scm (for-each-search-path): Use it.
---
 guix/scripts/environment.scm |    4 +---
 guix/search-paths.scm        |    9 +++++++++
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index b407500..36d7beb 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -57,9 +57,7 @@ path value is appended."
                         (if (and current (not pure?))
                             (string-append value separator current)
                             value)))))
-              (cons* (search-path-specification
-                      (variable "PATH")
-                      (files '("bin" "sbin")))
+              (cons* $PATH
                      (delete-duplicates
                       (append-map package-native-search-paths inputs))))))
 
diff --git a/guix/search-paths.scm b/guix/search-paths.scm
index 9dfad89..89af1e1 100644
--- a/guix/search-paths.scm
+++ b/guix/search-paths.scm
@@ -31,6 +31,8 @@
             search-path-specification-file-type
             search-path-specification-file-pattern
 
+            $PATH
+
             search-path-specification->sexp
             sexp->search-path-specification
             evaluate-search-paths
@@ -58,6 +60,13 @@
   (file-pattern search-path-specification-file-pattern ;#f | string
                 (default #f)))
 
+(define $PATH
+  ;; The 'PATH' variable.  This variable is a bit special: it is not attached
+  ;; to any package in particular.
+  (search-path-specification
+   (variable "PATH")
+   (files '("bin" "sbin"))))
+
 (define (search-path-specification->sexp spec)
   "Return an sexp representing SPEC, a <search-path-specification>.  The sexp
 corresponds to the arguments expected by `set-path-environment-variable'."



reply via email to

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