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