From patchwork Wed Apr 1 05:29:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Brendan Tildesley X-Patchwork-Id: 21028 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 2CACC27BBE4; Wed, 1 Apr 2020 06:31:13 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id E618527BBE1 for ; Wed, 1 Apr 2020 06:31:12 +0100 (BST) Received: from localhost ([::1]:47194 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJVy4-00015y-GA for patchwork@mira.cbaines.net; Wed, 01 Apr 2020 01:31:12 -0400 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 X-Loop: help-debbugs@gnu.org Subject: [bug#40365] [PATCH] guix: Improve docstring of wrap-program. Resent-From: Brendan Tildesley Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 01 Apr 2020 05:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 40365 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 40365@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.158571901530864 (code B ref -1); Wed, 01 Apr 2020 05:31:02 +0000 Received: (at submit) by debbugs.gnu.org; 1 Apr 2020 05:30:15 +0000 Received: from localhost ([127.0.0.1]:37340 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJVx5-00081P-HZ for submit@debbugs.gnu.org; Wed, 01 Apr 2020 01:30:15 -0400 Received: from lists.gnu.org ([209.51.188.17]:39385) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jJVx3-00080r-2t for submit@debbugs.gnu.org; Wed, 01 Apr 2020 01:30:09 -0400 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) X-Virus-Scanned: amavisd-new at heinlein-support.de 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 X-Rspamd-Queue-Id: 724E91778 X-Rspamd-Score: -0.43 / 15.00 / 200.00 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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 ;;; Copyright © 2018 Arun Isaac ;;; Copyright © 2018, 2019 Ricardo Wurmus +;;; Copyright © 2020 Brendan Tildesley ;;; ;;; 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\"))