vagrant-cachier-ng/lib/vagrant-cachier/bucket/apt_cacher.rb
Fabio Rehm d6bed34302 ⚠️ Massive refactoring of buckets code ⚠️
Doing this is kinda irresponsible because we don't have any unit testing
in place but I've had enough of copy & pasting things around. Although it
doesn't make the codebase GREAT, I believe it'll reach a _nice_ status :)

Thanks to those changes I realized that skipping configuration of
buckets that have already been configured was easier than I thought and
should be enough to close GH-85 \o/
2014-02-14 01:15:45 -02:00

27 lines
840 B
Ruby

# Apt-Cacher NG is a caching proxy for software packages which are downloaded by
# Unix/Linux system distribution mechanisms from mirror servers accessible via HTTP.
module VagrantPlugins
module Cachier
class Bucket
class AptCacher < Bucket
def self.capability
:apt_cacher_dir
end
def install
if guest.capability?(:apt_cacher_dir)
if guest_path = guest.capability(:apt_cacher_dir)
if machine.config.cache.enable_nfs
symlink(guest_path)
else
@env[:ui].info I18n.t('vagrant_cachier.nfs_required', bucket: 'apt-cacher')
end
end
else
@env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'apt-cacher')
end
end
end
end
end
end