raco pkg config: treat empty-string catalog as default paths
An empty string provided to `raco pkg config --set catalogs` would
trigger an error previously. Instead, turn it into a `#f` in the
configuration file, which is replaced by the default search sequence.
(cherry picked from commit ec0350e6d9
)
This commit is contained in:
parent
35acaa26e4
commit
b7dce6cb51
|
@ -897,11 +897,15 @@ for @nonterm{key}.
|
||||||
@item{@DFlag{scope-dir} @nonterm{dir} --- Same as for @command-ref{install}.}
|
@item{@DFlag{scope-dir} @nonterm{dir} --- Same as for @command-ref{install}.}
|
||||||
]
|
]
|
||||||
|
|
||||||
The valid @nonterm{key}s are:
|
The valid @nonterm{key}s and corresponding @nonterm{val}s are:
|
||||||
@itemlist[
|
@itemlist[
|
||||||
@item{@exec{name} --- A string for the installation's name, which is used by @exec{user}
|
@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.}
|
@tech{package scope} and defaults to the Racket version.}
|
||||||
@item{@exec{catalogs} --- A list of URLs for @tech{package catalogs}.}
|
@item{@exec{catalogs} --- A list of URLs for @tech{package catalogs}. An empty-string
|
||||||
|
@nonterm{val} is replaced by the sequence of catalogs for the default configuration.
|
||||||
|
A @nonterm{val} that does not start with alphabetic characters followed by @litchar{://}
|
||||||
|
is treated as a path relative to the configuration directory (as
|
||||||
|
reported by @racket[find-config-dir]).}
|
||||||
@item{@exec{default-scope} --- Either @exec{installation} or @exec{user}.
|
@item{@exec{default-scope} --- Either @exec{installation} or @exec{user}.
|
||||||
The value of this key at @exec{user} scope (possibly defaulting from
|
The value of this key at @exec{user} scope (possibly defaulting from
|
||||||
@exec{installation} scope) is
|
@exec{installation} scope) is
|
||||||
|
|
|
@ -144,7 +144,11 @@
|
||||||
key
|
key
|
||||||
(format-list (cons val more-vals)))]
|
(format-list (cons val more-vals)))]
|
||||||
[(list* (and key "catalogs") val)
|
[(list* (and key "catalogs") val)
|
||||||
(update-pkg-cfg! 'catalogs val)]
|
(update-pkg-cfg! 'catalogs
|
||||||
|
(for/list ([s (in-list val)])
|
||||||
|
(cond
|
||||||
|
[(equal? s "") #f]
|
||||||
|
[else s])))]
|
||||||
[(list (and key "default-scope") val)
|
[(list (and key "default-scope") val)
|
||||||
(unless (member val '("installation" "user"))
|
(unless (member val '("installation" "user"))
|
||||||
(pkg-error (~a "invalid value for config key\n"
|
(pkg-error (~a "invalid value for config key\n"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user