diff --git a/pkgs/racket-pkgs/racket-doc/pkg/scribblings/lib.scrbl b/pkgs/racket-pkgs/racket-doc/pkg/scribblings/lib.scrbl index b155f3ae53..503bc6dbe5 100644 --- a/pkgs/racket-pkgs/racket-doc/pkg/scribblings/lib.scrbl +++ b/pkgs/racket-pkgs/racket-doc/pkg/scribblings/lib.scrbl @@ -269,7 +269,10 @@ The package lock must be held; see @racket[with-pkg-lock].} void?]{ Implements @racket[pkg-catalog-show-command]. If @racket[all?] is true, -then @racket[names] should be empty.} +then @racket[names] should be empty. + +The @racket[current-pkg-scope-version] parameter determines the version +included in the catalog query.} @defproc[(pkg-catalog-copy [sources (listof path-string?)] @@ -280,7 +283,10 @@ then @racket[names] should be empty.} [#:override? override? boolean? #f]) void?]{ -Implements @racket[pkg-catalog-copy-command].} +Implements @racket[pkg-catalog-copy-command]. + +The @racket[current-pkg-scope-version] parameter determines the version +for extracting existing catalog information.} @defproc[(pkg-catalog-update-local [#:catalog-file catalog-file path-string? (current-pkg-catalog-file)] diff --git a/pkgs/racket-pkgs/racket-doc/pkg/scribblings/pkg.scrbl b/pkgs/racket-pkgs/racket-doc/pkg/scribblings/pkg.scrbl index e1a2f60c62..6bdf2e345f 100644 --- a/pkgs/racket-pkgs/racket-doc/pkg/scribblings/pkg.scrbl +++ b/pkgs/racket-pkgs/racket-doc/pkg/scribblings/pkg.scrbl @@ -530,6 +530,8 @@ View and modify configuration of the package manager itself, with the following @item{@DFlag{modules} --- Show the modules that are implemented by a package.} @item{@DFlag{catalog} @nonterm{catalog} --- Query @nonterm{catalog} instead of the currently configured @tech{package catalogs}.} + @item{@DFlag{version} @nonterm{version} --- Query catalogs for a result specific to @nonterm{version}, + instead of the installation's Racket version.} ] } @@ -557,6 +559,8 @@ View and modify configuration of the package manager itself, with the following over new information.} @item{@DFlag{override} --- Changes merging so that new information takes precedence over information already in @nonterm{dest-catalog}.} + @item{@DFlag{version} @nonterm{version} --- Copy catalog results specific to @nonterm{version} + (for catalogs that make a distinction), instead of the installation's Racket version.} ] } @; ---------------------------------------- diff --git a/racket/collects/pkg/lib.rkt b/racket/collects/pkg/lib.rkt index b33012b258..79a35119f3 100644 --- a/racket/collects/pkg/lib.rkt +++ b/racket/collects/pkg/lib.rkt @@ -335,7 +335,7 @@ [query (append (url-query addr/no-query) (list - (cons 'version (version))))])) + (cons 'version (current-pkg-scope-version))))])) (define (package-catalog-lookup pkg details? download-printf) (or diff --git a/racket/collects/pkg/main.rkt b/racket/collects/pkg/main.rkt index c433d72f9d..f35bdba884 100644 --- a/racket/collects/pkg/main.rkt +++ b/racket/collects/pkg/main.rkt @@ -322,7 +322,7 @@ #:strip (or (and source 'source) (and binary 'binary)))))) (setup no-setup setup-collects jobs)))] [create - "Bundle a package from a directory or installed package" + "Bundle package from a directory or installed package" #:once-any [#:bool from-dir () "Treat as a directory (the default)"] [#:bool from-install () "Treat as a package name"] @@ -374,19 +374,22 @@ (with-pkg-lock/read-only (pkg-config #f key/val)))))] [catalog-show - "Show information about packages as reported by catalog" + "Show package information as reported by a catalog" #:once-any [(#:str catalog #f) catalog () "Use instead of configured catalogs"] #:once-each [#:bool all () "Show all packages"] [#:bool only-names () "Show only package names"] [#:bool modules () "Show implemented modules"] + [(#:str vers #f) version ("-v") "Show result for Racket "] #:args pkg-name (when (and all (pair? pkg-name)) ((pkg-error 'catalog-show) "both `--all' and package names provided")) (parameterize ([current-pkg-catalogs (and catalog (list (catalog->url catalog)))] - [current-pkg-error (pkg-error 'catalog-show)]) + [current-pkg-error (pkg-error 'catalog-show)] + [current-pkg-scope-version (or version + (current-pkg-scope-version))]) (pkg-catalog-show pkg-name #:all? all #:only-names? only-names @@ -400,13 +403,16 @@ [#:bool merge () "Merge to existing database"] #:once-each [#:bool override () "While merging, override existing with new"] + [(#:str vers #f) version ("-v") "Copy information suitable for Racket "] #:args catalog (parameterize ([current-pkg-error (pkg-error 'catalog-copy)]) (when (null? catalog) ((current-pkg-error) "need a destination catalog")) - (pkg-catalog-copy (drop-right catalog 1) - (last catalog) - #:from-config? from-config - #:force? force - #:merge? merge - #:override? override))]) + (parameterize ([current-pkg-scope-version (or version + (current-pkg-scope-version))]) + (pkg-catalog-copy (drop-right catalog 1) + (last catalog) + #:from-config? from-config + #:force? force + #:merge? merge + #:override? override)))])