unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Brendan Tildesley <mail@brendan.scot>
To: 40365@debbugs.gnu.org
Subject: [bug#40365] [PATCH] guix: Improve docstring of wrap-program.
Date: Wed,  1 Apr 2020 16:29:49 +1100	[thread overview]
Message-ID: <20200401052949.23868-1-mail@brendan.scot> (raw)

* guix/build/utils.scm (wrap-progran): Add an explanation for POSITION. Change
'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 © 2015, 2018 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2020 Brendan Tildesley <mail@brendan.scot>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1114,13 +1115,20 @@ known as `nuke-refs' in Nixpkgs."
               (string-suffix? "-real" base)))))
 
 (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 like this:
 
-  '(VARIABLE DELIMITER POSITION LIST-OF-DIRECTORIES)
+  '(VARIABLE DELIMITER POSITION LIST-OF-VALUES)
 
 where DELIMITER is optional.  ':' will be used if DELIMITER is not given.
-
-For example, this command:
+POSITION is a Scheme symbol of either =, prefix, or suffix that selects 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 = overshadows any existing value, preventing the users environment
+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 ways on a
+different persons computer due to a difference in the inherited environment
+variables.  For example, this command:
 
   (wrap-program \"foo\"
                 '(\"PATH\" \":\" = (\"/gnu/.../bar/bin\"))
-- 
2.26.0

             reply	other threads:[~2020-04-01  5:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-01  5:29 Brendan Tildesley [this message]
2020-11-21 10:17 ` [bug#40365] [PATCH] guix: Improve docstring of wrap-program Christopher Baines

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200401052949.23868-1-mail@brendan.scot \
    --to=mail@brendan.scot \
    --cc=40365@debbugs.gnu.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).