Closed jetersen closed 2 years ago
Right, I'll look into that 😅
@jetersen Version information should already be part of the choco list -lo
we run to determine if a package is installed, so just some additional parsing is required there. We could use the semver crate to parse and compare the version.
Chocolatey does not follow semver.
See just my chocolatey installs:
autohotkey.portable 1.1.33.09
chocolatey 0.11.1
chocolatey-core.extension 1.3.5.1
chocolatey-windowsupdate.extension 1.0.4
maven 3.8.2
ngrok 2.3.40
omnic.install 9.8.0
scc 3.0.0
sops 3.7.1
spacesniffer 1.3.0.2
@jetersen Correct, but we will need semver for other parts of Cupboard, and if we're adding a dependency it might as well be a robust one that supports semver 😄
I believe System.Version
would suffice for chocolatey. No dependency added either.
Ok, go with System.Version
.
@patriksvensson Tests should be good now 😊
I chose to use Span methods directly because behind the scene most string methods get turned into Span and Span slice is more favorable than substring. 🚀
@patriksvensson I think this is good for a merge :)
Merged! Thank you for your contribution. Much appreciated! 👍
@jetersen Thanks for this pull request!
We also need to take the version number into account when deciding whether or not the specified package is installed, and only install if the version number is lower than the provided version number.