mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
utils: Set $0 to basename of command in `wrap-program'.
* guix/build/utils.scm (wrap-program): Set the value of the -a option of `exec' in the wrapper to ${0##*/} instead of $0, to use its base name instead of the complete file name. Fixes: https://issues.guix.gnu.org/73405 Change-Id: Iec5984d4d934c8df88a90ff653947f7d07413ae4 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
84a7b73515
commit
df94888eca
1 changed files with 2 additions and 2 deletions
|
@ -1355,7 +1355,7 @@ contents:
|
||||||
#!location/of/bin/bash
|
#!location/of/bin/bash
|
||||||
export PATH=\"/gnu/.../bar/bin\"
|
export PATH=\"/gnu/.../bar/bin\"
|
||||||
export CERT_PATH=\"$CERT_PATH${CERT_PATH:+:}/gnu/.../baz/certs:/qux/certs\"
|
export CERT_PATH=\"$CERT_PATH${CERT_PATH:+:}/gnu/.../baz/certs:/qux/certs\"
|
||||||
exec -a $0 location/of/.foo-real \"$@\"
|
exec -a \"${0##*/}\" location/of/.foo-real \"$@\"
|
||||||
|
|
||||||
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
|
||||||
|
@ -1432,7 +1432,7 @@ with definitions for VARS. If it is not, SH will be used as interpreter."
|
||||||
(call-with-output-file prog-tmp
|
(call-with-output-file prog-tmp
|
||||||
(lambda (port)
|
(lambda (port)
|
||||||
(format port
|
(format port
|
||||||
"#!~a~%~a~%exec -a \"$0\" \"~a\" \"$@\"~%"
|
"#!~a~%~a~%exec -a \"${0##*/}\" \"~a\" \"$@\"~%"
|
||||||
sh
|
sh
|
||||||
(string-join (map export-variable vars/filtered) "\n")
|
(string-join (map export-variable vars/filtered) "\n")
|
||||||
(canonicalize-path wrapped-file))))
|
(canonicalize-path wrapped-file))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue