utils: Use 'which' to find the shell in 'patch-makefile-SHELL'.

* guix/build/utils.scm (patch-makefile-SHELL)[find-shell]: Use 'which'.
This commit is contained in:
Ludovic Courtès 2014-12-13 00:04:25 +01:00
parent 7cc7dec139
commit 5e5deea952

View file

@ -629,9 +629,7 @@ (define* (patch-makefile-SHELL file #:key (keep-mtime? #t))
;; XXX: Unlike with `patch-shebang', FILE is always touched.
(define (find-shell name)
(let ((shell
(search-path (search-path-as-string->list (getenv "PATH"))
name)))
(let ((shell (which name)))
(unless shell
(format (current-error-port)
"patch-makefile-SHELL: warning: no binary for shell `~a' found in $PATH~%"