From 7f8a896c5f3ecde60a19f244d5a407ec1033a08d Mon Sep 17 00:00:00 2001 From: Brendan Tildesley Date: Thu, 29 Apr 2021 20:33:08 +1000 Subject: utils: Fix wrap-script argument handling. * guix/build/utils.scm (wrap-script): Don't add (car cl) one too many times, cl its self contains it's car. Split the aguments string with string-tokenize to avoid leaving an empty string argument when there should be none. These two bugs seemed to be partially cancelling each other out so that scripts still worked when ran with no arguments. * tests/build-utils.scm: Adjust wrap-script to above changes. Add two tests to ensure the command line arguments appear identical to a script and its wrapped version. Signed-off-by: Maxim Cournoyer --- guix/build/utils.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'guix') diff --git a/guix/build/utils.scm b/guix/build/utils.scm index 3beb7da67a..dd5a91f52f 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -8,6 +8,7 @@ ;;; Copyright © 2020 Efraim Flashner ;;; Copyright © 2020, 2021 Maxim Cournoyer ;;; Copyright © 2021 Maxime Devos +;;; Copyright © 2021 Brendan Tildesley ;;; ;;; This file is part of GNU Guix. ;;; @@ -1462,10 +1463,9 @@ not supported." `(let ((cl (command-line))) (apply execl ,interpreter (car cl) - (cons (car cl) - (append - ',(string-split args #\space) - cl)))))) + (append + ',(string-tokenize args char-set:graphic) + cl))))) (template (string-append prog ".XXXXXX")) (out (mkstemp! template)) (st (stat prog)) -- cgit v1.2.3