From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:50354) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJVxw-00015s-1j for guix-patches@gnu.org; Wed, 01 Apr 2020 01:31:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJVxu-0006fm-Qv for guix-patches@gnu.org; Wed, 01 Apr 2020 01:31:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54027) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jJVxu-0006ff-Md for guix-patches@gnu.org; Wed, 01 Apr 2020 01:31:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jJVxu-00087Z-JL for guix-patches@gnu.org; Wed, 01 Apr 2020 01:31:02 -0400 Subject: [bug#40365] [PATCH] guix: Improve docstring of wrap-program. Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:49349) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJVx1-0000ye-U0 for guix-patches@gnu.org; Wed, 01 Apr 2020 01:30:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJVx0-0004yN-2O for guix-patches@gnu.org; Wed, 01 Apr 2020 01:30:07 -0400 Received: from mout-p-103.mailbox.org ([80.241.56.161]:54368) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jJVwz-0004ic-SL for guix-patches@gnu.org; Wed, 01 Apr 2020 01:30:06 -0400 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-103.mailbox.org (Postfix) with ESMTPS id 48sZX91zjwzKmTw for ; Wed, 1 Apr 2020 07:30:01 +0200 (CEST) Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id k0t8Z2OgPo3l for ; Wed, 1 Apr 2020 07:29:58 +0200 (CEST) From: Brendan Tildesley Date: Wed, 1 Apr 2020 16:29:49 +1100 Message-Id: <20200401052949.23868-1-mail@brendan.scot> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 40365@debbugs.gnu.org * guix/build/utils.scm (wrap-progran): Add an explanation for POSITION. C= hange 'DIRECTORIES' to 'VALUES' since an environment variable might not only be paths.' --- guix/build/utils.scm | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index b8be73ead4..ba4d1d8657 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -5,6 +5,7 @@ ;;; Copyright =C2=A9 2015, 2018 Mark H Weaver ;;; Copyright =C2=A9 2018 Arun Isaac ;;; Copyright =C2=A9 2018, 2019 Ricardo Wurmus +;;; Copyright =C2=A9 2020 Brendan Tildesley ;;; ;;; This file is part of GNU Guix. ;;; @@ -1114,13 +1115,20 @@ known as `nuke-refs' in Nixpkgs." (string-suffix? "-real" base))))) =20 (define* (wrap-program prog #:rest vars) - "Make a wrapper for PROG. VARS should look like this: + "Make a wrapper for PROG. VARS is a list of lists that should look li= ke this: =20 - '(VARIABLE DELIMITER POSITION LIST-OF-DIRECTORIES) + '(VARIABLE DELIMITER POSITION LIST-OF-VALUES) =20 where DELIMITER is optional. ':' will be used if DELIMITER is not given= . - -For example, this command: +POSITION is a Scheme symbol of either =3D, prefix, or suffix that select= s how +the export VARIABLE line is formatted. prefix and suffix each result in +including values from the users environment either after or before VALUE= , +whereas =3D overshadows any existing value, preventing the users environ= ment +from 'infecting' the wrapped programs environment. It is important to +understand how each variable is used by the program so that the correct = choice +can be made. Otherwise, the program could malfunction in unexpected way= s on a +different persons computer due to a difference in the inherited environm= ent +variables. For example, this command: =20 (wrap-program \"foo\" '(\"PATH\" \":\" =3D (\"/gnu/.../bar/bin\")) --=20 2.26.0