summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorBrendan Tildesley <mail@brendan.scot>2021-04-29 20:33:08 +1000
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-01-10 11:44:29 -0500
commit7f8a896c5f3ecde60a19f244d5a407ec1033a08d (patch)
treef0964c46b308d6ac9ca4fcc4e60c07ff0b731e97 /guix
parent41ec0573b81733e15b70312d81cf7fdf77dd63fe (diff)
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 <maxim.cournoyer@gmail.com>
Diffstat (limited to 'guix')
-rw-r--r--guix/build/utils.scm8
1 files changed, 4 insertions, 4 deletions
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 <efraim@flashner.co.il>
;;; Copyright © 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
+;;; Copyright © 2021 Brendan Tildesley <mail@brendan.scot>
;;;
;;; 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))