From mboxrd@z Thu Jan 1 00:00:00 1970 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 Subject: [bug#38678] [PATCH v2 3/4] refresh: Add '--load-path' option. Resent-Message-ID: From: zimoun Date: Wed, 8 Jan 2020 19:56:23 +0100 Message-Id: <20200108185624.8609-3-zimon.toutoune@gmail.com> In-Reply-To: <20200108185624.8609-1-zimon.toutoune@gmail.com> References: <20200108185624.8609-1-zimon.toutoune@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 38678@debbugs.gnu.org Cc: zimoun * 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_ " -- 2.23.0