fgrehm / vagrant-cachier

Caffeine reducer
http://fgrehm.viewdocs.io/vagrant-cachier
MIT License
1.08k stars 111 forks source link

add zypper support #54

Closed gimler closed 10 years ago

gimler commented 10 years ago

Add support for zypper used by suse.

fgrehm commented 10 years ago

\o/ thanks! would you recommend a suse base box that we can use to try this out?

gimler commented 10 years ago

we use our own basebox opensuse 11.4.

We has only the problem that we can not use auto_detect because the yum bucket runs but there is no yum installed ;( I can't find the point where the plugin checks if yum is nessesary/available

fgrehm commented 10 years ago

hum... the reason why yum kicks in is because suse is a "child guest" of red hat and we are not checking whether yum is actually available on the guest VM as we do for other buckets =/

Do you want to take a stab at this?

gimler commented 10 years ago

do you have an example check? then i can check this tomorrow.

tmatilai commented 10 years ago

Another option would be to disable the "yum_cache_dir" capability from suse. Just what I did yesterday in vagrant-proxyconf. =)

fgrehm commented 10 years ago

Oh, nice one! Thanks for sharing :) I'll download an opensuse box to try this out later on and I'll let u guys know how it goes!

Fábio Rehm Sent on the run On Nov 5, 2013 2:23 PM, "Teemu Matilainen" notifications@github.com wrote:

Another option would be to disable the "yum_cache_dir" capability from suse. Just what I did yesterday in vagrant-proxyconfhttps://github.com/tmatilai/vagrant-proxyconf/blob/v1.0.0/lib/vagrant-proxyconf/plugin.rb#L85-L87. =)

— Reply to this email directly or view it on GitHubhttps://github.com/fgrehm/vagrant-cachier/pull/54#issuecomment-27787366 .

fgrehm commented 10 years ago

Folks, I did some testing last night and things worked out fine. The box I downloaded had some issues with NFS but I was still able to test the caching and @tmatilai's tip worked out fine.

I'll handle this after lunch :)

gimler commented 10 years ago

@tmatilai can you please describe how your lines work i didn't understand it.

tmatilai commented 10 years ago

@gimler In my example I'm specifying "env_proxy_conf" capability for "linux" and "coreos". As "coreos" is declared to be more specific than "linux", Vagrant prefers to use it's capability. And as the block returns (implicitly) nil, Vagrant states that the guest doesn't have that capability. (Normally the block should return a Class/Module with a class method with the same name as the capability.)

tmatilai commented 10 years ago

And yeah, took me a while to understand how that works. The magical missing part for me was the Vagrant::Registry class which stores the block for the capability but returns the lazily evaluated value when fetching it.

gimler commented 10 years ago

ahh ok understand. my ruby skills are very basic. thx

fgrehm commented 10 years ago

Closing in favor of GH-55

@gimler thanks for putting this up and welcome aboard! If you are able to try out my changes on that branch and give us some thumbs up it will be awesome :)

gimler commented 10 years ago

yum fix works as accepted