Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Open
AnthonyMastrean opened this Issue · 23 comments
@AnthonyMastrean
Collaborator

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

Freakin awesome idea. :D

@popalexandruvasile

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

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.

@jden

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

@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

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.

@findel

@gep13 Thanks!

@ferventcoder
@gep13
Collaborator

That is great news! :-)

@ot-brett-jones

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
Owner

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

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

@cmshawn

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

@jongalloway

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

@ferventcoder ferventcoder added v0.9.11 and removed v0.9.9 labels
@markwhitfeld

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

@gep13
Collaborator

A tool has been proposed here:

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

That does something similar.

@johnnyreilly

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

@nemchik

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

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

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

@aronovgj

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

@nemchik

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.