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