Archived
1
0
Fork 0

build: utils: Trim leading slash from search-input-file input.

Make sure that both:

(search-input-file inputs "/bin/sh") and (search-input-file inputs "bin/sh")

are supported.

* guix/build/utils (search-input-file): Trim leading slash character from
FILE.
This commit is contained in:
Mathieu Othacehe 2021-07-25 11:43:05 +02:00
parent a682fea916
commit 0236013cd0
No known key found for this signature in database
GPG key ID: 8354763531769CA6

View file

@ -631,8 +631,11 @@ FILE must be a string like \"bin/sh\". If FILE is not found, an exception is
raised." raised."
(match inputs (match inputs
(((_ . directories) ...) (((_ . directories) ...)
(or (search-path directories file) ;; Accept both "bin/sh" and "/bin/sh" as FILE argument.
(raise (condition (&search-error (path directories) (file file)))))))) (let ((file (string-trim file #\/)))
(or (search-path directories file)
(raise
(condition (&search-error (path directories) (file file)))))))))
(define (search-input-directory inputs directory) (define (search-input-directory inputs directory)
"Find a sub-directory named DIRECTORY among the INPUTS and return its "Find a sub-directory named DIRECTORY among the INPUTS and return its