bug-guix
[Top][All Lists]
Advanced

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

bug#40039: 'wrap-script' introduces spurious argument


From: Brendan Tildesley
Subject: bug#40039: 'wrap-script' introduces spurious argument
Date: Sun, 22 Mar 2020 11:53:47 +1100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1

It appears the repeated (car cl) results in the executable path getting sent to it's self as the first argument. I'm not sure how things managed to work up until now? I tested the following change and it fixed the one case I was using, but am not sure it is correct. why was the cons (car cl) there in the first place?


diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index b8be73ead4..9610f39d71 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -946,7 +946,7 @@ FILE are kept unchanged."
                                                   "patch-shebang: ~a: changing `~a' to `~a'~%"                                                    file (string-append interp " " arg1) bin)
                                           (patch p bin rest))
-                                      (begin
+                                      (begin
                                         (format (current-error-port)
                                                 "patch-shebang: ~a: changing `~a' to `~a'~%"
                                                 file interp bin)
@@ -1292,11 +1292,10 @@ not supported."
                                                        (_ vars))))
                                    `(let ((cl (command-line)))
                                       (apply execl ,interpreter
-                                             (car cl)
-                                             (cons (car cl)
-                                                   (append
- ',(string-split args #\space)
-                                                    cl))))))
+                                             (car cl) ;; The program.
+                                             (append
+                                              ',(string-tokenize args #\space)
+                                              cl)))))
                    (template (string-append prog ".XXXXXX"))
                    (out      (mkstemp! template))
                    (st       (stat prog))






reply via email to

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