From patchwork Thu Dec 19 21:14:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Tournier X-Patchwork-Id: 16573 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 ADD7217959; Thu, 19 Dec 2019 21:15:10 +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 6A51017955 for ; Thu, 19 Dec 2019 21:15:10 +0000 (GMT) Received: from localhost ([::1]:47862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ii38X-0001h2-W8 for patchwork@mira.cbaines.net; Thu, 19 Dec 2019 16:15:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44824) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ii38R-0001gh-7F for guix-patches@gnu.org; Thu, 19 Dec 2019 16:15:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ii38Q-00076u-1o for guix-patches@gnu.org; Thu, 19 Dec 2019 16:15:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:39620) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ii38P-00075T-Q8 for guix-patches@gnu.org; Thu, 19 Dec 2019 16:15:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ii38P-00048c-Lf for guix-patches@gnu.org; Thu, 19 Dec 2019 16:15:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#38678] [PATCH 2/2] size: 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: Thu, 19 Dec 2019 21:15: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.157679004915822 (code B ref 38678); Thu, 19 Dec 2019 21:15:01 +0000 Received: (at 38678) by debbugs.gnu.org; 19 Dec 2019 21:14:09 +0000 Received: from localhost ([127.0.0.1]:45593 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ii37Z-000478-C2 for submit@debbugs.gnu.org; Thu, 19 Dec 2019 16:14:09 -0500 Received: from mail-wm1-f48.google.com ([209.85.128.48]:52745) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ii37Y-00046s-0X for 38678@debbugs.gnu.org; Thu, 19 Dec 2019 16:14:08 -0500 Received: by mail-wm1-f48.google.com with SMTP id p9so6884528wmc.2 for <38678@debbugs.gnu.org>; Thu, 19 Dec 2019 13:14:07 -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=2qA7NCtd4nq5hHoyegrHzIOQeV+ICNozfQk4fVH4gLU=; b=ROLNvhaZmyCMzgyN/k5VwURoWx/tCTxwcBlx7GUaoMTNJg7oK6/IjYyG6ng3H0KGNO Te/3C1TJcxrL0bdSTxpq13SYjeWFQVS/ALUoRpba8RWxEVxwNN3j+9XId5ZFqgTHZLUv ezA4ztYPszGqVygdTnu9ggKYU4S6BuTFRtwlvQcs7+DbjXWyBhWkYCs5GrNQxGrqhF9J 5QU08dKANTazTWzg+acl03BlYD7WibCWPyHk1E10To0RJDONJfy6ulREPO5+l9qgxA7/ hHACZQHcdU3sgnuN76X2TwfeALsezp3FKnEkPiFri0liMV1moiR2xGjdSXTKSDi2lR60 iHOw== 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=2qA7NCtd4nq5hHoyegrHzIOQeV+ICNozfQk4fVH4gLU=; b=tZC72hh/NdqHbZLcnRTqjeCU7N+/jSXmEFmlU5ZfKFixvm30OZn4aKrxipiJ1Dm3af FZ1/TLvYxHkuacxiEG62c/DeL+afgm0bMtE7Ee/UQKQHeC4Sgl+OPxTDDbNRi9Ez2k+q 45JmBKJBa8vGk7Wzf2h44s1GADQ7AjfJMpu8bqRX+FbKjSrRyKgbe+s3f1LrJcVORiML UY0yLX6+qQ/j1PZuDOTujF7TRsNXL1/Vld3qvMkAACB1/lAbRAYY3JuNvvfqj1Cjot54 +6IWxKVygyhPtXhtA1iaujF+ccCneHM91WdnTac4ERwu8BlnS92zZTvPm2Pppp12dspV Bw6g== X-Gm-Message-State: APjAAAUq5sCrLFzV2YXtKO6knov+fbBnCJGWvIv/Y70cJcCpRaY0/Cd1 Y3ml+DYS+HamfQmOm4u1CflNZhNh X-Google-Smtp-Source: APXvYqy8jgUfG45umbpjausgsd+namTnhNnbq9thndLTySwT5TTr1gKTgDjjHZKTQSUEihZOwoo5wQ== X-Received: by 2002:a1c:62c1:: with SMTP id w184mr12691435wmb.150.1576790042198; Thu, 19 Dec 2019 13:14:02 -0800 (PST) Received: from pfiuh02.univ-paris-diderot.fr ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id i16sm7657803wmb.36.2019.12.19.13.14.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 13:14:01 -0800 (PST) From: zimoun Date: Thu, 19 Dec 2019 22:14:00 +0100 Message-Id: <20191219211400.8978-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/size.scm (%option): Add '--load-path' option. * doc/guix.texi: Document it. --- doc/guix.texi | 8 +++++++- guix/scripts/size.scm | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 02f7cf5b39..c0fa6a3cab 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -69,7 +69,6 @@ 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 @@ -9837,6 +9836,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)