aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-07-25 00:29:47 +0200
committerLudovic Courtès <ludo@gnu.org>2014-07-25 00:29:47 +0200
commit20ffce820bafd08ff51790436c3ee36a69c13423 (patch)
tree2f5934105f16fc5c565b2d96a7c0b371e4f99de6
parent3ce9aa44f139a4a4c80ba9468b7f738b93782e0d (diff)
downloadgnu-guix-20ffce820bafd08ff51790436c3ee36a69c13423.tar
gnu-guix-20ffce820bafd08ff51790436c3ee36a69c13423.tar.gz
ui: Improve formatting of package dependencies in recutils.
* guix/ui.scm (package->recutils)[dependencies->recutils]: New procedure. Use it.
-rw-r--r--guix/ui.scm10
1 files changed, 8 insertions, 2 deletions
diff --git a/guix/ui.scm b/guix/ui.scm
index 74ea20e6c8..1b7d334757 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -453,6 +453,13 @@ WIDTH columns."
(fill-paragraph str width
(string-length "description: ")))))
+ (define (dependencies->recutils packages)
+ (let ((list (string-join (map package-full-name
+ (sort packages package<?)) " ")))
+ (string->recutils
+ (fill-paragraph list width
+ (string-length "dependencies: ")))))
+
(define (package<? p1 p2)
(string<? (package-full-name p1) (package-full-name p2)))
@@ -462,8 +469,7 @@ WIDTH columns."
(format port "dependencies: ~a~%"
(match (package-direct-inputs p)
(((labels packages . _) ...)
- (string-join (map package-full-name
- (sort packages package<?)) ", "))))
+ (dependencies->recutils packages))))
(format port "location: ~a~%"
(or (and=> (package-location p) location->string)
(_ "unknown")))