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>master
parent
867df0eeb6
commit
01155b1808
|
@ -680,8 +680,8 @@ contents:
|
||||||
This is useful for scripts that expect particular programs to be in $PATH, for
|
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
|
programs that expect particular shared libraries to be in $LD_LIBRARY_PATH, or
|
||||||
modules in $GUILE_LOAD_PATH, etc."
|
modules in $GUILE_LOAD_PATH, etc."
|
||||||
(let ((prog-real (string-append "." prog "-real"))
|
(let ((prog-real (string-append (dirname prog) "/." (basename prog) "-real"))
|
||||||
(prog-tmp (string-append "." prog "-tmp")))
|
(prog-tmp (string-append (dirname prog) "/." (basename prog) "-tmp")))
|
||||||
(define (export-variable lst)
|
(define (export-variable lst)
|
||||||
;; Return a string that exports an environment variable.
|
;; Return a string that exports an environment variable.
|
||||||
(match lst
|
(match lst
|
||||||
|
@ -709,7 +709,7 @@ modules in $GUILE_LOAD_PATH, etc."
|
||||||
(with-output-to-file prog-tmp
|
(with-output-to-file prog-tmp
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(format #t
|
(format #t
|
||||||
"#!~a~%~a~%exec ~a~%"
|
"#!~a~%~a~%exec \"~a\" \"$@\"~%"
|
||||||
(which "bash")
|
(which "bash")
|
||||||
(string-join (map export-variable vars)
|
(string-join (map export-variable vars)
|
||||||
"\n")
|
"\n")
|
||||||
|
|
Reference in New Issue