# File lib/chef/cookbook/synchronizer.rb, line 170 def sync_file_in_cookbook(cookbook, file_manifest) cache_filename = File.join("cookbooks", cookbook.name, file_manifest['path']) mark_cached_file_valid(cache_filename) # If the checksums are different between on-disk (current) and on-server # (remote, per manifest), do the update. This will also execute if there # is no current checksum. if !cached_copy_up_to_date?(cache_filename, file_manifest['checksum']) download_file(file_manifest['url'], cache_filename) @events.updated_cookbook_file(cookbook.name, cache_filename) else Chef::Log.debug("Not storing #{cache_filename}, as the cache is up to date.") end cache_filename end