From: ludo@gnu.org (Ludovic Courtès)
To: Andreas Enge <andreas@enge.fr>
Cc: 19742@debbugs.gnu.org
Subject: bug#19742: 'wrap-program' should really preserve argv[0]
Date: Mon, 23 Feb 2015 20:42:58 +0100 [thread overview]
Message-ID: <878ufo5s8t.fsf@gnu.org> (raw)
In-Reply-To: <20150215163907.GA6404@debian> (Andreas Enge's message of "Sun, 15 Feb 2015 17:39:07 +0100")
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’.
prev parent reply other threads:[~2015-02-23 19:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Ludovic Courtès [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878ufo5s8t.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=19742@debbugs.gnu.org \
--cc=andreas@enge.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.