2016-09-23 08:52:14 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module Cachier
|
|
|
|
class Bucket
|
|
|
|
class Dnf < Bucket
|
|
|
|
def self.capability
|
|
|
|
:dnf_cache_dir
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
if guest.capability?(:dnf_cache_dir)
|
2016-09-26 11:59:40 +00:00
|
|
|
if guest_path = guest.capability(:dnf_cache_dir)
|
|
|
|
return if @env[:cache_dirs].include?(guest_path)
|
2016-09-23 08:52:14 +00:00
|
|
|
|
2016-09-26 11:59:40 +00:00
|
|
|
# Ensure caching is enabled
|
|
|
|
comm.sudo("sed -i '/keepcache=/d' /etc/dnf/dnf.conf")
|
|
|
|
comm.sudo("sed -i '/^[main]/a keepcache=1' /etc/dnf/dnf.conf")
|
2016-09-23 08:52:14 +00:00
|
|
|
|
2016-09-26 11:59:40 +00:00
|
|
|
symlink(guest_path)
|
|
|
|
end
|
2016-09-23 08:52:14 +00:00
|
|
|
else
|
|
|
|
@env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'DNF')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|