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"))