# File lib/chef/cookbook/synchronizer.rb, line 116 def clear_obsoleted_cookbooks @events.cookbook_clean_start # Remove all cookbooks no longer relevant to this node cache.find(File.join(%w{cookbooks ** *})).each do |cache_file| cache_file =~ /^cookbooks\/([^\/]+)\// unless have_cookbook?($1) Chef::Log.info("Removing #{cache_file} from the cache; its cookbook is no longer needed on this client.") cache.delete(cache_file) @events.removed_cookbook_file(cache_file) end end @events.cookbook_clean_complete end