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:
parent
8615b7495e
commit
081c809fc3
4 changed files with 44 additions and 0 deletions
lib/vagrant-cachier
|
@ -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"
|
||||
|
|
25
lib/vagrant-cachier/bucket/dnf.rb
Normal file
25
lib/vagrant-cachier/bucket/dnf.rb
Normal 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
|
13
lib/vagrant-cachier/cap/fedora/dnf_cache_dir.rb
Normal file
13
lib/vagrant-cachier/cap/fedora/dnf_cache_dir.rb
Normal 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
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue