2013-06-08 02:37:02 +00:00
|
|
|
module VagrantPlugins
|
2013-05-22 22:38:26 +00:00
|
|
|
module Cachier
|
|
|
|
class Bucket
|
|
|
|
class Yum < Bucket
|
|
|
|
def self.capability
|
|
|
|
:yum_cache_dir
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
if guest.capability?(:yum_cache_dir)
|
2016-09-26 11:59:40 +00:00
|
|
|
if guest_path = guest.capability(:yum_cache_dir)
|
|
|
|
return if @env[:cache_dirs].include?(guest_path)
|
2013-05-22 22:38:26 +00:00
|
|
|
|
2016-09-26 11:59:40 +00:00
|
|
|
# Ensure caching is enabled
|
|
|
|
comm.sudo("sed -i 's/keepcache=0/keepcache=1/g' /etc/yum.conf")
|
2013-05-22 22:38:26 +00:00
|
|
|
|
2016-09-26 11:59:40 +00:00
|
|
|
symlink(guest_path)
|
|
|
|
end
|
2013-05-22 22:38:26 +00:00
|
|
|
else
|
2013-08-03 17:26:10 +00:00
|
|
|
@env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'Yum')
|
2013-05-22 22:38:26 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|