mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-02-01 07:16:39 +01:00
ui: 'show-manifest-transaction' tabulates package lists for install/remove.
It also removes the store file name from the output. * guix/ui.scm (show-manifest-transaction)[package-strings]: Rewrite to use 'tabulate'. Remove 'item' parameter and adjust callers.
This commit is contained in:
parent
3e5ab0a7a9
commit
8465f1f680
1 changed files with 10 additions and 11 deletions
21
guix/ui.scm
21
guix/ui.scm
|
@ -1144,15 +1144,14 @@ (define (string-pad-right* str len)
|
||||||
(define* (show-manifest-transaction store manifest transaction
|
(define* (show-manifest-transaction store manifest transaction
|
||||||
#:key dry-run?)
|
#:key dry-run?)
|
||||||
"Display what will/would be installed/removed from MANIFEST by TRANSACTION."
|
"Display what will/would be installed/removed from MANIFEST by TRANSACTION."
|
||||||
(define (package-strings name version output item)
|
(define (package-strings names versions outputs)
|
||||||
(map (lambda (name version output item)
|
(tabulate (zip (map (lambda (name output)
|
||||||
(format #f " ~a~:[:~a~;~*~]\t~a\t~a"
|
(if (string=? output "out")
|
||||||
name
|
name
|
||||||
(equal? output "out") output version
|
(string-append name ":" output)))
|
||||||
(if (package? item)
|
names outputs)
|
||||||
(package-output store item output)
|
versions)
|
||||||
item)))
|
#:initial-indent 3))
|
||||||
name version output item))
|
|
||||||
|
|
||||||
(define → ;an arrow that can be represented on stderr
|
(define → ;an arrow that can be represented on stderr
|
||||||
(right-arrow (current-error-port)))
|
(right-arrow (current-error-port)))
|
||||||
|
@ -1175,7 +1174,7 @@ (define (upgrade-string names old-version new-version outputs)
|
||||||
(match remove
|
(match remove
|
||||||
((($ <manifest-entry> name version output item) ..1)
|
((($ <manifest-entry> name version output item) ..1)
|
||||||
(let ((len (length name))
|
(let ((len (length name))
|
||||||
(remove (package-strings name version output item)))
|
(remove (package-strings name version output)))
|
||||||
(if dry-run?
|
(if dry-run?
|
||||||
(format (current-error-port)
|
(format (current-error-port)
|
||||||
(N_ "The following package would be removed:~%~{~a~%~}~%"
|
(N_ "The following package would be removed:~%~{~a~%~}~%"
|
||||||
|
@ -1228,7 +1227,7 @@ (define (upgrade-string names old-version new-version outputs)
|
||||||
(match install
|
(match install
|
||||||
((($ <manifest-entry> name version output item _) ..1)
|
((($ <manifest-entry> name version output item _) ..1)
|
||||||
(let ((len (length name))
|
(let ((len (length name))
|
||||||
(install (package-strings name version output item)))
|
(install (package-strings name version output)))
|
||||||
(if dry-run?
|
(if dry-run?
|
||||||
(format (current-error-port)
|
(format (current-error-port)
|
||||||
(N_ "The following package would be installed:~%~{~a~%~}~%"
|
(N_ "The following package would be installed:~%~{~a~%~}~%"
|
||||||
|
|
Loading…
Reference in a new issue