ui: Lexicographically sort transaction entries based on their package name.

* guix/ui.scm (show-manifest-transaction): Sort entries to be displayed in a
tabulated view.
This commit is contained in:
Maxim Cournoyer 2020-09-02 13:08:46 -04:00
parent 7d3eb5e6b7
commit 140da556be
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -1240,7 +1240,8 @@ (define* (show-manifest-transaction store manifest transaction
#:key dry-run?)
"Display what will/would be installed/removed from MANIFEST by TRANSACTION."
(define* (package-strings names versions outputs #:key old-versions)
(tabulate (zip (map (lambda (name output)
(tabulate (stable-sort
(zip (map (lambda (name output)
(if (string=? output "out")
name
(string-append name ":" output)))
@ -1252,6 +1253,8 @@ (define* (package-strings names versions outputs #:key old-versions)
(string-append old " " " " new)))
old-versions versions)
versions))
(lambda (x y)
(string<? (first x) (first y))))
#:initial-indent 3))
(define ;an arrow that can be represented on stderr