Skip to content
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

Exit with non-zero code if install/upgrade version and a newer version is installed #365

Closed
ferventcoder opened this issue Jul 25, 2015 · 8 comments

Comments

@ferventcoder
Copy link
Member

If someone requests a specific version and we already have a newer version installed, choco should exit with a non-zero code as it doesn't actually install the older version.

This is related to chocolatey-archive/puppet-chocolatey#75

@ferventcoder
Copy link
Member Author

This can be added as a switch that allows it to exit with non-zero. It depends on what default behavior should be.

ferventcoder added a commit that referenced this issue Aug 17, 2015
If an older version of a package is requested and allow multiple
versions is not selected, choco will do nothing but exit with zero.
This gives the appearance that choco has installed that version for
automated tools when in fact it has done nothing. Instead it should
exit non-zero with an error.

Allow choco to attempt to install/upgrade to older versions with an
additional `--allow-downgrade` switch.
ferventcoder added a commit that referenced this issue Aug 17, 2015
* stable:
  (GH-365) Exit Non-zero if newer version installed
@ferventcoder ferventcoder self-assigned this Aug 17, 2015
@ferventcoder
Copy link
Member Author

@steve-hawkins this will be in 0.9.9.9.

@ferventcoder
Copy link
Member Author

To use this, it will throw an error on install/upgrade if you ask for an older version than you have installed. If you however want this particular behavior, use --allow-downgrade (0.9.9.9+) and choco will attempt the downgrade install. You can also use --allow-multiple-versions if you are installing multiple versions of a package side by side.

@steve-hawkins
Copy link

Awesome stuff!

I'll give this a go when 0.9.9.9 is available and let you know how I get on with the Puppet module

@brown-pa
Copy link

brown-pa commented Mar 2, 2016

Is there a way to use --allow-downgrade with Chocolatey provider in Puppet?

@ferventcoder
Copy link
Member Author

@laurchris yes - add it to install_options

@ferventcoder
Copy link
Member Author

See https://forge.puppetlabs.com/chocolatey/chocolatey#install_options for details

@brown-pa
Copy link

brown-pa commented Mar 3, 2016

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants