-
Notifications
You must be signed in to change notification settings - Fork 137
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
Package ensure => $version, should use upgrade rather than install if a version is already installed #71
Comments
Definitely a bug. |
Think this is as easy as moving to upgrade instead of install. |
Of course I had to make reservations for install with packages.config - not allowed with upgrade/uninstall. |
When ensure => $version, the underlying package provider will call install instead of upgrade if the package is already installed. Chocolatey's default install behavior is to do nothing if a package is already installed, even if there is a newer version available. In most cases we can call upgrade, except when the installer is using a packages.config. We'll also need to address the use of side by side installs, which this will remove the ability to do.
@steve-hawkins take a look at #73 |
(GH-71) Use upgrade instead of install
@steve-hawkins this has been released in 1.0.2 |
Thanks Rob! Excellent turn-around and I can confirm this has sorted the original issue. I have however found that this does not support down-grading versions and raised a new issue #75 |
FYI just implemented an additional fix here so I could implement held. |
When ensure => "$version", Puppet will always call install. In cases of when a version is already installed, we should ensure that choco is called with upgrade.
[MODULES-4528] Replace Puppet.version.to_f version comparison from spec_helper.rb
When stating a specific version of a package
choco.exe list -lo -r
should be used to determine if the package is already present, if presentchoco.exe upgrade $package -version $version -dvy
elsechoco.exe install $package -version $version -dvy
output of
puppet agent -t --debug
At the moment
choco.exe install
is being used even if the package is already present, which is leading to strange behavior in the c:/programdata/chocolatey/lib directory, such as duplicate content.choco.exe -v 0.9.9.6
output of
puppet module list
The text was updated successfully, but these errors were encountered: