Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

Provide Search for Local Installed Packages #276

Closed
lmayorga1980 opened this issue Apr 19, 2013 · 11 comments
Closed

Provide Search for Local Installed Packages #276

lmayorga1980 opened this issue Apr 19, 2013 · 11 comments

Comments

@lmayorga1980
Copy link

Is it possible to run ...

*clist installed Package Name, Version *

If this package if found then it should return and exit code 0 and if not any other exit code.

@rismoney
Copy link
Contributor

its called cver. We had talked about consolidating cver and clist.

usage cver all -lo will show all local installed packages.

the exit codes are in a pending PR.

examples:

C:\Users> cver 7zip

name : 7zip
found : 9.22.0
latestCompare : 000000000009.000000000022.000000000000
verMessage : Latest version installed
latest : 9.22.0
foundCompare : 000000000009.000000000022.000000000000

C:\Users> cver 7zip -lo

name found


7zip 9.22.0

@lmayorga1980
Copy link
Author

Thanks! Now I can verify if a package is already installed on the machine.

C:\Chocolatey\bin\cver.bat 7zip -lo | findstr "no version"

The %errorlevel% variable will be 0 if it can't find the package and this is what i am looking for my puppet recipe.

Thanks again.

@gep13
Copy link
Member

gep13 commented Apr 19, 2013

Is there not already a chocolatey puppet module? I have it on my todo list to have a look at it, as I am just getting into puppet, but I had assumed that this would already be taken care of there.

Gary

@rismoney
Copy link
Contributor

there is a chocolatey module https://github.com/chocolatey/puppet-chocolatey

but to get full exit codes natively we need the PR to be accepted, or you can build from my source.

@ferventcoder
Copy link
Contributor

Wouldn't zero indicate no issue? Or in this case pkg exists locally?

On Friday, April 19, 2013, Rich Siegel wrote:

there is a chocolatey module
https://github.com/chocolatey/puppet-chocolatey

but to get full exit codes natively we need the PR to be accepted, or you
can build from my source.


Reply to this email directly or view it on GitHubhttps://github.com//issues/276#issuecomment-16673615
.


Rob
"Be passionate in all you do"

http://devlicio.us/blogs/rob_reynolds
http://ferventcoder.com
http://twitter.com/ferventcoder

@gep13
Copy link
Member

gep13 commented Apr 20, 2013

Ah, I see. I am still working with straight up package, file, and services in my puppet manifests just now, but I will be looking to extend into using Chocolatey as well. Look forward to giving it a try.

@lmayorga1980
Copy link
Author

Right. If it returns 0 then it will install the package. If not it will not do anything.

https://github.com/chocolatey/puppet-chocolatey does not work properly when you set specific versions.

@rismoney
Copy link
Contributor

The current release of chocolatey isn't complete for puppet as it requires the mods in my outstanding PRs...

when you say does not work properly, what are you experiencing? I just want to confirm you aren't experiencing a different issue.

@lmayorga1980
Copy link
Author

When I add a specific version to install it still downloads the latest version rather than the one on the "ensure" attribute.

@rismoney
Copy link
Contributor

that does sound like the exit code issue on the cver query.

technically, what I think is happening in this case- it is not doing a ensure latest. The cver query is failing to determine a package is installed, so it is atempting to cinst package.
I think that is why I wrote this -

rismoney@f8ec947

Its part of the #210

@ghost ghost assigned ferventcoder Oct 11, 2013
@ferventcoder
Copy link
Contributor

This is in...

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

No branches or pull requests

4 participants