raco pkg update: add ---unclone as a kind of alias for --lookup

It's difficult to remember that the opposite of `--clone` is
effectively `--lookup`.
This commit is contained in:
Matthew Flatt 2018-04-25 09:45:53 -06:00
parent e2ef7cdd5c
commit bc55560f8d
3 changed files with 25 additions and 10 deletions

View File

@ -707,6 +707,9 @@ the given @nonterm{pkg-source}s.
To convert a clone-linked package to a normal installation, use
@command-ref{update} either with the @DFlag{lookup} flag or with
a replacement @tech{package source} that is not a package name.}
@item{@DFlag{unclone} --- An alias for @DFlag{lookup}, which (absent
@DFlag{clone}) has the effect of replacing a link to a repository
clone with a normal package installation.}
@item{@DFlag{binary} --- Same as for @command-ref{install}.}
@item{@DFlag{source} --- Same as for @command-ref{install}.}
@item{@DFlag{scope} @nonterm{scope} --- Selects a @tech{package scope}, the same as for @command-ref{install}.}
@ -742,7 +745,8 @@ the given @nonterm{pkg-source}s.
#:changed "6.1.1.6" @elem{Added the @DFlag{no-trash} flag, and changed
the @DFlag{deps} default to depend only on interactive mode.}
#:changed "6.1.1.8" @elem{Added the @DFlag{skip-uninstalled} and @DFlag{pull} flags.}
#:changed "6.4.0.14" @elem{Added the @DFlag{dry-run} flag.}]}
#:changed "6.4.0.14" @elem{Added the @DFlag{dry-run} flag.}
#:changed "6.90.0.27" @elem{Added the @DFlag{unclone} flag.}]}
@subcommand{@command/toc{remove} @nonterm{option} ... @nonterm{pkg} ...
--- Attempts to remove the given packages. By default, if a package is the dependency

View File

@ -457,7 +457,9 @@
(when (eq? mode 'convert)
(shelly-case
"Converting back to non-clone"
$ "raco pkg update --multi-clone convert --lookup one"
$ (~a "raco pkg update --multi-clone convert "
(if three? "--unclone" "--lookup") ; try either alias, arbitrarily tied to `three?`
" one")
$ "racket -l two" =stdout> "2\n"
(when three?
(shelly-begin

View File

@ -150,7 +150,9 @@
#:install-force-flags (install-force-flags ...)
#:install-clone-flags (install-clone-flags ...)
#:update-deps-flags (update-deps-flags ...)
#:install-copy-flags (install-copy-flags ...)
#:install-copy-flags/pre-clone (install-copy-flags/pre-clone ...)
#:install-copy-flags/unclone (install-copy-flags/unclone ...)
#:install-copy-flags/post-clone (install-copy-flags/post-clone ...)
#:install-copy-defns (install-copy-defns ...)
#:install-copy-checks (install-copy-checks ...))
(replace-context
@ -173,7 +175,8 @@
#:once-each
update-deps-flags ...
#:once-any
install-copy-flags ...
install-copy-flags/pre-clone ...
install-copy-flags/post-clone ...
#:once-any
scope-flags ...
#:once-each
@ -269,7 +272,9 @@
#:once-each
update-deps-flags ...
#:once-any
install-copy-flags ...
install-copy-flags/pre-clone ...
install-copy-flags/unclone ...
install-copy-flags/post-clone ...
#:once-any
scope-flags ...
#:once-each
@ -306,13 +311,14 @@
install-copy-checks ...
(define clone-path (and (eq? a-type 'clone)
(path->complete-path clone)))
(define lookup? (or lookup unclone))
(define setup-collects
(with-pkg-lock
(parameterize ([current-pkg-catalogs (and catalog
(list (catalog->url catalog)))])
(pkg-update (for/list ([pkg-source (in-list pkg-source)])
(cond
[lookup
[lookup?
(pkg-desc pkg-source a-type name checksum #f
#:path clone-path)]
[else
@ -341,7 +347,7 @@
(and binary 'binary)
(and binary-lib 'binary-lib))
#:force-strip? force
#:lookup-for-clone? lookup
#:lookup-for-clone? lookup?
#:multi-clone-behavior (or multi-clone
(if batch
'fail
@ -710,12 +716,15 @@
#: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"])
#:install-copy-flags
#:install-copy-flags/pre-clone
([#:bool link () ("Link a directory package source in place (default for a directory)")]
[#:bool static-link () ("Link in place, promising collections do not change")]
[#:bool copy () ("Treat directory sources the same as other sources")]
[(#:str dir #f) clone () ("Clone Git and GitHub package sources to <dir> and link")]
[#:bool source () ("Strip packages' built elements before installing; implies --copy")]
[(#:str dir #f) clone () ("Clone Git and GitHub package sources to <dir> and link")])
#:install-copy-flags/unclone
([#:bool unclone () ("Unclones when currently a clone; alias for --lookup")])
#:install-copy-flags/post-clone
([#:bool source () ("Strip packages' built elements before installing; implies --copy")]
[#:bool binary () ("Strip packages' source elements before installing; implies --copy")]
[#:bool binary-lib () ("Strip source & documentation before installing; implies --copy")])
#:install-copy-defns