From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#19742: 'wrap-program' should really preserve argv[0] Date: Sun, 01 Feb 2015 22:39:53 +0100 Message-ID: <877fw1e2fq.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57837) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YI3zv-0006l2-Nk for bug-guix@gnu.org; Sun, 01 Feb 2015 18:32:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YI3zm-0006Gb-N2 for bug-guix@gnu.org; Sun, 01 Feb 2015 18:32:11 -0500 Received: from debbugs.gnu.org ([140.186.70.43]:40416) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YI3zm-0006GQ-K4 for bug-guix@gnu.org; Sun, 01 Feb 2015 18:32:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YI3zm-0001Ok-C7 for bug-guix@gnu.org; Sun, 01 Feb 2015 18:32:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YI3zJ-0006Y9-SN for bug-guix@gnu.org; Sun, 01 Feb 2015 18:31:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YI3zJ-000671-6F for bug-guix@gnu.org; Sun, 01 Feb 2015 18:31:33 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54021) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YI3zJ-00066x-2g for bug-guix@gnu.org; Sun, 01 Feb 2015 18:31:33 -0500 Received: from reverse-83.fdn.fr ([80.67.176.83]:44743 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1YI3zI-0000PC-KY for bug-guix@gnu.org; Sun, 01 Feb 2015 18:31:32 -0500 List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: 19742@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable It should be enough, and more appropriate, to simply preserve argv[0] in wrappers. Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline 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) --=-=-=--