d6bed34302
Doing this is kinda irresponsible because we don't have any unit testing in place but I've had enough of copy & pasting things around. Although it doesn't make the codebase GREAT, I believe it'll reach a _nice_ status :) Thanks to those changes I realized that skipping configuration of buckets that have already been configured was easier than I thought and should be enough to close GH-85 \o/
25 lines
636 B
Ruby
25 lines
636 B
Ruby
module VagrantPlugins
|
|
module Cachier
|
|
class Bucket
|
|
class Yum < Bucket
|
|
def self.capability
|
|
:yum_cache_dir
|
|
end
|
|
|
|
def install
|
|
if guest.capability?(:yum_cache_dir)
|
|
guest_path = guest.capability(:yum_cache_dir)
|
|
return if @env[:cache_dirs].include?(guest_path)
|
|
|
|
# Ensure caching is enabled
|
|
comm.sudo("sed -i 's/keepcache=0/keepcache=1/g' /etc/yum.conf")
|
|
|
|
symlink(guest_path)
|
|
else
|
|
@env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'Yum')
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|