raco pkg show: mention auto-installed when no non-auto are installed

In the case that packages are only auto-installed in a particular
scope, `raco pkg show` should just say "[none]", instead of adding the
note about auto-installed packages that are not being shown.
This commit is contained in:
Matthew Flatt 2014-12-16 08:26:09 -07:00
parent f8c6090d37
commit 2b62ffe90b

View File

@ -65,7 +65,6 @@
empty)))) empty))))
(if (null? to-show) (if (null? to-show)
(printf " [none]\n") (printf " [none]\n")
(begin
(table-display (table-display
long? long?
(list* 'right 'right 'middle (list* 'right 'right 'middle
@ -77,7 +76,7 @@
"Checksum" "Checksum"
"Source" "Source"
(if dir? '("Directory") '())) (if dir? '("Directory") '()))
to-show)) to-show)))
(unless (or only-pkgs show-auto?) (unless (or only-pkgs show-auto?)
(define n (for/sum ([pkg (in-list pkgs)] (define n (for/sum ([pkg (in-list pkgs)]
#:when (pkg-info-auto? (hash-ref db pkg))) #:when (pkg-info-auto? (hash-ref db pkg)))
@ -86,7 +85,7 @@
(printf "~a[~a auto-installed package~a not shown]\n" (printf "~a[~a auto-installed package~a not shown]\n"
indent indent
n n
(if (= n 1) "" "s"))))))) (if (= n 1) "" "s")))))
(define (table-display long? dots-poses l) (define (table-display long? dots-poses l)
(define how-many-cols (length (first l))) (define how-many-cols (length (first l)))