[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/03: graph: Add '--system'.
From: |
Ludovic Courtès |
Subject: |
01/03: graph: Add '--system'. |
Date: |
Sun, 16 Sep 2018 17:00:53 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit ebbfc59c21d9888d43f36d8f23862030ebaaacce
Author: Ludovic Courtès <address@hidden>
Date: Sun Sep 16 21:38:23 2018 +0200
graph: Add '--system'.
* guix/scripts/graph.scm (%options, show-help): Add '--system'.
(%default-options): Add 'system'.
(guix-graph): Pass #:system to 'run-with-store'.
---
doc/guix.texi | 7 +++++++
guix/scripts/graph.scm | 12 ++++++++++--
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index cccf166..9a19eb8 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -7711,6 +7711,13 @@ This is useful to precisely refer to a package, as in
this example:
@example
guix graph -e '(@@@@ (gnu packages commencement) gnu-make-final)'
@end example
+
address@hidden address@hidden
address@hidden -s @var{system}
+Display the graph for @var{system}---e.g., @code{i686-linux}.
+
+The package dependency graph is largely architecture-independent, but there
+are some architecture-dependent bits that this option allows you to visualize.
@end table
diff --git a/guix/scripts/graph.scm b/guix/scripts/graph.scm
index 346ca4e..145a574 100644
--- a/guix/scripts/graph.scm
+++ b/guix/scripts/graph.scm
@@ -439,6 +439,10 @@ package modules, while attempting to retain user package
modules."
(option '(#\e "expression") #t #f
(lambda (opt name arg result)
(alist-cons 'expression arg result)))
+ (option '(#\s "system") #t #f
+ (lambda (opt name arg result)
+ (alist-cons 'system arg
+ (alist-delete 'system result eq?))))
(option '(#\h "help") #f #f
(lambda args
(show-help)
@@ -462,6 +466,8 @@ Emit a representation of the dependency graph of
PACKAGE...\n"))
--list-types list the available graph types"))
(display (G_ "
-e, --expression=EXPR consider the package EXPR evaluates to"))
+ (display (G_ "
+ -s, --system=SYSTEM consider the graph for SYSTEM--e.g., \"i686-linux\""))
(newline)
(display (G_ "
-h, --help display this help and exit"))
@@ -472,7 +478,8 @@ Emit a representation of the dependency graph of
PACKAGE...\n"))
(define %default-options
`((node-type . ,%package-node-type)
- (backend . ,%graphviz-backend)))
+ (backend . ,%graphviz-backend)
+ (system . ,(%current-system))))
;;;
@@ -508,7 +515,8 @@ Emit a representation of the dependency graph of
PACKAGE...\n"))
(export-graph (concatenate nodes)
(current-output-port)
#:node-type type
- #:backend backend)))))))
+ #:backend backend))
+ #:system (assq-ref opts 'system))))))
#t)
;;; graph.scm ends here