aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Karetnikov <nikita@karetnikov.org>2013-04-28 16:08:23 +0000
committerLudovic Courtès <ludo@gnu.org>2013-04-30 16:58:59 +0200
commit01155b1808b17f0a4f54388261ab0c6f5fee2f1b (patch)
tree89d9d1065a698f57ba9e02ec00e759cb7f414542
parent867df0eeb61b029e33e3298c91890083f0d6a17a (diff)
downloadguix-01155b1808b17f0a4f54388261ab0c6f5fee2f1b.tar
guix-01155b1808b17f0a4f54388261ab0c6f5fee2f1b.tar.gz
utils: Adjust 'wrap-program'.
* guix/build/utils.scm (wrap-program): Fix computation of PROG-REAL and PROG-TMP when PROG is an absolute file name. Add "$@" in the generated script, and quote PROG-REAL. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
-rw-r--r--guix/build/utils.scm6
1 files changed, 3 insertions, 3 deletions
diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index 356dd46b52..a4a82a5f8c 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -680,8 +680,8 @@ contents:
This is useful for scripts that expect particular programs to be in $PATH, for
programs that expect particular shared libraries to be in $LD_LIBRARY_PATH, or
modules in $GUILE_LOAD_PATH, etc."
- (let ((prog-real (string-append "." prog "-real"))
- (prog-tmp (string-append "." prog "-tmp")))
+ (let ((prog-real (string-append (dirname prog) "/." (basename prog) "-real"))
+ (prog-tmp (string-append (dirname prog) "/." (basename prog) "-tmp")))
(define (export-variable lst)
;; Return a string that exports an environment variable.
(match lst
@@ -709,7 +709,7 @@ modules in $GUILE_LOAD_PATH, etc."
(with-output-to-file prog-tmp
(lambda ()
(format #t
- "#!~a~%~a~%exec ~a~%"
+ "#!~a~%~a~%exec \"~a\" \"$@\"~%"
(which "bash")
(string-join (map export-variable vars)
"\n")