diff --git a/pkgs/racket-pkgs/racket-doc/pkg/scribblings/pkg.scrbl b/pkgs/racket-pkgs/racket-doc/pkg/scribblings/pkg.scrbl index 9cec1f3d76..b4fb006117 100644 --- a/pkgs/racket-pkgs/racket-doc/pkg/scribblings/pkg.scrbl +++ b/pkgs/racket-pkgs/racket-doc/pkg/scribblings/pkg.scrbl @@ -326,7 +326,9 @@ sub-sub-commands: @item{@exec{user} --- Install packages for the current user and current installation's name/version.} ] The default package scope is normally @exec{user}, but it can be configured with - @command-ref{config}@exec{ --set default-scope @nonterm{scope}}.} + @command-ref{config}@exec{ --set default-scope @nonterm{scope}}. + The default installation name is normally the Racket version, but it can be configured with + @command-ref{config}@exec{ --set name @nonterm{name}}.} @item{@Flag{i} or @DFlag{installation} --- Shorthand for @exec{--scope installation}.} @item{@Flag{u} or @DFlag{user} --- Shorthand for @exec{--scope user}.} @item{@DFlag{scope-dir} @nonterm{dir} --- Select @nonterm{dir} as the @tech{package scope}.} @@ -468,6 +470,8 @@ View and modify configuration of the package manager itself, with the following @exec{installation} scope) is the default @tech{package scope} for all @exec{raco pkg} commands (even @command{config}, which is consistent but potentially confusing).} + @item{@exec{name} --- A string for the installation's name, which is used by @exec{user} + @tech{package scope} and defaults to the Racket version.} ] } diff --git a/pkgs/racket-pkgs/racket-doc/scribblings/raco/config.scrbl b/pkgs/racket-pkgs/racket-doc/scribblings/raco/config.scrbl index 6b6a44ec64..b6088c1ce2 100644 --- a/pkgs/racket-pkgs/racket-doc/scribblings/raco/config.scrbl +++ b/pkgs/racket-pkgs/racket-doc/scribblings/raco/config.scrbl @@ -86,15 +86,20 @@ directory: with version and search-tag queries to form a remote documentation reference.} - @item{@racket['catalogs] --- a list of URL strings used as the search - path for resolving package names; an @racket[#f] in the list - is replaced with the default search path.} - @item{@racket['installation-name] --- a string for the installation name, which is used for packages in @exec{user} @tech[#:doc '(lib "pkg/scribblings/pkg.scrbl")]{package scope}; the default is @racket[(version)].} + @item{@racket['catalogs] --- a list of URL strings used as the search + path for resolving package names; an @racket[#f] in the list + is replaced with the default search path.} + + @item{@racket['default-scope] --- either @racket["user"] or + @racket["installation"], determining the default @tech[#:doc + '(lib "pkg/scribblings/pkg.scrbl")]{package scope} for + package-management operations.} + @item{@racket['absolute-installation?] --- a boolean that is @racket[#t] if the installation uses absolute path names, @racket[#f] otherwise.} diff --git a/racket/collects/pkg/lib.rkt b/racket/collects/pkg/lib.rkt index 462a1bf4b8..934332cb55 100644 --- a/racket/collects/pkg/lib.rkt +++ b/racket/collects/pkg/lib.rkt @@ -489,6 +489,7 @@ (list "https://pkg.racket-lang.org" "https://planet-compat.racket-lang.org")] ['default-scope "user"] + ['installation-name (version)] [_ #f])) (define c (read-pkg-file-hash (pkg-config-file))) (define v (hash-ref c k 'none)) @@ -1631,6 +1632,12 @@ key val)) (update-pkg-cfg! 'default-scope val)] + [(list (and key "name") val) + (unless (eq? 'installation (current-pkg-scope)) + (pkg-error (~a "setting `name' makes sense only in `installation' scope\n" + " current package scope: ~a") + (current-pkg-scope))) + (update-pkg-cfg! 'installation-name val)] [(list key) (pkg-error "unsupported config key\n key: ~e" key)] [(list) @@ -1644,6 +1651,8 @@ (printf "~a\n" s))] ["default-scope" (printf "~a\n" (read-pkg-cfg/def 'default-scope))] + ["name" + (printf "~a\n" (read-pkg-cfg/def 'installation-name))] [_ (pkg-error "unsupported config key\n key: ~e" key)])] [(list)