guix-commits
[Top][All Lists]
Advanced

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

branch core-updates updated: build: utils: Trim leading slash from searc


From: guix-commits
Subject: branch core-updates updated: build: utils: Trim leading slash from search-input-file input.
Date: Sun, 25 Jul 2021 13:13:33 -0400

This is an automated email from the git hooks/post-receive script.

mothacehe pushed a commit to branch core-updates
in repository guix.

The following commit(s) were added to refs/heads/core-updates by this push:
     new 0236013  build: utils: Trim leading slash from search-input-file input.
0236013 is described below

commit 0236013cd0fc86ff4a042885c735e3f36a7f5c25
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Sun Jul 25 11:43:05 2021 +0200

    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.
---
 guix/build/utils.scm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

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



reply via email to

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