guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/06: refresh: Add '--load-path' option.


From: guix-commits
Subject: 03/06: refresh: Add '--load-path' option.
Date: Thu, 16 Jan 2020 09:28:20 -0500 (EST)

ambrevar pushed a commit to branch master
in repository guix.

commit 21f4fbdd8453e489fb89825c4226a0a0bda2bc17
Author: zimoun <address@hidden>
AuthorDate: Wed Jan 15 18:00:03 2020 +0100

    refresh: Add '--load-path' option.
    
    * guix/scripts/refresh.scm (%option): Add '--load-path' option.
    * doc/guix.texi: Document it.
---
 doc/guix.texi            | 19 +++++++++++++------
 guix/scripts/refresh.scm | 18 ++++++++++++++++++
 2 files changed, 31 insertions(+), 6 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index cbaca4a..a05ea17 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -70,7 +70,7 @@ Copyright @copyright{} 2019 Kyle Andrews@*
 Copyright @copyright{} 2019 Alex Griffin@*
 Copyright @copyright{} 2019 Guillaume Le Vaillant@*
 Copyright @copyright{} 2020 Leo Prikler@*
-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
@@ -1096,7 +1096,7 @@ similar file.  It can be converted to the OpenSSH format 
using
 @command{lsh-export-key} (@pxref{Converting keys,,, lsh, LSH Manual}):
 
 @example
-$ lsh-export-key --openssh < /etc/lsh/host-key.pub 
+$ lsh-export-key --openssh < /etc/lsh/host-key.pub
 ssh-rsa AAAAB3NzaC1yc2EAAAAEOp8FoQAAAQEAs1eB46LV@dots{}
 @end example
 
@@ -6032,9 +6032,9 @@ build file @file{build.xml} with tasks to build the 
specified jar
 archive.  In this case the parameter @code{#:source-dir} can be used to
 specify the source sub-directory, defaulting to ``src''.
 
-The @code{#:main-class} parameter can be used with the minimal ant 
-buildfile to specify the main class of the resulting jar.  This makes the 
-jar file executable.  The @code{#:test-include} parameter can be used to 
+The @code{#:main-class} parameter can be used with the minimal ant
+buildfile to specify the main class of the resulting jar.  This makes the
+jar file executable.  The @code{#:test-include} parameter can be used to
 specify the list of junit tests to run. It defaults to
 @code{(list "**/*Test.java")}.  The @code{#:test-exclude} can be used to
 disable some tests. It defaults to @code{(list "**/Abstract*.java")},
@@ -9553,6 +9553,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
@@ -26114,7 +26121,7 @@ description: Install the given fonts on the specified 
ttys (fonts are per
 + virtual console on GNU/Linux).  The value of this service is a list of
 + tty/font pairs.  The font can be the name of a font provided by the `kbd'
 + package or any valid argument to `setfont', as in this example:
-+ 
++
 +      '(("tty1" . "LatGrkCyr-8x16")
 +        ("tty2" . (file-append
 +                      font-tamzen
diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm
index daf6fcf..bc8e906 100644
--- a/guix/scripts/refresh.scm
+++ b/guix/scripts/refresh.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2017 Mathieu Othacehe <address@hidden>
 ;;; Copyright © 2018 Efraim Flashner <address@hidden>
 ;;; Copyright © 2019 Ricardo Wurmus <address@hidden>
+;;; Copyright © 2020 Simon Tournier <address@hidden>
 ;;;
 ;;; 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)
@@ -166,6 +181,9 @@ specified with `--select'.\n"))
                          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_ "
   -V, --version          display version information and exit"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]