raco pkg show: note when auto-installed packages are not shown
Otherwise, imagine uninstalling packages without `--auto', using `raco pkg show' to confirm that none are left, and be surprised by a later error about installed packages.
This commit is contained in:
parent
6b8d84c745
commit
6fc868d5b9
|
@ -1731,31 +1731,41 @@
|
||||||
(define pkgs (sort (hash-keys db) string-ci<=?))
|
(define pkgs (sort (hash-keys db) string-ci<=?))
|
||||||
(if (null? pkgs)
|
(if (null? pkgs)
|
||||||
(printf " [none]\n")
|
(printf " [none]\n")
|
||||||
(table-display
|
(begin
|
||||||
(list*
|
(table-display
|
||||||
(append
|
(list*
|
||||||
(list (format "~aPackage~a"
|
|
||||||
indent
|
|
||||||
(if show-auto? "[*=auto]" ""))
|
|
||||||
"Checksum"
|
|
||||||
"Source")
|
|
||||||
(if dir?
|
|
||||||
(list "Directory")
|
|
||||||
empty))
|
|
||||||
(for/list ([pkg (in-list pkgs)]
|
|
||||||
#:when (or show-auto?
|
|
||||||
(not (pkg-info-auto? (hash-ref db pkg)))))
|
|
||||||
(match-define (pkg-info orig-pkg checksum auto?) (hash-ref db pkg))
|
|
||||||
(append
|
(append
|
||||||
(list (format "~a~a~a"
|
(list (format "~aPackage~a"
|
||||||
indent
|
indent
|
||||||
pkg
|
(if show-auto? "[*=auto]" ""))
|
||||||
(if auto? "*" ""))
|
"Checksum"
|
||||||
(format "~a" checksum)
|
"Source")
|
||||||
(format "~a" orig-pkg))
|
|
||||||
(if dir?
|
(if dir?
|
||||||
(list (~a (pkg-directory* pkg #:db db)))
|
(list "Directory")
|
||||||
empty))))))))
|
empty))
|
||||||
|
(for/list ([pkg (in-list pkgs)]
|
||||||
|
#:when (or show-auto?
|
||||||
|
(not (pkg-info-auto? (hash-ref db pkg)))))
|
||||||
|
(match-define (pkg-info orig-pkg checksum auto?) (hash-ref db pkg))
|
||||||
|
(append
|
||||||
|
(list (format "~a~a~a"
|
||||||
|
indent
|
||||||
|
pkg
|
||||||
|
(if auto? "*" ""))
|
||||||
|
(format "~a" checksum)
|
||||||
|
(format "~a" orig-pkg))
|
||||||
|
(if dir?
|
||||||
|
(list (~a (pkg-directory* pkg #:db db)))
|
||||||
|
empty)))))
|
||||||
|
(unless show-auto?
|
||||||
|
(define n (for/sum ([pkg (in-list pkgs)]
|
||||||
|
#:when (pkg-info-auto? (hash-ref db pkg)))
|
||||||
|
1))
|
||||||
|
(unless (zero? n)
|
||||||
|
(printf "~a[~a auto-installed package~a not shown]\n"
|
||||||
|
indent
|
||||||
|
n
|
||||||
|
(if (= n 1) "" "s"))))))))
|
||||||
|
|
||||||
(define (installed-pkg-table #:scope [given-scope #f])
|
(define (installed-pkg-table #:scope [given-scope #f])
|
||||||
(parameterize ([current-pkg-scope
|
(parameterize ([current-pkg-scope
|
||||||
|
|
Loading…
Reference in New Issue
Block a user