From 2b62ffe90bcfc27fa90aa8ca899344d21efb6ca3 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Tue, 16 Dec 2014 08:26:09 -0700 Subject: [PATCH] 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. --- racket/collects/pkg/private/show.rkt | 43 ++++++++++++++-------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/racket/collects/pkg/private/show.rkt b/racket/collects/pkg/private/show.rkt index 9321325b10..ec4bea7ff0 100644 --- a/racket/collects/pkg/private/show.rkt +++ b/racket/collects/pkg/private/show.rkt @@ -65,28 +65,27 @@ empty)))) (if (null? to-show) (printf " [none]\n") - (begin - (table-display - long? - (list* 'right 'right 'middle - (if dir? '(left) '())) - (list* - (list* (format "~aPackage~a" - indent - (if auto-shown? "[*=auto]" "")) - "Checksum" - "Source" - (if dir? '("Directory") '())) - to-show)) - (unless (or only-pkgs 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"))))))) + (table-display + long? + (list* 'right 'right 'middle + (if dir? '(left) '())) + (list* + (list* (format "~aPackage~a" + indent + (if auto-shown? "[*=auto]" "")) + "Checksum" + "Source" + (if dir? '("Directory") '())) + to-show))) + (unless (or only-pkgs 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 (table-display long? dots-poses l) (define how-many-cols (length (first l)))