* bug#19742: 'wrap-program' should really preserve argv[0]
@ 2015-02-01 21:39 Ludovic Courtès
2015-02-16 14:26 ` bug#19742: Close Andreas Enge
[not found] ` <20150215163907.GA6404@debian>
0 siblings, 2 replies; 3+ messages in thread
From: Ludovic Courtès @ 2015-02-01 21:39 UTC (permalink / raw
To: 19742
[-- Attachment #1: Type: text/plain, Size: 99 bytes --]
It should be enough, and more appropriate, to simply preserve argv[0] in
wrappers.
Ludo’.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 544 bytes --]
diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index 4407f9a..ebe70a3 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -870,8 +870,7 @@ the previous wrapper."
(with-output-to-file prog-tmp
(lambda ()
(format #t
- "#!~a~%~a~%exec -a \"~a\" \"~a\" \"$@\"~%"
- (which "bash")
+ "#!~a~%~a~%exec -a \"$0\" \"~a\" \"$@\"~%"
(string-join (map export-variable vars)
"\n")
(canonicalize-path prog)
^ permalink raw reply related [flat|nested] 3+ messages in thread
* bug#19742: Close
2015-02-01 21:39 bug#19742: 'wrap-program' should really preserve argv[0] Ludovic Courtès
@ 2015-02-16 14:26 ` Andreas Enge
[not found] ` <20150215163907.GA6404@debian>
1 sibling, 0 replies; 3+ messages in thread
From: Andreas Enge @ 2015-02-16 14:26 UTC (permalink / raw
To: 19742-done
Applied in commit b01f89675d03202851a00c38d4995424bbb1879f.
Andreas
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#19742: 'wrap-program' should really preserve argv[0]
[not found] ` <20150215163907.GA6404@debian>
@ 2015-02-23 19:42 ` Ludovic Courtès
0 siblings, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2015-02-23 19:42 UTC (permalink / raw
To: Andreas Enge; +Cc: 19742
Andreas Enge <andreas@enge.fr> skribis:
> * guix/build/utils.scm (wrap-program): Create scripts that use $0 (which is
> usually just the base name) instead of the absolute path to the original
> program. Alternative implementation of 2ed11b3.
>
> Co-authored-by: Ludovic Courtès <ludo@gnu.org>
>
> Closes <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19742>.
> ---
> guix/build/utils.scm | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/guix/build/utils.scm b/guix/build/utils.scm
> index c7fdd1d..a3446cb 100644
> --- a/guix/build/utils.scm
> +++ b/guix/build/utils.scm
> @@ -816,7 +816,7 @@ contents:
> #!location/of/bin/bash
> export PATH=\"/gnu/.../bar/bin\"
> export CERT_PATH=\"$CERT_PATH${CERT_PATH:+:}/gnu/.../baz/certs:/qux/certs\"
> - exec -a location/of/foo 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
> programs that expect particular shared libraries to be in $LD_LIBRARY_PATH, or
> @@ -870,11 +870,10 @@ the previous wrapper."
> (with-output-to-file prog-tmp
> (lambda ()
> (format #t
> - "#!~a~%~a~%exec -a \"~a\" \"~a\" \"$@\"~%"
> + "#!~a~%~a~%exec -a \"$0\" \"~a\" \"$@\"~%"
> (which "bash")
> (string-join (map export-variable vars)
> "\n")
> - (canonicalize-path prog)
Indeed, it’s better this way. Please apply to ‘core-updates’ if not
already done.
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-02-23 19:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-01 21:39 bug#19742: 'wrap-program' should really preserve argv[0] Ludovic Courtès
2015-02-16 14:26 ` bug#19742: Close Andreas Enge
[not found] ` <20150215163907.GA6404@debian>
2015-02-23 19:42 ` bug#19742: 'wrap-program' should really preserve argv[0] Ludovic Courtès
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.