guix-devel
[Top][All Lists]
Advanced

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

[PATCH 2/2] packages: Add %base-search-path-specifications.


From: David Thompson
Subject: [PATCH 2/2] packages: Add %base-search-path-specifications.
Date: Mon, 23 Feb 2015 21:19:56 -0500
User-agent: Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu)

>From cdc378a6fb6a59e49511d4151e0f2ba79e502632 Mon Sep 17 00:00:00 2001
From: David Thompson <address@hidden>
Date: Mon, 23 Feb 2015 20:45:59 -0500
Subject: [PATCH 2/2] packages: Add %base-search-path-specifications.

* guix/packages.scm (%base-search-path-specifications): New variable.
* guix/scripts/package.scm (search-path-environment-variables): Append base
  search paths to package search paths.
* guix/scripts/environment.scm (for-each-search-path): Factor out hardcoded
  search path.
---
 guix/packages.scm            | 6 ++++++
 guix/scripts/environment.scm | 8 +++-----
 guix/scripts/package.scm     | 7 ++++---
 3 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/guix/packages.scm b/guix/packages.scm
index 3e0574a..0804247 100644
--- a/guix/packages.scm
+++ b/guix/packages.scm
@@ -53,6 +53,7 @@
             <search-path-specification>
             search-path-specification
             search-path-specification?
+            %base-search-path-specifications
             search-path-specification->sexp
             merge-search-path-specifications
 
@@ -197,6 +198,11 @@ representation."
   (file-pattern search-path-specification-file-pattern ;#f | string
                 (default #f)))
 
+(define %base-search-path-specifications
+  (list (search-path-specification
+         (variable "PATH")
+         (files (list "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'."
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index bb2ce53..237cefa 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -56,11 +56,9 @@ path value is appended."
                         (if (and current (not pure?))
                             (string-append value separator current)
                             value)))))
-              (cons* (search-path-specification
-                      (variable "PATH")
-                      (files '("bin" "sbin")))
-                     (delete-duplicates
-                      (append-map package-native-search-paths inputs))))))
+              (append %base-search-path-specifications
+                      (delete-duplicates
+                       (append-map package-native-search-paths inputs))))))
 
 ;; Protect some env vars from purification.  Borrowed from nix-shell.
 (define %precious-variables
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index da95d45..e5c7354 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -394,9 +394,10 @@ current settings and report only settings not already 
effective."
 
     (let* ((packages     (filter-map manifest-entry->package entries))
            (search-paths (merge-search-path-specifications
-                          (delete-duplicates
-                           (append-map package-native-search-paths
-                                       packages)))))
+                          (append %base-search-path-specifications
+                                  (delete-duplicates
+                                   (append-map package-native-search-paths
+                                               packages))))))
       (filter-map search-path-definition search-paths))))
 
 (define (display-search-paths entries profile)
-- 
2.1.4

-- 
David Thompson
Web Developer - Free Software Foundation - http://fsf.org
GPG Key: 0FF1D807
Support the FSF: https://fsf.org/donate

reply via email to

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