class Chef::Resource::AptUpdate
Constants
- APT_CONF_DIR
- STAMP_DIR
Public Instance Methods
Source
# File lib/chef/resource/apt_update.rb, line 64 def apt_up_to_date? ::File.exist?("#{STAMP_DIR}/update-success-stamp") && ::File.mtime("#{STAMP_DIR}/update-success-stamp") > Time.now - new_resource.frequency end
Determines whether we need to run ‘apt-get update`
@return [Boolean]
Source
# File lib/chef/resource/apt_update.rb, line 69 def do_update [STAMP_DIR, APT_CONF_DIR].each do |d| directory d do recursive true end end file "#{APT_CONF_DIR}/15update-stamp" do content "APT::Update::Post-Invoke-Success {\"touch #{STAMP_DIR}/update-success-stamp 2>/dev/null || true\";};\n" action :create_if_missing end execute "apt-get -q update" do command [ "apt-get", "-q", "update" ] default_env true end end