mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
ui: Improve formatting of package dependencies in recutils.
* guix/ui.scm (package->recutils)[dependencies->recutils]: New procedure. Use it.
This commit is contained in:
parent
3ce9aa44f1
commit
20ffce820b
1 changed files with 8 additions and 2 deletions
10
guix/ui.scm
10
guix/ui.scm
|
@ -453,6 +453,13 @@ (define (description->recutils str)
|
|||
(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 @@ (define (package<? p1 p2)
|
|||
(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")))
|
||||
|
|
Loading…
Reference in a new issue