raco pkg {install,update,remove}: add --batch
Adjust defaults for `--deps` and `--multi-clone` to depend on interactive vs. batch mode.
This commit is contained in:
parent
ebe1537450
commit
3cc1514a7d
|
@ -156,6 +156,7 @@
|
|||
(lambda (names scope)
|
||||
(apply
|
||||
pkg-update-command
|
||||
#:batch #t
|
||||
#:scope scope
|
||||
names))))]))
|
||||
|
||||
|
@ -187,6 +188,7 @@
|
|||
(lambda (names scope)
|
||||
(apply
|
||||
pkg-remove-command
|
||||
#:batch #t
|
||||
#:demote #t
|
||||
#:scope scope
|
||||
names))))]))
|
||||
|
@ -203,6 +205,7 @@
|
|||
(lambda (names scope)
|
||||
(apply
|
||||
pkg-remove-command
|
||||
#:batch #t
|
||||
#:scope scope
|
||||
names))))]))
|
||||
|
||||
|
|
|
@ -183,7 +183,8 @@
|
|||
[(install) (string-constant install-pkg-abort-install)]
|
||||
[(update) (string-constant install-pkg-abort-update)])
|
||||
(lambda ()
|
||||
(keyword-apply action
|
||||
(keyword-apply action
|
||||
#:batch #t
|
||||
(cmdline-kwds res)
|
||||
(cmdline-kwd-args res)
|
||||
(cmdline-args res))))
|
||||
|
|
|
@ -23,7 +23,7 @@ to the @exec{raco pkg} sub-subcommands.
|
|||
|
||||
Each-long form option of the command-line interface is a keyword
|
||||
argument to the functions described below. An argument corresponding to @DFlag{type}, @DFlag{deps},
|
||||
@DFlag{format}, or @DFlag{scope} accepts its argument as a symbol, while
|
||||
@DFlag{format}, @DFlag{scope}, or @DFlag{multi-clone} accepts its argument as a symbol, while
|
||||
other flags that take arguments expect strings.
|
||||
An argument corresponding to @DFlag{scope} is also allowed to be a path string,
|
||||
as would be provided to @DFlag{scope-dir}.
|
||||
|
|
|
@ -415,12 +415,12 @@ sub-commands.
|
|||
@item{@DFlag{deps} @nonterm{behavior} --- Selects the behavior for dependencies, where @nonterm{behavior} is one of
|
||||
@itemlist[
|
||||
@item{@exec{fail} --- Cancels the installation if dependencies are uninstalled or version requirements are unmet.
|
||||
This behavior is the default for a @nonterm{pkg-source} that is not a @tech{package name}.}
|
||||
This behavior is the default for non-@tech{interactive mode} for a @nonterm{pkg-source} that is not a @tech{package name}.}
|
||||
@item{@exec{force} --- Installs the package(s) despite missing dependencies or version requirements.
|
||||
Forcing an installation may leave package content in an inconsistent state.}
|
||||
@item{@exec{search-ask} --- Looks for dependencies (when uninstalled) or updates (when version requirements are unmet)
|
||||
via the configured @tech{package catalogs},
|
||||
but asks if you would like the packages installed or updated. This behavior is the default for a
|
||||
but asks if you would like the packages installed or updated. This behavior is the default in @tech{interactive mode} for a
|
||||
@nonterm{pkg-source} that is a @tech{package name}.}
|
||||
@item{@exec{search-auto} --- Like @exec{search-ask}, but does not ask for permission to install or update.}
|
||||
]}
|
||||
|
@ -520,7 +520,12 @@ sub-commands.
|
|||
The following modes are available:
|
||||
@itemlist[
|
||||
|
||||
@item{@exec{fail} --- Reports an error and cancels the installation (the default mode).}
|
||||
@item{@exec{ask} --- In the case when packages can be converted, ask the user whether to convert
|
||||
or allow the different clone-linking modes or clone directories. If converting
|
||||
is not an option, the installation fails. This clone-handling mode is the default
|
||||
in @tech{interactive mode}.}
|
||||
|
||||
@item{@exec{fail} --- Reports an error and cancels the installation (the default in non-@tech{interactive mode}).}
|
||||
|
||||
@item{@exec{force} --- Allows packages to have different clone-linking modes or clone directories.}
|
||||
|
||||
|
@ -529,10 +534,6 @@ sub-commands.
|
|||
all use the same clone directory. If clone-linked packages currently use
|
||||
different clone directories, installation fails.}
|
||||
|
||||
@item{@exec{ask} --- In the case when packages can be converted, ask the user whether to convert
|
||||
or allow the different clone-linking modes or clone directories. If converting
|
||||
is not an option, the installation fails.}
|
||||
|
||||
]}
|
||||
|
||||
|
||||
|
@ -541,10 +542,13 @@ sub-commands.
|
|||
|
||||
@item{@DFlag{jobs} @nonterm{n} or @Flag{j} @nonterm{n} --- Install and setup with @nonterm{n} parallel jobs.}
|
||||
|
||||
@item{@DFlag{batch} --- Disables @deftech{interactive mode}, suppressing potential prompts for a user
|
||||
(e.g., about package dependencies or clone sharing).}
|
||||
|
||||
@item{@DFlag{fail-fast} --- Breaks @exec{raco setup} as soon as any error is encountered.}
|
||||
]
|
||||
|
||||
@history[#:changed "6.1.1.5" @elem{Added the @DFlag{clone} and
|
||||
@history[#:changed "6.1.1.5" @elem{Added the @DFlag{batch}, @DFlag{clone}, and
|
||||
@DFlag{multi-clone} flags.}]}
|
||||
|
||||
|
||||
|
@ -609,9 +613,10 @@ argument.
|
|||
@item{@DFlag{multi-clone} @nonterm{mode} --- Same as for @command-ref{install}.}
|
||||
@item{@DFlag{no-setup} --- Same as for @command-ref{install}.}
|
||||
@item{@DFlag{jobs} @nonterm{n} or @Flag{j} @nonterm{n} --- Same as for @command-ref{install}.}
|
||||
@item{@DFlag{batch} --- Same as for @command-ref{install}.}
|
||||
]
|
||||
|
||||
@history[#:changed "6.1.1.5" @elem{Added the @DFlag{clone} and
|
||||
@history[#:changed "6.1.1.5" @elem{Added the @DFlag{batch}, @DFlag{clone}, and
|
||||
@DFlag{multi-clone} flags, and
|
||||
added update of enclosing package
|
||||
when no arguments are provided.}]}
|
||||
|
@ -642,8 +647,10 @@ the given @nonterm{pkg}s.
|
|||
@item{@DFlag{scope-dir} @nonterm{dir} --- Selects @nonterm{dir} as the @tech{package scope}, the same as for @command-ref{install}.}
|
||||
@item{@DFlag{no-setup} --- Same as for @command-ref{install}.}
|
||||
@item{@DFlag{jobs} @nonterm{n} or @Flag{j} @nonterm{n} --- Same as for @command-ref{install}.}
|
||||
@item{@DFlag{batch} --- Same as for @command-ref{install}.}
|
||||
]
|
||||
}
|
||||
|
||||
@history[#:changed "6.1.1.5" @elem{Added the @DFlag{batch} flag.}]}
|
||||
|
||||
|
||||
@subcommand{@command/toc{new} @nonterm{pkg} ---
|
||||
|
|
|
@ -228,7 +228,11 @@
|
|||
(parameterize ([current-pkg-catalogs (and catalog
|
||||
(list (catalog->url catalog)))])
|
||||
(pkg-install #:from-command-line? #t
|
||||
#:dep-behavior (if auto 'search-auto deps)
|
||||
#:dep-behavior (or (and auto 'search-auto)
|
||||
deps
|
||||
(if batch
|
||||
'fail
|
||||
#f)) ; 'search-ask for a package-name source, etc.
|
||||
#:all-platforms? all-platforms
|
||||
#:force? force
|
||||
#:ignore-checksums? ignore-checksums
|
||||
|
@ -241,7 +245,10 @@
|
|||
(and binary 'binary)
|
||||
(and binary-lib 'binary-lib))
|
||||
#:force-strip? force
|
||||
#:multi-clone-behavior (or multi-clone 'fail)
|
||||
#:multi-clone-behavior (or multi-clone
|
||||
(if batch
|
||||
'fail
|
||||
'ask))
|
||||
#:link-dirs? link-dirs?
|
||||
(for/list ([p (in-list sources)])
|
||||
(pkg-desc p a-type* name checksum #f
|
||||
|
@ -311,7 +318,11 @@
|
|||
(path->complete-path clone))))]))
|
||||
#:from-command-line? #t
|
||||
#:all? all
|
||||
#:dep-behavior (if auto 'search-auto deps)
|
||||
#:dep-behavior (or (and auto 'search-auto)
|
||||
deps
|
||||
(if batch
|
||||
'fail
|
||||
#f)) ; 'search-ask for a package-name source, etc.
|
||||
#:all-platforms? all-platforms
|
||||
#:force? force
|
||||
#:ignore-checksums? ignore-checksums
|
||||
|
@ -323,7 +334,10 @@
|
|||
(and binary 'binary)
|
||||
(and binary-lib 'binary-lib))
|
||||
#:force-strip? force
|
||||
#:multi-clone-behavior (or multi-clone 'fail)
|
||||
#:multi-clone-behavior (or multi-clone
|
||||
(if batch
|
||||
'fail
|
||||
'ask))
|
||||
#:link-dirs? link-dirs?))))
|
||||
(setup "updated" no-setup #f setup-collects jobs))))]
|
||||
;; ----------------------------------------
|
||||
|
@ -402,7 +416,7 @@
|
|||
"Install packages installed for other version/name"
|
||||
#:once-each
|
||||
[install-dep-flags ...
|
||||
(dep-desc ...
|
||||
(dep-desc ...
|
||||
"where the default is `search-auto'")]
|
||||
#:once-any
|
||||
[#:bool source () ("Strip built elements of the package before installing")]
|
||||
|
@ -586,9 +600,9 @@
|
|||
[#:bool user ("-u") "Shorthand for `--scope user'"]
|
||||
[(#:str dir #f) scope-dir () "Select package scope <dir>"])
|
||||
#:job-flags
|
||||
([#:bool no-setup () ("Don't run `raco setup' after changing packages (usually"
|
||||
"not a good idea)")]
|
||||
[(#:num n #f) jobs ("-j") "Setup with <n> parallel jobs"])
|
||||
([#:bool no-setup () ("Don't `raco setup' after changing packages (usually a bad idea)")]
|
||||
[(#:num n #f) jobs ("-j") "Setup with <n> parallel jobs"]
|
||||
[#:bool batch () ("Disable interactive mode and all prompts")])
|
||||
#:catalog-flags
|
||||
([(#:str catalog #f) catalog () "Use <catalog> instead of configured catalogs"])
|
||||
#:install-type-flags
|
||||
|
@ -611,7 +625,7 @@
|
|||
" search-auto: like `search-ask', but does not ask for permission")])
|
||||
#:install-dep-desc
|
||||
("where the default is `search-ask' if <pkg-source> is a package name"
|
||||
"or `fail' otherwise")
|
||||
"in interactive mode, `fail' otherwise")
|
||||
#:install-force-flags
|
||||
([#:bool all-platforms () "Follow package dependencies for all platforms"]
|
||||
[#:bool force () "Ignore conflicts"]
|
||||
|
@ -620,8 +634,8 @@
|
|||
[#:bool no-cache () "Disable download cache"])
|
||||
#:install-clone-flags
|
||||
([(#:sym mode [fail force convert ask] #f) multi-clone ()
|
||||
("Specify treatment of multiple clones of a repository"
|
||||
"valid <mode>s are: fail force convert ask")])
|
||||
("Specify treatment of multiple clones of a repository;"
|
||||
"<mode>s: ask (interactive default), fail (other default), force, or convert")])
|
||||
#:update-deps-flags
|
||||
([#:bool update-deps () "For `search-ask' or `search-auto', also update dependencies"]
|
||||
[#:bool ignore-implies () "When updating, treat `implies' like other dependencies"])
|
||||
|
|
Loading…
Reference in New Issue
Block a user