get-pkg-context: add #:use-cache? and #:quiet? arguments

This commit is contained in:
Matthew Flatt 2014-12-08 08:52:51 -07:00
parent 99c6f529e5
commit 8e3ea24b48
3 changed files with 28 additions and 5 deletions

View File

@ -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]

View File

@ -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))]

View File

@ -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