-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow specifying target semver ranges #65
Comments
Use "cargo install-update-config --version/--any-version <PACKAGE>" to set, integrates seamlessly otherwise. Ref: #65
Check latest As for the design-thingy – full of specialcases and completely ignores the current infrastructure for setting per-package config, so it obv didn't go in. |
Makes sense. I just sort of spitballed a rough design expecting further refinement. I'm glad to see this is available now! |
Right, so does it behave as you'd expect? If so, I'm gonna release it. |
I'll get a chance to try it out this evening, right now I'm limited to just looking at the patch on my phone. The one edge case I'm worried about and tried to address in my sketch is specifying a version requirement and multiple crates. So maybe I can't tell exactly how master behaves without trying it out, so I will this evening. I've now circled around and repeated myself so I need to go do what I'm supposed to be doing :P |
So, "this evening" was a good four months ago – how was it? |
I'm so sorry about the delay, obviously a series of other things appeared and delayed me. I actually can't install cargo-update right now because something about my Visual Studio setup is messed up, though, and |
(Temporarily marking as external 'till that VS issue is resolved) |
@CAD97 bump |
Especially for reproducable CI builds, it would be useful to be able to specify the desired version range to install-update to. Currently, if I want to get updates within a semver range, my only option is to
cargo install --version ^0.5 --force tarpaulin
(to pick an example). I'd like to be able tocargo install-update --allow-no-update --version ^0.5 tarpaulin
and let install-update handle not reinstalling it if it's been cached.Design
A new
--version
option is added. It takes aVersionReq
specified in the same format ascargo-install
's--version
option. If--version
is specified, exactly one package must be specified.If the installed version is the same as the latest published version within the specified version requirement, no action is taken. If a later version is available, it is installed by providing the
--version
option tocargo-install
.Implementation
(Note, I haven't seen how
cargo-install-update
is implemented, so I'm trying to keep this high-level enough to be applicable.)Add a new
--version
option. This option takes an object of typesemver::VersionReq
. For full compatibility withcargo-install
, it should be attempted to parse as an exactsemver::Version
if it doesn't start with one of=
,>
,<
,~
, or^
. This can be decided for or against externally to whatcargo-install
does, as this is a separate command with different meaning.When this
--version
option is present, fail early with an error message if more than one package are provided as trailing arguments.Rather than determine the latest semver version as the target version, first filter the list of available versions on the version requirement provided, then select the latest version. Proceed normally with the new target version.
This may require renaming the
Latest
column toTarget
or something similar when--version
is provided.The text was updated successfully, but these errors were encountered: