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

[Enhancement] Chocolatey should build a packages.config as you install #67

Closed
AnthonyMastrean opened this issue Feb 16, 2012 · 24 comments
Closed

Comments

@AnthonyMastrean
Copy link
Contributor

In regards to bennage's comments on #31, Chocolatey could build your machine's packages.config as you install or update items. This way, it could also track what was installed with other sources (ruby gems, webpi, etc).

You might figure out a way to do a one-time scan of the Chocolatey packages on the machine to get started.

@ferventcoder
Copy link
Contributor

Freakin awesome idea. :D

@alexpopdev
Copy link

This would be a very cool feature. Maybe also have the ability to import packages.config files into your main one: e.g. packages.essentials.config, packages.systools.config, packages.devtools.config in order to share bundles of packages between developers.

@Porkstone
Copy link

I'm using chocolatey to install utils on a new dev machine at work, i'd love it if I could get a file of everything I installed into my dropbox folder so that next time I have to build a dev box I can use this as check list. I might also find it useful when installing something on my desktop and then later needing it on my laptop.

@junosuarez
Copy link

In addition to having this at the machine level, I think it would be very useful to create lists of packages at the gallery level - see my issue at NuGet/NuGetGallery#521

@ferventcoder
Copy link
Contributor

@jasondenizac It's fine to put issues on NuGet gallery, but keep in mind that Chocolatey and chocolatey.org are separate projects. Having the nuget gallery add it would be awesome, but sometimes things are quicker to get added to chocolatey.org and pointed to later. See this PR: NuGet/NuGetGallery#525

@findel
Copy link

findel commented May 20, 2013

What happened to this idea? I was just looking for a way to create a packages.config file on one machine so that I could share with others.

@gep13
Copy link
Member

gep13 commented May 20, 2013

@findel
Copy link

findel commented May 20, 2013

@gep13 Thanks!

@ferventcoder
Copy link
Contributor

It's coming hopefully with next release. I was just thinking of this
enhancement this morning.

On Monday, May 20, 2013, Phil Baines wrote:

@gep13 https://github.com/gep13 Thanks!


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


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 May 20, 2013

That is great news! :-)

@ot-brett-jones
Copy link

Any update on this? It would be great to use a parameter to specify if we want to install it (much like npm)

cinst thepackage --save

If --save is just a flag param then it saves to ./packages.config but you could pass a filepath to the --save param for it to save there.

@ferventcoder
Copy link
Contributor

no updates yet, but it will be automatic without a save flag. Folks would want to opt in automatically and opt out by a flag.

@ferventcoder
Copy link
Contributor

There is a workaround for this that @jongalloway came up with recently.

@cmshawn
Copy link

cmshawn commented Feb 16, 2014

@ferventcoder Do you have a link to the mentioned workaround?

@jongalloway
Copy link

I used a powershell one-liner to script based on the contents of chocolateyinstall\lib:

(ls "$env:ChocolateyInstall\lib" | select basename).basename | % {'cinst ' + $_.split('\.')[0]}  | sort -unique

If you want to comment / fork, the gist is here: https://gist.github.com/jongalloway/5f31f9dfaa11e0637868

@markwhitfeld
Copy link

This feature would be awesome! Coming soon I hope! :-)

@gep13
Copy link
Member

gep13 commented Nov 5, 2014

A tool has been proposed here:

https://groups.google.com/forum/#!topic/chocolatey/VKm1ARnzOcg

That does something similar.

@johnnyreilly
Copy link

I've just started using Chocolatey and I think this would be a fantastic feature to have! Thanks @jongalloway for the workaround too.

@nemchik
Copy link

nemchik commented Feb 20, 2015

I know this is not exactly what you're going for with this request, but here is a powershell command you can run to kinda accomplish your goal

"choco install",((clist -l | % {$_ -replace '^(\S*)\s.*$','${1}'} | select -Skip 1 | select -first (((clist -l | % {$_ -replace '^(\S*)\s.*$','${1}'} | measure).Count)-2)) -join " ") -join " " | Out-File -FilePath cinst.bat -Encoding ascii

edited to output the bat file as ascii

then just take the cinst.bat that it generates and copy it to another machine (install chocolatey on the new machine first though!)

please pardon my ridiculous inefficiency with powershell and inconsistent use of syntax.

Also note that @jongalloway posted a solution that unfortunately won't work if you have packages like dotnet3.5 because it stips out the .5

@aronovgj
Copy link

this accomplishes basically the same thing as above (if using old chocolatey the sting length in file.write() should be corrected)...
https://github.com/aronovgj/choco-auto/blob/master/create_bat.py

@nemchik
Copy link

nemchik commented Feb 20, 2015

@aronovgj yeah i didn't think about that, im using 0.9.9

@aronovgj
Copy link

sorry, edited it a few times. i actually meant my own script :)

@nemchik
Copy link

nemchik commented Feb 24, 2015

I suppose another good thing to consider would be this;

Chocolatey 0.9.9 stopped using version numbers in the lib folder naming, so if you run that command i posted and then delete all the subfolders from lib and then run the bat file it'll kinda "clean" the folder

@ferventcoder
Copy link
Contributor

Closing here as the issue has been moved to chocolatey/choco#357. Please continue discussion over there.

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