2013-10-18 22:15:53 +00:00
|
|
|
# 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.
|
2013-07-17 09:38:02 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module Cachier
|
|
|
|
class Bucket
|
|
|
|
class AptCacher < Bucket
|
|
|
|
def self.capability
|
|
|
|
:apt_cacher_dir
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
if guest.capability?(:apt_cacher_dir)
|
2013-10-26 17:47:31 +00:00
|
|
|
if guest_path = guest.capability(:apt_cacher_dir)
|
2014-04-07 00:47:24 +00:00
|
|
|
synced_folder_type = (machine.config.cache.synced_folder_opts || {})[:type]
|
2014-04-07 00:34:58 +00:00
|
|
|
if synced_folder_type && synced_folder_type.to_sym == :nfs
|
2014-02-14 03:15:43 +00:00
|
|
|
symlink(guest_path)
|
2013-10-26 17:47:31 +00:00
|
|
|
else
|
2014-04-07 00:47:24 +00:00
|
|
|
@env[:ui].warn I18n.t('vagrant_cachier.nfs_required', bucket: 'apt-cacher')
|
2013-07-17 09:38:02 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
else
|
2013-10-12 21:28:09 +00:00
|
|
|
@env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: 'apt-cacher')
|
2013-07-17 09:38:02 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|