From patchwork Wed Jan 15 17:00:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Tournier X-Patchwork-Id: 19829 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 F239B17AC8; Wed, 15 Jan 2020 17:05:50 +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 56C3D17AC3 for ; Wed, 15 Jan 2020 17:05:47 +0000 (GMT) Received: from localhost ([::1]:57688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irm6s-0004VK-QW for patchwork@mira.cbaines.net; Wed, 15 Jan 2020 12:05:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40719) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irm2U-0007hf-Ap for guix-patches@gnu.org; Wed, 15 Jan 2020 12:01:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1irm2Q-0008K9-Co for guix-patches@gnu.org; Wed, 15 Jan 2020 12:01:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:57709) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1irm2Q-0008K5-7M for guix-patches@gnu.org; Wed, 15 Jan 2020 12:01:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1irm2Q-0000H3-4r for guix-patches@gnu.org; Wed, 15 Jan 2020 12:01:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#38678] [PATCH v4 1/6] 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, 15 Jan 2020 17:01: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.1579107621942 (code B ref 38678); Wed, 15 Jan 2020 17:01:02 +0000 Received: (at 38678) by debbugs.gnu.org; 15 Jan 2020 17:00:21 +0000 Received: from localhost ([127.0.0.1]:35438 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1irm1j-0000Ez-Mm for submit@debbugs.gnu.org; Wed, 15 Jan 2020 12:00:21 -0500 Received: from mail-wr1-f44.google.com ([209.85.221.44]:43246) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1irm1g-0000Ec-AM for 38678@debbugs.gnu.org; Wed, 15 Jan 2020 12:00:18 -0500 Received: by mail-wr1-f44.google.com with SMTP id d16so16478517wre.10 for <38678@debbugs.gnu.org>; Wed, 15 Jan 2020 09:00:16 -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=kYhY4SIuyb3Ji4RmmyZ5/sBHLLFsZogowTL3X5gCk/ZfCQXDQCE15cZtBvldFjjFWO oXTeOs6zdTzIT7vUHJJ3Fk85ZgXRqTW6NZYKr/HA/9i/wM5RGgcidw62G1pFHtCL+jkU yVIgI8E/ERrtayKbwBC/tExDQPjfNhquMcx5lenDn18AI8P0rpaXhbfgbEtxops8qMTo ZsuUqZV2jA1LNYIcoKlzztV6SVJsA/YcoBMhyhefd5sNTymxudrKjz2xR5z5vHbDG1+X SxAJ3yBrndVwzTJuyD54D1yMuv8DhXvvevHEGXvxXuAqK5W1yql1Y71K87+lXQrLqHR3 SK5w== 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=Qeo1I22MXk3HwG/GnHsXlS+JkwiqVaaLOC/fN+yObvUSKiKy/t0ZlBg/Zf3xJElYey TkhVkV9RVWuii6Cg3BmRglhSsDT5YqTpUm4vKaQr3ZOu02pSOYiqNyEi759rwqibqQtT 7IFg8MUEHxZrMj472kXMd/x9OWXrkkQgI+qp0k0MYK0PeHIm27RfyhciTN3ibpFNNnIu JVQaKOYZ8fPHQ7TmT0XUyvVTMO5an3qe1e3w9+NJyUKwn+A7eXeztbRVz/t0rbBv96OX B4Rtp2QEkKTBTycgCibHcQWx+RzTnLyV4qcdKBYElp+FEHkTOuKhmGCFLFb9VHjv0VfH BowQ== X-Gm-Message-State: APjAAAUl13Pg63HObYiFngvuVhAsHgu5bjoRL3PRRVccHPJj+xWpXiEg kHq5AtOmUJ41TEAc3axYpyjDTYnl X-Google-Smtp-Source: APXvYqxGQobtCSQgVGhMlwC+GUf0SDbmfkqT5rJufXNBs32+Vdhwtsc9zA00VTJeCdzSd9zR7KSEOg== X-Received: by 2002:adf:dfc9:: with SMTP id q9mr34473931wrn.219.1579107609972; Wed, 15 Jan 2020 09:00:09 -0800 (PST) Received: from pfiuh02.univ-paris-diderot.fr ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id l3sm22907347wrt.29.2020.01.15.09.00.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jan 2020 09:00:09 -0800 (PST) From: zimoun Date: Wed, 15 Jan 2020 18:00:01 +0100 Message-Id: <20200115170006.24892-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: 19830 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 EC67617AC8; Wed, 15 Jan 2020 17:06:00 +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 AF16C17AC5 for ; Wed, 15 Jan 2020 17:05:56 +0000 (GMT) Received: from localhost ([::1]:57690 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irm79-0004o7-UK for patchwork@mira.cbaines.net; Wed, 15 Jan 2020 12:05:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40728) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irm2W-0007jY-25 for guix-patches@gnu.org; Wed, 15 Jan 2020 12:01:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1irm2Q-0008KQ-QO for guix-patches@gnu.org; Wed, 15 Jan 2020 12:01:07 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:57710) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1irm2Q-0008KJ-Lk for guix-patches@gnu.org; Wed, 15 Jan 2020 12:01:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1irm2Q-0000HB-KR for guix-patches@gnu.org; Wed, 15 Jan 2020 12:01:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#38678] [PATCH v4 2/6] size: Add '--load-path' option. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 15 Jan 2020 17:01: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.1579107626974 (code B ref 38678); Wed, 15 Jan 2020 17:01:02 +0000 Received: (at 38678) by debbugs.gnu.org; 15 Jan 2020 17:00:26 +0000 Received: from localhost ([127.0.0.1]:35441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1irm1m-0000FQ-Jn for submit@debbugs.gnu.org; Wed, 15 Jan 2020 12:00:26 -0500 Received: from mail-wr1-f54.google.com ([209.85.221.54]:41634) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1irm1h-0000Ef-1O for 38678@debbugs.gnu.org; Wed, 15 Jan 2020 12:00:20 -0500 Received: by mail-wr1-f54.google.com with SMTP id c9so16483471wrw.8 for <38678@debbugs.gnu.org>; Wed, 15 Jan 2020 09:00:16 -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=mQ11WNAA+1yojQDmVjOQ0Ty2SlJVQD3H1Xl9tvWlolXRNU8WALkvL5I92RYR9413fb bgOi0TXIuPXqoAQHA9gtocr1bUG5CNq2jp0k+USZAC3df4G0VhtAh2k7LMr4gDhV05hI kHo5pGoLMfLXTYD4MWK5TwuZ0z6T18ajVM/V81M/BduQEOQPbfXZ5CQQwnSYK/XE0JJH DfV5oxQ4FEtpbIgBULA9byGRo3Of0EneKAdPVOvntKAtMLZ7U8NzZW85BCQR2n51Y0gQ D2CYpQE+6ythtPV6kgv1z35ZmlxRPORkldKm0rxYhq8MvJPDQmKY8YTCmeXfoRc3AYE3 YOUw== 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=tK6COppzlFrR2CbbVpXWHllPkhzWMMah36tLDyec3OymJr9Y4CIoPc+il44vl5e7wQ olNwMjLOelviTekg9OqbhwqDDko7atyUrbKUB4yw6Y44Wcl7XnNY8a6OxAfJec2eHmrn MhBGafcnhy1qYKTl/HbIZ9c5+7gJo7FW/3jnFNMx+8DOEYWj7MnCldVKKCg3IB1sM4C2 t33/0ZeR14QVjRLOqiYanQWWy2mm47tjUES7Be/nrRZM6NYw6Z66zTSrNkdQdFLxN51y Y8MV/XslLw6iHoFWg1NorJCYnpRWj50BB4gcRvxrHmLj9Hg+FVQjsfKcXspE49XpRk7K bkyw== X-Gm-Message-State: APjAAAXXODe0+8m7LItve4hXL9tbHH0EGPtli4NXHUmH3Blun6a9fWJt Ns0AZtsZD2GEy1eyLjUHCh4kuILU X-Google-Smtp-Source: APXvYqx/faOBJxES9pY9hyTu+Ip8xf0I7UcpeequaC8f+EnPUAewlho+w2vRoED2vueFrMMk0JcCQA== X-Received: by 2002:adf:d183:: with SMTP id v3mr32495446wrc.180.1579107610841; Wed, 15 Jan 2020 09:00:10 -0800 (PST) Received: from pfiuh02.univ-paris-diderot.fr ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id l3sm22907347wrt.29.2020.01.15.09.00.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jan 2020 09:00:10 -0800 (PST) From: zimoun Date: Wed, 15 Jan 2020 18:00:02 +0100 Message-Id: <20200115170006.24892-2-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200115170006.24892-1-zimon.toutoune@gmail.com> References: <20200115170006.24892-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 15 17:00:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Tournier X-Patchwork-Id: 19828 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 3908817AC8; Wed, 15 Jan 2020 17:04:00 +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 ABB4717AC5 for ; Wed, 15 Jan 2020 17:03:56 +0000 (GMT) Received: from localhost ([::1]:57614 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irm5D-00029e-Ux for patchwork@mira.cbaines.net; Wed, 15 Jan 2020 12:03:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40746) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irm2X-0007lN-Hf for guix-patches@gnu.org; Wed, 15 Jan 2020 12:01:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1irm2R-0008Kf-6I for guix-patches@gnu.org; Wed, 15 Jan 2020 12:01:08 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:57711) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1irm2R-0008KV-21 for guix-patches@gnu.org; Wed, 15 Jan 2020 12:01:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1irm2R-0000HI-0y for guix-patches@gnu.org; Wed, 15 Jan 2020 12:01:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#38678] [PATCH v4 3/6] refresh: Add '--load-path' option. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 15 Jan 2020 17:01: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.1579107630984 (code B ref 38678); Wed, 15 Jan 2020 17:01:02 +0000 Received: (at 38678) by debbugs.gnu.org; 15 Jan 2020 17:00:30 +0000 Received: from localhost ([127.0.0.1]:35443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1irm1q-0000Ff-Ei for submit@debbugs.gnu.org; Wed, 15 Jan 2020 12:00:30 -0500 Received: from mail-wr1-f45.google.com ([209.85.221.45]:34267) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1irm1h-0000Ei-K6 for 38678@debbugs.gnu.org; Wed, 15 Jan 2020 12:00:21 -0500 Received: by mail-wr1-f45.google.com with SMTP id t2so16501866wrr.1 for <38678@debbugs.gnu.org>; Wed, 15 Jan 2020 09:00:17 -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=TkCxHdIvP8Cdf6l8viebQ6jzn04XhgEqzH9lccQOD+Q=; b=klFdLuK/JER6T3vgTOAMkXBOkLvq/sAUS07U/QSMy89F7+yJwLLFIZN8ROSC5B1GVu IGV5XVEfnKoBldiI2f74Cv1eBvWQhjH1bRE1ySctSAfeZV4v5tDwZcmoi9jP/KFeY2UQ RKtNhrhSWQ2TDjCmP5QtypaeMBnizri+haGWw3I5k0WGJUr2EFMtcdvKdHvZNS1JIk2D ASsr0FCoiJnjeRyAFg5nhYxqlWRDXK3k6TafNmzygnTqogJTR25JTPKzfAPQ38MNP8hp Mn/fCsR2IeOIBeYHFGwMeMomKCvCLf+coSt+9LPm4bc/y3JJo/qtSyr6WW8g2l7oNYVm tivQ== 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=TkCxHdIvP8Cdf6l8viebQ6jzn04XhgEqzH9lccQOD+Q=; b=cmanYSFb3ckwPMPtARWbTamVGoIVpMP4I6rb75tlpB2GN1qCoo9p2GlM6D8Y+drNsl X2LRDdgeIK/Hj3X9HDRygMK9kibJs2zqCjxZ5QMdhcLLu2OVXqz326vb644brdaf5VjD XpEStQOGnOlyCut0icifOVv2CmNf651qjRNNNuyQTb+IEKmMZQey5oN17G90oW1/py8Q g3Id0WLII7528xELDIS3FIcyAUamz0NMJ3oeEygjCp+d/A0AVOUQbLn4Clfj1aOMOvrA FYuPytilZJW4mdY3AK7AeYd0pSTwjIp53NvRwBCyKUfsP2ilxW0GHLYC3gLWcdPRGKFc OkGw== X-Gm-Message-State: APjAAAVgVEm6QRN8LBR0/bwJ3RtwRx+jnYNVUa3EncbN9hBN8DvQecu5 fl0+HaOWkYcIJx/drr1ycaCYxBze X-Google-Smtp-Source: APXvYqyc1OOt4suHRQ6euQHRM3bTB9wkHhO3svQUKzOIF8Puh4IpT2ZAiwud0J11vWTsZYSKq2qSuw== X-Received: by 2002:a5d:610a:: with SMTP id v10mr33048015wrt.267.1579107611668; Wed, 15 Jan 2020 09:00:11 -0800 (PST) Received: from pfiuh02.univ-paris-diderot.fr ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id l3sm22907347wrt.29.2020.01.15.09.00.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jan 2020 09:00:11 -0800 (PST) From: zimoun Date: Wed, 15 Jan 2020 18:00:03 +0100 Message-Id: <20200115170006.24892-3-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200115170006.24892-1-zimon.toutoune@gmail.com> References: <20200115170006.24892-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..bc8e906054 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) (not (equal? #\L 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 15 17:00:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Tournier X-Patchwork-Id: 19832 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 4845817AC8; Wed, 15 Jan 2020 17:07:20 +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 919F417AC5 for ; Wed, 15 Jan 2020 17:07:16 +0000 (GMT) Received: from localhost ([::1]:57726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irm8S-00073n-3H for patchwork@mira.cbaines.net; Wed, 15 Jan 2020 12:07:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40724) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irm2V-0007iq-Eu for guix-patches@gnu.org; Wed, 15 Jan 2020 12:01:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1irm2R-0008Lq-K5 for guix-patches@gnu.org; Wed, 15 Jan 2020 12:01:07 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:57712) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1irm2R-0008L8-FU for guix-patches@gnu.org; Wed, 15 Jan 2020 12:01:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1irm2R-0000HP-DZ for guix-patches@gnu.org; Wed, 15 Jan 2020 12:01:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#38678] [PATCH v4 4/6] edit: Add '--load-path' option. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 15 Jan 2020 17:01:03 +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.15791076331000 (code B ref 38678); Wed, 15 Jan 2020 17:01:03 +0000 Received: (at 38678) by debbugs.gnu.org; 15 Jan 2020 17:00:33 +0000 Received: from localhost ([127.0.0.1]:35445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1irm1u-0000Fp-2d for submit@debbugs.gnu.org; Wed, 15 Jan 2020 12:00:33 -0500 Received: from mail-wr1-f42.google.com ([209.85.221.42]:35301) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1irm1i-0000Ej-Am for 38678@debbugs.gnu.org; Wed, 15 Jan 2020 12:00:22 -0500 Received: by mail-wr1-f42.google.com with SMTP id g17so16472096wro.2 for <38678@debbugs.gnu.org>; Wed, 15 Jan 2020 09:00:18 -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=DEhE8WXTV8ZmhTIBqMaJq2WWnCxDP7jhI/Fb/txT5sygCulWJSKrzjkWfAvXhMnVKN uZlzQ0ChjwqgzQj4w0RJD2fATHH1eVHTW0JB7+4n43lo8kj2CDSbEfkA1i9wDVL7QwJR TQMshLyq+0H+VWRaOE8anPdsVxvk3QD+XQHAQI7b2VlULUsHcCnRQu0nM/WzbQwIrVpe f3QxEt8Q8wMFTvQRkrnAE2kHslpN9GAR8ch/Et0rp+G8u3wVCVvQx1B1WS4lVdJdI/1i YDQSyVQ5OLOQlF4Ti4zu/F1Y/rXOGDLLO/ElEk9KfeqaKJZF0S1i6NbJB8iqvoH9ywyD UISw== 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=M9dKdz6o7/1z4230d9DN8JgFcWhoHDHEA7CZERsxVUCP+DF9bW9ateyJW4ERA1yXHZ GreG6rTfTRMWLi3CIdV0+QeAUEfJ45KT5MeFelSLT7b+n0sy8J+g3miWDNrcYk8pyQT1 TBnHccK5qwGGZWuqQEuAEVbNQ/azXn0+ri2Fj5KRNjvD/sdyHYKZEJtl5B7pi/klSRLW ekyhQCSYrsEcTZI+xnPS2GhxilAJlPQiaGF+cDFSwz6Sir562sMWLSbLnr28MvJDw2wO rzYQe7MmfkFZSALKpwp+r1uVHJDLurbvs6qjnO54izBzALx8Lp4FxY5IDIbBtiJkRW+Y D8IA== X-Gm-Message-State: APjAAAXdAchryNxvLJ17VceyTQY/vpRSGhlNo3jW1CRdCLb1inUY/c07 1ikKd7fd4EzRlRR4lq12Thkb/b6c X-Google-Smtp-Source: APXvYqzLk1X04WankmMFBkyAu+X8jbZ4L/avBPfGz05kNy/5t+3oMHYS/siTFw4nYJK+4gxM1VYiHw== X-Received: by 2002:a5d:6305:: with SMTP id i5mr32785932wru.119.1579107612426; Wed, 15 Jan 2020 09:00:12 -0800 (PST) Received: from pfiuh02.univ-paris-diderot.fr ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id l3sm22907347wrt.29.2020.01.15.09.00.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jan 2020 09:00:11 -0800 (PST) From: zimoun Date: Wed, 15 Jan 2020 18:00:04 +0100 Message-Id: <20200115170006.24892-4-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200115170006.24892-1-zimon.toutoune@gmail.com> References: <20200115170006.24892-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")) From patchwork Wed Jan 15 17:00:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Tournier X-Patchwork-Id: 19831 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 E917217AC8; Wed, 15 Jan 2020 17:06:05 +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 A856917AC3 for ; Wed, 15 Jan 2020 17:06:05 +0000 (GMT) Received: from localhost ([::1]:57692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irm7I-00053a-WD for patchwork@mira.cbaines.net; Wed, 15 Jan 2020 12:06:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40744) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irm2X-0007l1-8w for guix-patches@gnu.org; Wed, 15 Jan 2020 12:01:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1irm2R-0008MZ-W0 for guix-patches@gnu.org; Wed, 15 Jan 2020 12:01:09 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:57713) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1irm2R-0008M6-Re for guix-patches@gnu.org; Wed, 15 Jan 2020 12:01:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1irm2R-0000HZ-QN for guix-patches@gnu.org; Wed, 15 Jan 2020 12:01:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#38678] [PATCH v4 5/6] repl: Add '--load-path' option. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 15 Jan 2020 17:01:03 +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.15791076341007 (code B ref 38678); Wed, 15 Jan 2020 17:01:03 +0000 Received: (at 38678) by debbugs.gnu.org; 15 Jan 2020 17:00:34 +0000 Received: from localhost ([127.0.0.1]:35447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1irm1x-0000G5-TA for submit@debbugs.gnu.org; Wed, 15 Jan 2020 12:00:34 -0500 Received: from mail-wr1-f48.google.com ([209.85.221.48]:40233) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1irm1j-0000El-53 for 38678@debbugs.gnu.org; Wed, 15 Jan 2020 12:00:24 -0500 Received: by mail-wr1-f48.google.com with SMTP id c14so16479973wrn.7 for <38678@debbugs.gnu.org>; Wed, 15 Jan 2020 09:00:19 -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=nZ67QpFig0c4Dpg0T+xnl+7pPIS6DVkM6+DNc/qAdjM=; b=NgQJEGrEqlK7Wqg5dd9zv8AFGH+mxcPhX7ZjHemZe5nDhr1UGqKEdWJvK1eZwBTP4N jmGimJLyC35L5vRC51zKmSbMUupH6/NywWgpEYbOWEzYujOOlZVT55AA9Ak5I3BfoB32 djCnxxePc++UwZJp+OJVH4vtC+lt0ICKcEYdRlxBjOIMZYD+xV08Pt0mHpJeDmP8Z1pW AfkQk1JOMM9tWF3T8luoNToYj6Zb3PpLU0gUCq2yVIigFcpY/+cnqfSJ4WYwseqkj3yi zGLvSnBCfH+8IaGBDlZwTkx8acXnFdBdUqYeN5GptIBJpCWbo6Mb6pckhtAZpjFnX95D Sv5w== 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=nZ67QpFig0c4Dpg0T+xnl+7pPIS6DVkM6+DNc/qAdjM=; b=dSskWNnqKVXhCBFK4tBt1g3O9OUBZOJ6tWtmxdgxRH8BfXgOpeVJHWfsAy3uB5lsy9 +tVjelhMtOeg5dB90b+Lo1NOB6TTHypchpRMteNYgt1MPGy+QerGZnK1gQSo3OCUi5zo 5tDZe49CiRlRTZRRqBfM7zmm3F6cJ1hRrvQgbd0l7bnCgdLPCFEwKhcTv0s1RaCvf1kb 24QI+5/rQSSYvMquBAgIAnSwXvpnDDk6G3ErWZQWCmhhMePRn6IA9lVxYskJvw+PZn7u UnN7+275Jol/xS7v8cMUb2TMT/LS0bDZS47uH/1yM5kQj8pFI5k4VyFe2jZWZ1z6e04Z XJBw== X-Gm-Message-State: APjAAAXYIDijk8llCe//Mn7SenuG/4O4OSOVBR4yxirYDY59jZts6LWL God7ONVaClk+aQpVaqzA/pks2aM7 X-Google-Smtp-Source: APXvYqyLn4brXxGYneVYQ7LB9QGy/qhmJqODZEuZUiXGCLFY/w9Qv39KpQdAs6YF6mGTqgLQ94idnw== X-Received: by 2002:adf:fe50:: with SMTP id m16mr31381516wrs.217.1579107613168; Wed, 15 Jan 2020 09:00:13 -0800 (PST) Received: from pfiuh02.univ-paris-diderot.fr ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id l3sm22907347wrt.29.2020.01.15.09.00.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jan 2020 09:00:12 -0800 (PST) From: zimoun Date: Wed, 15 Jan 2020 18:00:05 +0100 Message-Id: <20200115170006.24892-5-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200115170006.24892-1-zimon.toutoune@gmail.com> References: <20200115170006.24892-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/repl.scm (%option): Add '--load-path' option. * doc/guix.texi: Document it. --- doc/guix.texi | 8 ++++++++ guix/scripts/repl.scm | 9 ++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 00eb85a4f7..ef6d1fc178 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -7995,6 +7995,14 @@ Accept connections on localhost on port 37146. @item --listen=unix:/tmp/socket Accept connections on the Unix-domain socket @file{/tmp/socket}. @end table + +@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 tool. @end table @c ********************************************************************* diff --git a/guix/scripts/repl.scm b/guix/scripts/repl.scm index e1cc759fc8..39a9b09656 100644 --- a/guix/scripts/repl.scm +++ b/guix/scripts/repl.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2018, 2019 Ludovic Courtès +;;; Copyright © 2020 Simon Tournier ;;; ;;; This file is part of GNU Guix. ;;; @@ -19,6 +20,7 @@ (define-module (guix scripts repl) #:use-module (guix ui) #:use-module (guix scripts) + #:use-module ((guix scripts build) #:select (%standard-build-options)) #:use-module (guix repl) #:use-module (guix utils) #:use-module (guix packages) @@ -52,7 +54,10 @@ (alist-cons 'type (string->symbol arg) result))) (option '("listen") #t #f (lambda (opt name arg result) - (alist-cons 'listen arg result))))) + (alist-cons 'listen arg result))) + (find (lambda (option) + (member "load-path" (option-names option))) + %standard-build-options))) (define (show-help) @@ -60,6 +65,8 @@ Start a Guile REPL in the Guix execution environment.\n")) (display (G_ " -t, --type=TYPE start a REPL of the given TYPE")) + (display (G_ " + -L, --load-path=DIR prepend DIR to the package module search path")) (newline) (display (G_ " -h, --help display this help and exit")) From patchwork Wed Jan 15 17:00:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Tournier X-Patchwork-Id: 19827 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 6706A17AC8; Wed, 15 Jan 2020 17:02:15 +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 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 4AB1617AC5 for ; Wed, 15 Jan 2020 17:02:11 +0000 (GMT) Received: from localhost ([::1]:57530 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irm3W-0008Vn-0k for patchwork@mira.cbaines.net; Wed, 15 Jan 2020 12:02:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40733) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irm2W-0007js-BP for guix-patches@gnu.org; Wed, 15 Jan 2020 12:01:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1irm2S-0008Mz-Bb for guix-patches@gnu.org; Wed, 15 Jan 2020 12:01:08 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:57714) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1irm2S-0008Mo-7d for guix-patches@gnu.org; Wed, 15 Jan 2020 12:01:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1irm2S-0000Hg-6s for guix-patches@gnu.org; Wed, 15 Jan 2020 12:01:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#38678] [PATCH v4 6/6] repl: Fix '--help' message. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 15 Jan 2020 17:01:04 +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.15791076341013 (code B ref 38678); Wed, 15 Jan 2020 17:01:04 +0000 Received: (at 38678) by debbugs.gnu.org; 15 Jan 2020 17:00:34 +0000 Received: from localhost ([127.0.0.1]:35449 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1irm1y-0000GC-5r for submit@debbugs.gnu.org; Wed, 15 Jan 2020 12:00:34 -0500 Received: from mail-wr1-f48.google.com ([209.85.221.48]:38346) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1irm1j-0000En-PP for 38678@debbugs.gnu.org; Wed, 15 Jan 2020 12:00:25 -0500 Received: by mail-wr1-f48.google.com with SMTP id y17so16495612wrh.5 for <38678@debbugs.gnu.org>; Wed, 15 Jan 2020 09:00:19 -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=PwHWMk1U27otBKx41y54hdQkBAqj44ipVOjoZtISmno=; b=exQDk2m0CnOmrvVn1izolPIorXleqWAc5YWSGmz806YATFArTf6q2yaGAHdED27quQ 3Tq3pzA3/6IVmHXJp7edgTAXAv9+JFzt5GU6gWbQjziedtnMw37NPHQmcG1zG2gQeRHt ELm1Cgyfr2wOKQTz1rCgknOehJdrqH49tjsemrchSmVHYl9kJr17C/uE1Vvrf/nO0E2n sADIjCw0tPeR3/r46hywcH3+NKUy/mREeAkk7V76p7Xd7IE9PIHArSgHGABe3MqBjDhW eAd0qD8MvQA1L6SvwLRr7FqXrm/0R/it/l9RGGgHJ8HE71Fh2vX1Il3xLEQF0A+Uwesi w/fQ== 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=PwHWMk1U27otBKx41y54hdQkBAqj44ipVOjoZtISmno=; b=GsCxO4Mn6KSFmduDicGmveZaFnDWfiKtf4sn+3eSqP7HM+09pW2lXyphOB1ZUdv5fT yOY7q4kMe4AIBe9Nre8rfOchAAPHqM65dyHKyay2SoR33gu6czJ/hqM1N86mYLBG86h9 txLKNBMmfxKSGmbDMMEQmlmIJ/sGe0OzKe7C0hxuCVLa/KKvIK+khWcgvlgz15X0tOVy JS9pxUteED/sjHHrEDWalJ5TZfaGwEt83k4wzYbIE01lwS429hKe5ykmCtJXSo56QsWq xmK39jfIbMri/Z5K4zMA45iGZQh08oPBQE5tQ9GsVRbBzDEMK5c+62dgXuvrgAzgrdgu sqrA== X-Gm-Message-State: APjAAAXCC/81FzdbrxbfqezObEaC9eyufeBdgBXmTo0EF3OCcJAjPDmv fmdzi7UEIfxnaGDkbVxQjCnEO+sf X-Google-Smtp-Source: APXvYqy4dgf26VjDDnjrrssiW3m152P1qR4d9QpSDUfjQ4gRTgOJ2kZm2HAwT8/2zUBwxvQN05YfWg== X-Received: by 2002:a5d:6390:: with SMTP id p16mr33075407wru.170.1579107613988; Wed, 15 Jan 2020 09:00:13 -0800 (PST) Received: from pfiuh02.univ-paris-diderot.fr ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id l3sm22907347wrt.29.2020.01.15.09.00.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jan 2020 09:00:13 -0800 (PST) From: zimoun Date: Wed, 15 Jan 2020 18:00:06 +0100 Message-Id: <20200115170006.24892-6-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200115170006.24892-1-zimon.toutoune@gmail.com> References: <20200115170006.24892-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/repl.scm: (show-help): Add '--listen' option message. --- guix/scripts/repl.scm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/guix/scripts/repl.scm b/guix/scripts/repl.scm index 39a9b09656..fc3e4e2131 100644 --- a/guix/scripts/repl.scm +++ b/guix/scripts/repl.scm @@ -65,6 +65,9 @@ Start a Guile REPL in the Guix execution environment.\n")) (display (G_ " -t, --type=TYPE start a REPL of the given TYPE")) + (display (G_ " + --listen=ENDPOINT listen ENDPOINT instead of standard I/O")) + (newline) (display (G_ " -L, --load-path=DIR prepend DIR to the package module search path")) (newline)