From patchwork Wed Jan 8 18:56:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Tournier X-Patchwork-Id: 19705 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 4CDBC17A33; Wed, 8 Jan 2020 18:57:13 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id F1547179BD for ; Wed, 8 Jan 2020 18:57:12 +0000 (GMT) Received: from localhost ([::1]:48082 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipGW0-0000Kw-4i for patchwork@mira.cbaines.net; Wed, 08 Jan 2020 13:57:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50750) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipGVr-0000IR-7Y for guix-patches@gnu.org; Wed, 08 Jan 2020 13:57:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipGVp-0002kr-Tv for guix-patches@gnu.org; Wed, 08 Jan 2020 13:57:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:45337) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ipGVp-0002kV-Mv for guix-patches@gnu.org; Wed, 08 Jan 2020 13:57:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ipGVp-0006W3-Mz for guix-patches@gnu.org; Wed, 08 Jan 2020 13:57:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#38678] [PATCH v2 1/4] graph: Add '--load-path' option. References: <20191219210958.8807-1-zimon.toutoune@gmail.com> In-Reply-To: <20191219210958.8807-1-zimon.toutoune@gmail.com> Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 08 Jan 2020 18:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38678 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 38678@debbugs.gnu.org Cc: zimoun Received: via spool by 38678-submit@debbugs.gnu.org id=B38678.157850979724981 (code B ref 38678); Wed, 08 Jan 2020 18:57:01 +0000 Received: (at 38678) by debbugs.gnu.org; 8 Jan 2020 18:56:37 +0000 Received: from localhost ([127.0.0.1]:51301 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ipGVR-0006Up-0C for submit@debbugs.gnu.org; Wed, 08 Jan 2020 13:56:37 -0500 Received: from mail-wr1-f49.google.com ([209.85.221.49]:38861) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ipGVO-0006UW-TK for 38678@debbugs.gnu.org; Wed, 08 Jan 2020 13:56:35 -0500 Received: by mail-wr1-f49.google.com with SMTP id y17so4580835wrh.5 for <38678@debbugs.gnu.org>; Wed, 08 Jan 2020 10:56:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Lp4TqDehn+cWlBfHvMSB1Hl/vwIVCRSiN5iOcZ0H4+U=; b=UEa8RYAXBTTHxDFSTNy3DbCJDr6pBkzcooKuSxo9id1pj+6gd8rHekhYRQgW1hoOjA /qo4xg5Qwyu9y7nriIHdh1pCxsJvRpamGjoyquyeDuvBH6xN+m+woGyOlLBmKtsY9rPe xnLLzVTqXMPb0KAy0viNJoAz5ZKg3d+egpCH69Y15MHDcP5DxjeVUUBqZ0NnNFclXmOp OgRnfUP1C51x3jsf5AIfokJuINp0ERhIBRpblunQ1yQm+4PvrpFExZqsuHaNtN1DPhBv Rz6QwZDI3xRkX8rhhVDccND34wnhem2V5RXcGH60GgbGeOg0nir3gS3P27RxqeLsDjFW gemQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Lp4TqDehn+cWlBfHvMSB1Hl/vwIVCRSiN5iOcZ0H4+U=; b=YLla9zKWNmxpbh9vdLcuoWWDsFA7eWmAgipFFU8tqCf5G7o2hF+A7uYUkL/drGg4vZ B1A4Qh0//eq/XXxdJVawOrgCsuNC+UXx3Go28rHhp4z/0b6UisU4vOLoj49++ceVNIYR JWfnJqnG8cWj+Nildo3YGpxmlsb8Tu2nahswb7Ufsy+6csJ57im5knQ/NmHcRkt2moaL ptIX5tobp3UgY3a54IeTUJyTZAmMBqagv/izQ/XPl+5rgLV15uqkwYJteqwGSQqZm9MK gCm612tFpDTe9htQpOIi8Cu5rawPk3n3LwguzOBWgG8ZCsrQcmaOk2DnopkqHR243fru LE3w== X-Gm-Message-State: APjAAAVuorhd3ZmnTTtKahYUyxaHylrw1VhLc/xRWil+Ohb+yNhJwSZM d36KwWbnUNPNRZxpvZa9YypLFzuQ X-Google-Smtp-Source: APXvYqyZ8TgGvIk19jdbkVpQhEQYkmGbM5qUP2oZhq5Vbkz2g1yVzIr1ZmLidwP7tB9d3MLJfPH+XQ== X-Received: by 2002:a5d:6901:: with SMTP id t1mr5906255wru.94.1578509788705; Wed, 08 Jan 2020 10:56:28 -0800 (PST) Received: from pfiuh02.univ-paris-diderot.fr ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id l19sm34889wmj.12.2020.01.08.10.56.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2020 10:56:28 -0800 (PST) From: zimoun Date: Wed, 8 Jan 2020 19:56:21 +0100 Message-Id: <20200108185624.8609-1-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 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/scripts/graph.scm (%option): Add '--load-path' option. * doc/guix.texi: Document it. * tests/guix-graph.sh: Test it. --- doc/guix.texi | 9 +++++++++ guix/scripts/graph.scm | 8 ++++++++ tests/guix-graph.sh | 27 +++++++++++++++++++++++++-- 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index bb0ef17ddd..37218eb847 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -69,6 +69,7 @@ Copyright @copyright{} 2019 Jakob L. Kreuze@* Copyright @copyright{} 2019 Kyle Andrews@* Copyright @copyright{} 2019 Alex Griffin@* Copyright @copyright{} 2019 Guillaume Le Vaillant@* +Copyright @copyright{} 2019 Simon Tournier@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -10037,6 +10038,14 @@ Display the graph for @var{system}---e.g., @code{i686-linux}. The package dependency graph is largely architecture-independent, but there are some architecture-dependent bits that this option allows you to visualize. + +@item --load-path=@var{directory} +@itemx -L @var{directory} +Add @var{directory} to the front of the package module search path +(@pxref{Package Modules}). + +This allows users to define their own packages and make them visible to +the command-line tools. @end table On top of that, @command{guix graph} supports all the usual package diff --git a/guix/scripts/graph.scm b/guix/scripts/graph.scm index 7558cb1e85..53f407b2fc 100644 --- a/guix/scripts/graph.scm +++ b/guix/scripts/graph.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2019 Simon Tournier ;;; ;;; This file is part of GNU Guix. ;;; @@ -35,6 +36,7 @@ #:use-module ((guix scripts build) #:select (show-transformation-options-help options->transformation + %standard-build-options %transformation-options)) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) @@ -473,6 +475,9 @@ package modules, while attempting to retain user package modules." (lambda (opt name arg result) (alist-cons 'system arg (alist-delete 'system result eq?)))) + (find (lambda (option) + (member "load-path" (option-names option))) + %standard-build-options) (option '(#\h "help") #f #f (lambda args (show-help) @@ -501,6 +506,9 @@ Emit a representation of the dependency graph of PACKAGE...\n")) (display (G_ " -s, --system=SYSTEM consider the graph for SYSTEM--e.g., \"i686-linux\"")) (newline) + (display (G_ " + -L, --load-path=DIR prepend DIR to the package module search path")) + (newline) (show-transformation-options-help) (newline) (display (G_ " diff --git a/tests/guix-graph.sh b/tests/guix-graph.sh index 2d4b3fac3f..4c37b61b38 100644 --- a/tests/guix-graph.sh +++ b/tests/guix-graph.sh @@ -1,5 +1,6 @@ # GNU Guix --- Functional package management for GNU # Copyright © 2015, 2016, 2019 Ludovic Courtès +# Copyright © 2019 Simon Tournier # # This file is part of GNU Guix. # @@ -20,10 +21,29 @@ # Test the 'guix graph' command-line utility. # -tmpfile1="t-guix-graph1-$$" -tmpfile2="t-guix-graph2-$$" +module_dir="t-guix-graph-$$" +mkdir "$module_dir" +trap "rm -rf $module_dir" EXIT + +tmpfile1="$module_dir/t-guix-graph1-$$" +tmpfile2="$module_dir/t-guix-graph2-$$" trap 'rm -f "$tmpfile1" "$tmpfile2"' EXIT + +cat > "$module_dir/foo.scm"< X-Patchwork-Id: 19707 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 5B7E017A33; Wed, 8 Jan 2020 18:58:42 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 1D349179BD for ; Wed, 8 Jan 2020 18:58:42 +0000 (GMT) Received: from localhost ([::1]:48100 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipGXR-0002r7-K9 for patchwork@mira.cbaines.net; Wed, 08 Jan 2020 13:58:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50754) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipGVr-0000Ii-DT for guix-patches@gnu.org; Wed, 08 Jan 2020 13:57:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipGVq-0002ln-8Q for guix-patches@gnu.org; Wed, 08 Jan 2020 13:57:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:45338) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ipGVq-0002lV-4e for guix-patches@gnu.org; Wed, 08 Jan 2020 13:57:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ipGVq-0006WA-4R for guix-patches@gnu.org; Wed, 08 Jan 2020 13:57:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#38678] [PATCH v2 2/4] size: Add '--load-path' option. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 08 Jan 2020 18:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38678 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 38678@debbugs.gnu.org Cc: zimoun Received: via spool by 38678-submit@debbugs.gnu.org id=B38678.157850980024996 (code B ref 38678); Wed, 08 Jan 2020 18:57:02 +0000 Received: (at 38678) by debbugs.gnu.org; 8 Jan 2020 18:56:40 +0000 Received: from localhost ([127.0.0.1]:51305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ipGVT-0006V5-E2 for submit@debbugs.gnu.org; Wed, 08 Jan 2020 13:56:39 -0500 Received: from mail-wr1-f50.google.com ([209.85.221.50]:33528) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ipGVS-0006Uc-In for 38678@debbugs.gnu.org; Wed, 08 Jan 2020 13:56:38 -0500 Received: by mail-wr1-f50.google.com with SMTP id b6so4625945wrq.0 for <38678@debbugs.gnu.org>; Wed, 08 Jan 2020 10:56:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PPdowZ0nhM9sXqL43oPz2SLA3j3R6zawY+8NkpN+6Dc=; b=HF+zAfhzSFoF3e2LPyDRt8JcXACS3345aQg/uZy3DOxoe5PSAO7UjlaJrmtettiPFj TfyMmgBVOYTuWdshkeRW1HFEaB/pG8XCyCZPDiCOGI5HMObthlxxx2lMFQGesagAIarp OAqbVBuIndLrZIqO6ozM6qZLv3zDYCVSxISIn8WnON4ca+0gggULpfxo5+7LcW7DLA6t 9jo/shmTzlm069rLPbgW1xOKDhfJr9evJnyhF1Armwc5n6llKvLf3Ip7Nk4TCTJCm7xC 822XjYGZBb1hSS9qc3QX90UbLqZhs9RMQh3xdXWsvsCnaWrhr4RZFk34eBFRQjLZbCLi gfVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PPdowZ0nhM9sXqL43oPz2SLA3j3R6zawY+8NkpN+6Dc=; b=Z/z2CwzEAzGM5JsdbhDWP8FLYXAyTuD9KCNwDjLzb7MNAeSZfVNaYWX8WRyjahz+Ej o3OPJp+np3ZbQsUgzjxEOzfqlg7pdx1oWg1ZOJVHjvClHWoP1LOp9TkXfXMxXz7AUMqD YdJgMhkThvUyjqEdaWPwIoQ3uyD1YhivabuiXc/shM4qWw9TA8i4pfhhViUw3hxGlZBS 80dTK2ic9Dcyrrk31PD8MQxVmjPzCxgXKUcUwh6gptU64+5eMt9uJsJ1wto3UPihAKy4 7nNjAAJH3ExMmp6GWoYkMsCt5uKsBXFHjO6upCu9DK8ilnj77aPb1GIhzAmdcIG7l5gs HLSg== X-Gm-Message-State: APjAAAWDt2s5dzY7bBc4XmHUtXUM3fFiTliuhe2FF45EFkgPVz/vF5P9 cj7qqkYkS6EEYQ27QTFZ29jxLVHm X-Google-Smtp-Source: APXvYqyGdf5A05QV2+6yRdn59+EKoPFcipi3XHJeHEUYe/YnZigBA946wqz6V8MLZVLB+P0BAFO8uA== X-Received: by 2002:a5d:4752:: with SMTP id o18mr6087503wrs.330.1578509792581; Wed, 08 Jan 2020 10:56:32 -0800 (PST) Received: from pfiuh02.univ-paris-diderot.fr ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id l19sm34889wmj.12.2020.01.08.10.56.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2020 10:56:32 -0800 (PST) From: zimoun Date: Wed, 8 Jan 2020 19:56:22 +0100 Message-Id: <20200108185624.8609-2-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200108185624.8609-1-zimon.toutoune@gmail.com> References: <20200108185624.8609-1-zimon.toutoune@gmail.com> MIME-Version: 1.0 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/scripts/size.scm (%option): Add '--load-path' option. * doc/guix.texi: Document it. --- doc/guix.texi | 7 +++++++ guix/scripts/size.scm | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 37218eb847..3d26facd2e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -9837,6 +9837,13 @@ the case, @command{guix size} fails as it tries to load it. @itemx -s @var{system} Consider packages for @var{system}---e.g., @code{x86_64-linux}. +@item --load-path=@var{directory} +@itemx -L @var{directory} +Add @var{directory} to the front of the package module search path +(@pxref{Package Modules}). + +This allows users to define their own packages and make them visible to +the command-line tools. @end table @node Invoking guix graph diff --git a/guix/scripts/size.scm b/guix/scripts/size.scm index f549ce05b8..2446b84587 100644 --- a/guix/scripts/size.scm +++ b/guix/scripts/size.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ludovic Courtès +;;; Copyright © 2019 Simon Tournier ;;; ;;; This file is part of GNU Guix. ;;; @@ -19,6 +20,7 @@ (define-module (guix scripts size) #:use-module (guix ui) #:use-module (guix scripts) + #:use-module (guix scripts build) #:use-module (guix store) #:use-module (guix monads) #:use-module (guix combinators) @@ -242,6 +244,9 @@ Report the size of PACKAGE and its dependencies.\n")) -m, --map-file=FILE write to FILE a graphical map of disk usage")) (newline) (display (G_ " + -L, --load-path=DIR prepend DIR to the package module search path")) + (newline) + (display (G_ " -h, --help display this help and exit")) (display (G_ " -V, --version display version information and exit")) @@ -273,6 +278,9 @@ Report the size of PACKAGE and its dependencies.\n")) (option '(#\m "map-file") #t #f (lambda (opt name arg result) (alist-cons 'map-file arg result))) + (find (lambda (option) + (member "load-path" (option-names option))) + %standard-build-options) (option '(#\h "help") #f #f (lambda args (show-help) From patchwork Wed Jan 8 18:56:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Tournier X-Patchwork-Id: 19706 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 D242317A33; Wed, 8 Jan 2020 18:58:34 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 8AA64179BD for ; Wed, 8 Jan 2020 18:58:34 +0000 (GMT) Received: from localhost ([::1]:48098 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipGXK-0002kF-42 for patchwork@mira.cbaines.net; Wed, 08 Jan 2020 13:58:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50771) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipGVr-0000Jh-Sm for guix-patches@gnu.org; Wed, 08 Jan 2020 13:57:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipGVq-0002mW-Ld for guix-patches@gnu.org; Wed, 08 Jan 2020 13:57:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:45339) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ipGVq-0002mB-HU for guix-patches@gnu.org; Wed, 08 Jan 2020 13:57:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ipGVq-0006WI-Gw for guix-patches@gnu.org; Wed, 08 Jan 2020 13:57:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#38678] [PATCH v2 3/4] refresh: Add '--load-path' option. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 08 Jan 2020 18:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38678 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 38678@debbugs.gnu.org Cc: zimoun Received: via spool by 38678-submit@debbugs.gnu.org id=B38678.157850980225016 (code B ref 38678); Wed, 08 Jan 2020 18:57:02 +0000 Received: (at 38678) by debbugs.gnu.org; 8 Jan 2020 18:56:42 +0000 Received: from localhost ([127.0.0.1]:51308 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ipGVV-0006VO-UF for submit@debbugs.gnu.org; Wed, 08 Jan 2020 13:56:42 -0500 Received: from mail-wr1-f49.google.com ([209.85.221.49]:37118) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ipGVT-0006Ud-1M for 38678@debbugs.gnu.org; Wed, 08 Jan 2020 13:56:40 -0500 Received: by mail-wr1-f49.google.com with SMTP id w15so4581443wru.4 for <38678@debbugs.gnu.org>; Wed, 08 Jan 2020 10:56:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uja9w2laBr0IKnfnjd4tuzewzh6Pcou0zYT8M882Sgc=; b=ujCs6NNdvo7pDuv0tkKxN64FZgNSXdSKh8HDXoLixIcXshLwtHsZyoeLT1xC9kPwZf EWdya9r0MlA0lbaoAq8vGVInZUr0IGzaiSK70KdK3rJX6dV/AO/lfkx1ITtt7lERCYoW lezbrGtQEFSkRf3r1Xeulu3RreuZM2Q5DP32a3Dj6RcZaauxqf7krQfMiasnJpP00r9a cfz7V0+sXaDS/wdU/Inf0GlB2kLPs1Ux5tH6P9BP2QBGklvch/Zqzh0Ji9IugP34CNG0 ba/UBu52HogJ5F0lsE06wG/2o+rFSD4OP7jL0KttQvErElIHUWFWJOZF+HDzl9JE29Ng 8kuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uja9w2laBr0IKnfnjd4tuzewzh6Pcou0zYT8M882Sgc=; b=V7q0RnQebKZk0G/xZEXdrpNgvCqFo4FxsA6RYYLhHRreaPd3vxIrCgG5P2Bc17Nj22 OZegwujPvBOKKdHpnC4WOS7Ko6XcVCseN64fukAiqhhQ3h8+KKMEvdSpk6w7G29oZ2uQ SSxbzPg9VpwMf44ht4SqlPwlxVTTqlbbxX1g0SzSEEr0DJ2n0YBZTzteyZKSdqtAqWz4 /QwZyS5ZmMCa5Qg+GEyTRrHzoB+eBHVELYkMqJGUCi3rXg0ZuYaVxn5F/t8+QY/GVFfl Qno6FL3l5aT3NwFW+ogxtfPp60IIaACTsO+YemVKj+b8If5ERBuddwih7yVs01lYxggP pXXQ== X-Gm-Message-State: APjAAAUJDYdRHNRLHomxhxqc3iD2LVwG51pNtc5iG84RiOr9m/RjQWaV Pkcrx3Z8oPhKau2hL6cH5lkJyIzc X-Google-Smtp-Source: APXvYqxVPtpxBeJfcUO8D/0OoFTh439zC/ol6LE4o6E/UGRutFpSVn5GYqYGz4P9CXFbGnqvN8gFCQ== X-Received: by 2002:a5d:4fd0:: with SMTP id h16mr5988573wrw.255.1578509793141; Wed, 08 Jan 2020 10:56:33 -0800 (PST) Received: from pfiuh02.univ-paris-diderot.fr ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id l19sm34889wmj.12.2020.01.08.10.56.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2020 10:56:32 -0800 (PST) From: zimoun Date: Wed, 8 Jan 2020 19:56:23 +0100 Message-Id: <20200108185624.8609-3-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200108185624.8609-1-zimon.toutoune@gmail.com> References: <20200108185624.8609-1-zimon.toutoune@gmail.com> MIME-Version: 1.0 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/scripts/refresh.scm (%option): Add '--load-path' option. * doc/guix.texi: Document it. --- doc/guix.texi | 9 ++++++++- guix/scripts/refresh.scm | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 3d26facd2e..bee4c3b2c9 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -69,7 +69,7 @@ Copyright @copyright{} 2019 Jakob L. Kreuze@* Copyright @copyright{} 2019 Kyle Andrews@* Copyright @copyright{} 2019 Alex Griffin@* Copyright @copyright{} 2019 Guillaume Le Vaillant@* -Copyright @copyright{} 2019 Simon Tournier@* +Copyright @copyright{} 2019, 2020 Simon Tournier@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -9552,6 +9552,13 @@ the user whether to download it or not. This is the default behavior. @item --key-server=@var{host} Use @var{host} as the OpenPGP key server when importing a public key. +@item --load-path=@var{directory} +Add @var{directory} to the front of the package module search path +(@pxref{Package Modules}). + +This allows users to define their own packages and make them visible to +the command-line tools. + @end table The @code{github} updater uses the diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm index daf6fcf947..4695d0b517 100644 --- a/guix/scripts/refresh.scm +++ b/guix/scripts/refresh.scm @@ -7,6 +7,7 @@ ;;; Copyright © 2017 Mathieu Othacehe ;;; Copyright © 2018 Efraim Flashner ;;; Copyright © 2019 Ricardo Wurmus +;;; Copyright © 2020 Simon Tournier ;;; ;;; This file is part of GNU Guix. ;;; @@ -27,6 +28,7 @@ #:use-module (guix ui) #:use-module (gcrypt hash) #:use-module (guix scripts) + #:use-module ((guix scripts build) #:select (%standard-build-options)) #:use-module (guix store) #:use-module (guix utils) #:use-module (guix packages) @@ -116,6 +118,19 @@ (leave (G_ "unsupported policy: ~a~%") arg))))) + ;; The short option -L is already used by --list-updaters, therefore + ;; it needs to be removed from %standard-build-options. + (let ((%load-path-option (find (lambda (option) + (member "load-path" + (option-names option))) + %standard-build-options))) + (option + (filter (lambda (name) (equal? "load-path" name)) + (option-names %load-path-option)) + (option-required-arg? %load-path-option) + (option-optional-arg? %load-path-option) + (option-processor %load-path-option))) + (option '(#\h "help") #f #f (lambda args (show-help) @@ -165,6 +180,9 @@ specified with `--select'.\n")) 'always', 'never', and 'interactive', which is also used when 'key-download' is not specified")) (newline) + (display (G_ " + --load-path=DIR prepend DIR to the package module search path")) + (newline) (display (G_ " -h, --help display this help and exit")) (display (G_ " From patchwork Wed Jan 8 18:56:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Tournier X-Patchwork-Id: 19708 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 6E24417A33; Wed, 8 Jan 2020 18:58:46 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 2B799179BD for ; Wed, 8 Jan 2020 18:58:46 +0000 (GMT) Received: from localhost ([::1]:48102 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipGXV-0002xk-Mi for patchwork@mira.cbaines.net; Wed, 08 Jan 2020 13:58:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50784) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipGVs-0000KC-6y for guix-patches@gnu.org; Wed, 08 Jan 2020 13:57:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipGVr-0002n6-0z for guix-patches@gnu.org; Wed, 08 Jan 2020 13:57:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:45340) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ipGVq-0002mu-To for guix-patches@gnu.org; Wed, 08 Jan 2020 13:57:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ipGVq-0006WP-U4 for guix-patches@gnu.org; Wed, 08 Jan 2020 13:57:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#38678] [PATCH v2 4/4] edit: Add '--load-path' option. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 08 Jan 2020 18:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38678 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 38678@debbugs.gnu.org Cc: zimoun Received: via spool by 38678-submit@debbugs.gnu.org id=B38678.157850980225022 (code B ref 38678); Wed, 08 Jan 2020 18:57:02 +0000 Received: (at 38678) by debbugs.gnu.org; 8 Jan 2020 18:56:42 +0000 Received: from localhost ([127.0.0.1]:51310 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ipGVW-0006VR-7f for submit@debbugs.gnu.org; Wed, 08 Jan 2020 13:56:42 -0500 Received: from mail-wr1-f41.google.com ([209.85.221.41]:41802) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ipGVT-0006Uf-Td for 38678@debbugs.gnu.org; Wed, 08 Jan 2020 13:56:40 -0500 Received: by mail-wr1-f41.google.com with SMTP id c9so4538853wrw.8 for <38678@debbugs.gnu.org>; Wed, 08 Jan 2020 10:56:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=g197uW4BKu7n/HBq0yHksB4SO8w5iVBrBpWasqJJ6NA=; b=HHTenbqLRPSGUm5H0O28MWBt8MlYhWBxg8QKO5MN5bsnVem+v9WtjNRKND2TKwLkbG MeuDZIX4RsuBJHjRXw3P5qak7/9h1Y6wy7zUFzJTDLQWxQYgzz3ZkS3avaSzBf9n347J DQPwiU4th2tV9mFY3FGGFkDpOtob93Ptt1BBh8rsGrsKICvFmIp3edUzEngV/y6NJcU7 eBqjy0q+4oAvnoXMv5NTsRJvtr5+5Y5q4s0XWAVoCNrcEWi1km7dHur2MfGSrQqW8nhS M/kVH+avK+eO9epve1qGkKpRJWs0ou+KSOJpxAkXxhShM/m2cVyIdR3nqj5JQqtW18Jc TAIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=g197uW4BKu7n/HBq0yHksB4SO8w5iVBrBpWasqJJ6NA=; b=fOG9XHnkMXVjFagX/9PiHgxbIiWjABR38ok1kMxQi2WoK+TKr2w2FbqWTAa9I2ms35 gPCKqi0HCxNSud5XUVrT3DQ8qPZ8MQhC6HSomoDCf0wpxwFpkY3r1IcTyO5EsEgKqTrc hjD0QdVtJfF9CIYc7xnF3l9Jb5ISHzKdOFsToIx8gN33QZ26E2yN4bCcSGTVC1FLMNf4 bxknZPNzKrGKfDLwTJAzQn/KNp5f+z5ukUikwnzRnFJcN+NQh6Hxkb0vS9a6XBwSAIT1 4mHxmb8G6wWOX7/ASuY9OQMbwHqreajGYdAQR+WaVLxE0unhIjzrw1zqfldixzI8YYnv SOfQ== X-Gm-Message-State: APjAAAWxw7ck+umlMwBjR32ANatcHmcrT80AGN0rhvcQwTRKuRe6OFRf rviOScElDQXQyVbOnzEgQm0zZgU9 X-Google-Smtp-Source: APXvYqw25x0GEpH1SWBfBTYNMKSFWQAikG+ba+Xxykv5VZg9RAyaJu3x7JvdjHbjXhkZr3vca4R7CQ== X-Received: by 2002:a5d:4e0a:: with SMTP id p10mr6160450wrt.229.1578509793910; Wed, 08 Jan 2020 10:56:33 -0800 (PST) Received: from pfiuh02.univ-paris-diderot.fr ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id l19sm34889wmj.12.2020.01.08.10.56.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2020 10:56:33 -0800 (PST) From: zimoun Date: Wed, 8 Jan 2020 19:56:24 +0100 Message-Id: <20200108185624.8609-4-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200108185624.8609-1-zimon.toutoune@gmail.com> References: <20200108185624.8609-1-zimon.toutoune@gmail.com> MIME-Version: 1.0 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/scripts/edit.scm (%option): Add '--load-path' option. * doc/guix.texi: Document it. --- doc/guix.texi | 4 ++++ guix/scripts/edit.scm | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index bee4c3b2c9..00eb85a4f7 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -8705,6 +8705,10 @@ have created your own packages on @code{GUIX_PACKAGE_PATH} recipes. In other cases, you will be able to examine the read-only recipes for packages currently in the store. +Instead of @code{GUIX_PACKAGE_PATH}, the command-line option +@code{--load-path=@var{directory}} (or in short @code{-L +@var{directory}}) allows you to add @var{directory} to the front of the +package module search path and so make your own packages visible. @node Invoking guix download @section Invoking @command{guix download} diff --git a/guix/scripts/edit.scm b/guix/scripts/edit.scm index da3d2775e8..a6fd1d2751 100644 --- a/guix/scripts/edit.scm +++ b/guix/scripts/edit.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015, 2016, 2019 Ludovic Courtès ;;; Copyright © 2015 Mathieu Lirzin +;;; Copyright © 2020 Simon Tournier ;;; ;;; This file is part of GNU Guix. ;;; @@ -20,6 +21,7 @@ (define-module (guix scripts edit) #:use-module (guix ui) #:use-module (guix scripts) + #:use-module ((guix scripts build) #:select (%standard-build-options)) #:use-module (guix utils) #:use-module (gnu packages) #:use-module (srfi srfi-1) @@ -28,7 +30,10 @@ guix-edit)) (define %options - (list (option '(#\h "help") #f #f + (list (find (lambda (option) + (member "load-path" (option-names option))) + %standard-build-options) + (option '(#\h "help") #f #f (lambda args (show-help) (exit 0))) @@ -39,6 +44,9 @@ (define (show-help) (display (G_ "Usage: guix edit PACKAGE... Start $VISUAL or $EDITOR to edit the definitions of PACKAGE...\n")) + (newline) + (display (G_ " + -L, --load-path=DIR prepend DIR to the package module search path")) (newline) (display (G_ " -h, --help display this help and exit"))