GNU bug report logs - #40039
'wrap-script' introduces spurious argument

Previous Next

Package: guix;

Reported by: Ludovic Courtès <ludovic.courtes <at> inria.fr>

Date: Thu, 12 Mar 2020 14:27:01 UTC

Severity: normal

Full log


Message #8 received at 40039 <at> debbugs.gnu.org (full text, mbox):

From: Brendan Tildesley <brendan.tildesley <at> gmail.com>
To: 40039 <at> debbugs.gnu.org
Subject: Re: 'wrap-script' introduces spurious argument
Date: Sun, 22 Mar 2020 11:53:47 +1100
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))





This bug report was last modified 3 years and 285 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.