graph: Add '--load-path' option.
* guix/scripts/graph.scm (%option): Add '--load-path' option. * doc/guix.texi: Document it. * tests/guix-graph.sh: Test it.master
parent
ba07842c34
commit
ee9a735bc8
|
@ -70,6 +70,7 @@ Copyright @copyright{} 2019 Kyle Andrews@*
|
||||||
Copyright @copyright{} 2019 Alex Griffin@*
|
Copyright @copyright{} 2019 Alex Griffin@*
|
||||||
Copyright @copyright{} 2019 Guillaume Le Vaillant@*
|
Copyright @copyright{} 2019 Guillaume Le Vaillant@*
|
||||||
Copyright @copyright{} 2020 Leo Prikler@*
|
Copyright @copyright{} 2020 Leo Prikler@*
|
||||||
|
Copyright @copyright{} 2019 Simon Tournier@*
|
||||||
|
|
||||||
Permission is granted to copy, distribute and/or modify this document
|
Permission is granted to copy, distribute and/or modify this document
|
||||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||||
|
@ -10038,6 +10039,14 @@ Display the graph for @var{system}---e.g., @code{i686-linux}.
|
||||||
|
|
||||||
The package dependency graph is largely architecture-independent, but there
|
The package dependency graph is largely architecture-independent, but there
|
||||||
are some architecture-dependent bits that this option allows you to visualize.
|
are some architecture-dependent bits that this option allows you to visualize.
|
||||||
|
|
||||||
|
@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
|
@end table
|
||||||
|
|
||||||
On top of that, @command{guix graph} supports all the usual package
|
On top of that, @command{guix graph} supports all the usual package
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
|
||||||
|
;;; Copyright © 2019 Simon Tournier <zimon.toutoune@gmail.com>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -35,6 +36,7 @@
|
||||||
#:use-module ((guix scripts build)
|
#:use-module ((guix scripts build)
|
||||||
#:select (show-transformation-options-help
|
#:select (show-transformation-options-help
|
||||||
options->transformation
|
options->transformation
|
||||||
|
%standard-build-options
|
||||||
%transformation-options))
|
%transformation-options))
|
||||||
#:use-module (srfi srfi-1)
|
#:use-module (srfi srfi-1)
|
||||||
#:use-module (srfi srfi-26)
|
#:use-module (srfi srfi-26)
|
||||||
|
@ -473,6 +475,9 @@ package modules, while attempting to retain user package modules."
|
||||||
(lambda (opt name arg result)
|
(lambda (opt name arg result)
|
||||||
(alist-cons 'system arg
|
(alist-cons 'system arg
|
||||||
(alist-delete 'system result eq?))))
|
(alist-delete 'system result eq?))))
|
||||||
|
(find (lambda (option)
|
||||||
|
(member "load-path" (option-names option)))
|
||||||
|
%standard-build-options)
|
||||||
(option '(#\h "help") #f #f
|
(option '(#\h "help") #f #f
|
||||||
(lambda args
|
(lambda args
|
||||||
(show-help)
|
(show-help)
|
||||||
|
@ -501,6 +506,9 @@ Emit a representation of the dependency graph of PACKAGE...\n"))
|
||||||
(display (G_ "
|
(display (G_ "
|
||||||
-s, --system=SYSTEM consider the graph for SYSTEM--e.g., \"i686-linux\""))
|
-s, --system=SYSTEM consider the graph for SYSTEM--e.g., \"i686-linux\""))
|
||||||
(newline)
|
(newline)
|
||||||
|
(display (G_ "
|
||||||
|
-L, --load-path=DIR prepend DIR to the package module search path"))
|
||||||
|
(newline)
|
||||||
(show-transformation-options-help)
|
(show-transformation-options-help)
|
||||||
(newline)
|
(newline)
|
||||||
(display (G_ "
|
(display (G_ "
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
# GNU Guix --- Functional package management for GNU
|
# GNU Guix --- Functional package management for GNU
|
||||||
# Copyright © 2015, 2016, 2019 Ludovic Courtès <ludo@gnu.org>
|
# Copyright © 2015, 2016, 2019 Ludovic Courtès <ludo@gnu.org>
|
||||||
|
# Copyright © 2019 Simon Tournier <zimon.toutoune@gmail.com>
|
||||||
#
|
#
|
||||||
# This file is part of GNU Guix.
|
# This file is part of GNU Guix.
|
||||||
#
|
#
|
||||||
|
@ -20,10 +21,29 @@
|
||||||
# Test the 'guix graph' command-line utility.
|
# Test the 'guix graph' command-line utility.
|
||||||
#
|
#
|
||||||
|
|
||||||
tmpfile1="t-guix-graph1-$$"
|
module_dir="t-guix-graph-$$"
|
||||||
tmpfile2="t-guix-graph2-$$"
|
mkdir "$module_dir"
|
||||||
|
trap "rm -rf $module_dir" EXIT
|
||||||
|
|
||||||
|
tmpfile1="$module_dir/t-guix-graph1-$$"
|
||||||
|
tmpfile2="$module_dir/t-guix-graph2-$$"
|
||||||
trap 'rm -f "$tmpfile1" "$tmpfile2"' EXIT
|
trap 'rm -f "$tmpfile1" "$tmpfile2"' EXIT
|
||||||
|
|
||||||
|
|
||||||
|
cat > "$module_dir/foo.scm"<<EOF
|
||||||
|
(define-module (foo)
|
||||||
|
#:use-module (guix packages)
|
||||||
|
#:use-module (gnu packages base))
|
||||||
|
|
||||||
|
(define-public dummy
|
||||||
|
(package (inherit hello)
|
||||||
|
(name "dummy")
|
||||||
|
(version "42")
|
||||||
|
(synopsis "dummy package")
|
||||||
|
(description "dummy package. Only used for testing purposes.")))
|
||||||
|
EOF
|
||||||
|
|
||||||
|
|
||||||
guix graph --version
|
guix graph --version
|
||||||
|
|
||||||
for package in guile-bootstrap coreutils python
|
for package in guile-bootstrap coreutils python
|
||||||
|
@ -59,3 +79,6 @@ guix graph git | grep 'label = "openssl'
|
||||||
guix graph git --with-input=openssl=libressl | grep 'label = "libressl'
|
guix graph git --with-input=openssl=libressl | grep 'label = "libressl'
|
||||||
if guix graph git --with-input=openssl=libressl | grep 'label = "openssl'
|
if guix graph git --with-input=openssl=libressl | grep 'label = "openssl'
|
||||||
then false; else true; fi
|
then false; else true; fi
|
||||||
|
|
||||||
|
# Try --load-path
|
||||||
|
guix graph -L $module_dir dummy | grep 'label = "dummy'
|
||||||
|
|
Reference in New Issue