summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-01-05 16:02:32 +0100
committerLudovic Courtès <ludo@gnu.org>2013-01-05 16:02:32 +0100
commit7584f822bf076f4fc8aef9c1f4d48c179fe15fc3 (patch)
tree905afe27094a71e6730fc2428f213f28b4a956fd /guix
parent312543dcfc2b19063f172bd10bb437d6bfe62cff (diff)
utils: Add `which'.
* guix/build/utils.scm (which): New procedure. * distro/packages/lsh.scm (lsh): Use `which' instead of `search-path'. * distro/packages/perl.scm (perl): Likewise. * distro/packages/attr.scm (attr): Likewise.
Diffstat (limited to 'guix')
-rw-r--r--guix/build/utils.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index 5729cdbf04..f365b0db05 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -36,6 +36,8 @@
set-path-environment-variable
search-path-as-string->list
list->search-path-as-string
+ which
+
alist-cons-before
alist-cons-after
alist-replace
@@ -214,6 +216,12 @@ SEPARATOR-separated path accordingly. Example:
(format #t "environment variable `~a' set to `~a'~%"
env-var value)))
+(define (which program)
+ "Return the complete file name for PROGRAM as found in $PATH, or #f if
+PROGRAM could not be found."
+ (search-path (search-path-as-string->list (getenv "PATH"))
+ program))
+
;;;
;;; Phases.