Fixes Issue #163: Modification for DNF package manager

Dnf is the new package manager for Fedora.
And it is the default package manager for F22 and F23

Signed-off-by: Lalatendu Mohanty <lmohanty@redhat.com>
This commit is contained in:
Lalatendu Mohanty 2015-11-16 02:32:00 +05:30
parent 8615b7495e
commit 081c809fc3
4 changed files with 44 additions and 0 deletions

View file

@ -93,6 +93,7 @@ require_relative "bucket/gem"
require_relative "bucket/chef_gem"
require_relative "bucket/pacman"
require_relative "bucket/yum"
require_relative "bucket/dnf"
require_relative "bucket/rvm"
require_relative "bucket/apt_cacher"
require_relative "bucket/apt_lists"

View file

@ -0,0 +1,25 @@
module VagrantPlugins
module Cachier
class Bucket
class Dnf < Bucket
def self.capability
:dnf_cache_dir
end
def install
if guest.capability?(:dnf_cache_dir)
guest_path = guest.capability(:dnf_cache_dir)
return if @env[:cache_dirs].include?(guest_path)
# Ensure caching is enabled
comm.sudo("echo 'keepcache=true' >> /etc/dnf/dnf.conf")
symlink(guest_path)
else
@env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'Dnf')
end
end
end
end
end
end

View file

@ -0,0 +1,13 @@
module VagrantPlugins
module Cachier
module Cap
module Fedora
module DnfCacheDir
def self.dnf_cache_dir(machine)
'/var/cache/dnf'
end
end
end
end
end
end

View file

@ -61,6 +61,11 @@ module VagrantPlugins
Cap::RedHat::YumCacheDir
end
guest_capability 'fedora', 'dnf_cache_dir' do
require_relative 'cap/fedora/dnf_cache_dir'
Cap::Fedora::DnfCacheDir
end
guest_capability 'suse', 'yum_cache_dir' do
# Disable Yum on suse guests
end