From 8e3ea24b48bca107f5b749dcd02a0c1b892cfe9b Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 8 Dec 2014 08:52:51 -0700 Subject: [PATCH] get-pkg-context: add `#:use-cache?` and `#:quiet?` arguments --- pkgs/racket-doc/pkg/scribblings/lib.scrbl | 19 +++++++++++++++++-- racket/collects/pkg/lib.rkt | 4 +++- racket/collects/pkg/private/content.rkt | 10 ++++++++-- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/pkgs/racket-doc/pkg/scribblings/lib.scrbl b/pkgs/racket-doc/pkg/scribblings/lib.scrbl index 29a05648c7..7b60034c1a 100644 --- a/pkgs/racket-doc/pkg/scribblings/lib.scrbl +++ b/pkgs/racket-doc/pkg/scribblings/lib.scrbl @@ -560,7 +560,10 @@ is passed on to @racket[get-info/full].} ((or/c #f ((symbol?) ((-> any)) . ->* . any)) . -> . any) - (lambda (get-pkg-info) ...)]) + (lambda (get-pkg-info) ...)] + [#:namespace namespace namespace? (make-base-namespace)] + [#:use-cache? use-cache? boolean? #f] + [#:quiet? quiet? boolean? #t]) (values (or/c #f string?) (listof module-path?) any/c)]{ @@ -586,7 +589,19 @@ The results are as follows: information-getting function (or @racket[#f]) as returned by @racket[get-info].} -]} +] + +The @racket[namespace] argument is effectively passed along to +@racket[get-info/full] and/or @racket[pkg-stage] for reading package +and collection @filepath{info.rkt} files. + +The @racket[use-cache?] and @racket[quiet?] arguments are effectively +passed to @racket[pkg-stage] to control the use of a download cache +and status reporting. + +@history[#:changed "6.1.1.2" @elem{Added the @racket[#:use-cache?] and + @racket[#:quiet?] arguments.}]} + @defproc[(extract-pkg-dependencies [info (symbol? (-> any/c) . -> . any/c)] [#:build-deps? build-deps? boolean? #t] diff --git a/racket/collects/pkg/lib.rkt b/racket/collects/pkg/lib.rkt index a6f989d9af..1b5fbf82fc 100644 --- a/racket/collects/pkg/lib.rkt +++ b/racket/collects/pkg/lib.rkt @@ -236,7 +236,9 @@ (#:extract-info (-> (or/c #f ((symbol?) ((-> any)) . ->* . any)) any/c) - #:namespace namespace?) + #:namespace namespace? + #:use-cache? boolean? + #:quiet? boolean?) (values (or/c #f string?) (listof module-path?) any/c))] diff --git a/racket/collects/pkg/private/content.rkt b/racket/collects/pkg/private/content.rkt index 3402bd1e06..1927bc97d5 100644 --- a/racket/collects/pkg/private/content.rkt +++ b/racket/collects/pkg/private/content.rkt @@ -38,9 +38,15 @@ (define (get-pkg-content desc #:namespace [metadata-ns (make-metadata-namespace)] - #:extract-info [extract-info extract-pkg-dependencies]) + #:extract-info [extract-info extract-pkg-dependencies] + #:use-cache? [use-cache? #f] + #:quiet? [quiet? #t]) (define-values (pkg-name dir cksum clean? module-paths) - (pkg-stage desc #:in-place? #t #:namespace metadata-ns)) + (pkg-stage desc + #:in-place? #t + #:namespace metadata-ns + #:use-cache? use-cache? + #:quiet? quiet?)) (define get-info (get-info/full dir #:namespace metadata-ns)) (begin0 (values cksum