2013-07-17 09:38:02 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module Cachier
|
|
|
|
module Cap
|
|
|
|
module Debian
|
|
|
|
module AptCacherDir
|
2013-10-26 17:47:31 +00:00
|
|
|
CACHER_CONF = '/etc/apt-cacher-ng/acng.conf'
|
|
|
|
CACHER_CACHE_DIR = "$(cat #{CACHER_CONF} | grep CacheDir | cut -d' ' -f 2)"
|
|
|
|
|
2013-07-17 09:38:02 +00:00
|
|
|
def self.apt_cacher_dir(machine)
|
2013-10-26 17:47:31 +00:00
|
|
|
cache_dir = nil
|
|
|
|
machine.communicate.tap do |comm|
|
|
|
|
return unless comm.test("test -f #{CACHER_CONF}")
|
|
|
|
comm.execute "echo #{CACHER_CACHE_DIR}" do |buffer, output|
|
|
|
|
cache_dir = output.chomp if buffer == :stdout
|
|
|
|
end
|
|
|
|
end
|
|
|
|
return cache_dir
|
2013-07-17 09:38:02 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|